Skip to content

fix(reticulum): fail PN sync fast when path unknown - #831

Merged
rinchen merged 2 commits into
mainfrom
pn
Aug 9, 2026
Merged

fix(reticulum): fail PN sync fast when path unknown#831
rinchen merged 2 commits into
mainfrom
pn

Conversation

@rinchen

@rinchen rinchen commented Aug 9, 2026

Copy link
Copy Markdown
Member

Summary

  • Hard-gate remote PN sync on ensure_path_for_direct after announce settle; return PROPAGATION_PATH_UNKNOWN instead of starting Establishing and timing out as syncTimedOut (matches offer probe).
  • Auto cascade order is now finite-hop discovered → configured remotes → hops-unknown discovered → local-prop (if enabled); Manual still Preferred → other configured → local.
  • Surface reticulumPropagation.syncPathUnknown in UI; widen developer-bundle log filter for propagation-sync / establish / path-unknown lines; add regression coverage (sidecar source contract + renderer cascade/mapping).

Test plan

  • Vitest: reticulumPropagationSync, reticulumPropagationMode, reticulumPropagationAutoApply, support-bundle (pre-commit covered related)
  • Sidecar: cargo test --features rns-stack,rns-ble,rns-rnode-tcp source_host_peer_sync_idle_gate_and_policy_start
  • Manual: Sync Auto with a hops-unknown discovered PN and no path → immediate “no path” error, cascade advances to configured/local
  • Manual: Preferred unreachable remote → path-unknown, then other remotes, then local if enabled
  • Confirm successful sync still works when a path exists (have-all / retrieve logs)

Summary by CodeRabbit

  • New Features

    • Auto propagation now prioritizes reachable discovered nodes, then configured remotes, unknown-reachability nodes, and the local node.
    • Propagation sync validates a usable network path before starting.
    • Added clearer path status and hop-count information to startup logs.
  • Bug Fixes

    • Sync now stops safely when no propagation path is available.
    • Added a specific PROPAGATION_PATH_UNKNOWN diagnostic for clearer failure reporting.
  • Support

    • Support-bundle logs now retain propagation sync and path-establishment diagnostics.

Stop discarding ensure_path_for_direct in start_propagation_sync so
unreachable discovered/preferred PNs return PROPAGATION_PATH_UNKNOWN
instead of stalling into syncTimedOut. Auto cascade now tries finite-hop
discovered, then configured remotes, then hops-unknown discovered, then
local-prop.
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@rinchen, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Pro Plus

Run ID: 4ac538fc-1afb-4a36-bbe4-f9df72b4113c

📥 Commits

Reviewing files that changed from the base of the PR and between 834b0b4 and a1818e4.

📒 Files selected for processing (2)
  • reticulum-sidecar/src/stack/live.rs
  • reticulum-sidecar/src/stack/propagation_bridge.rs
📝 Walkthrough

Walkthrough

Auto propagation now orders finite-hop discovered nodes before configured remotes, then unknown-hop nodes and local propagation. Sidecar sync validates the path after announce settling and returns PROPAGATION_PATH_UNKNOWN when path establishment fails.

Changes

Propagation target ordering

Layer / File(s) Summary
Auto target priority
src/renderer/lib/reticulum/reticulumPropagationMode.ts, src/renderer/lib/reticulum/reticulumPropagationMode.test.ts
Auto selection now prioritizes finite-hop discovered targets, configured remotes, unknown-hop discovered targets, and the local node.
Propagation cascade execution
src/renderer/lib/reticulum/reticulumPropagationAutoApply.ts, src/renderer/lib/reticulum/reticulumPropagationAutoApply.test.ts, docs/agents/reticulum.md
The cascade applies the new order and shared filtering, deduplication, cancellation, deadline, and fallback handling.

Propagation path validation

Layer / File(s) Summary
Path gate and diagnostics
reticulum-sidecar/src/stack/live.rs, reticulum-sidecar/src/stack/propagation_bridge.rs, src/renderer/lib/reticulum/reticulumPropagationSync.ts, src/renderer/lib/reticulum/reticulumPropagationSync.test.ts, src/main/support-bundle.ts, src/main/support-bundle.test.ts
Sidecar sync validates paths after announce settling, clears failed claims, returns PROPAGATION_PATH_UNKNOWN, maps the error, and preserves related diagnostics in support-bundle logs.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AutoApply
  participant TargetSelection
  participant SidecarSync
  participant PathDiscovery
  AutoApply->>TargetSelection: select target by hop and remote priority
  TargetSelection-->>AutoApply: return target
  AutoApply->>SidecarSync: start propagation sync
  SidecarSync->>PathDiscovery: establish path after announce settling
  PathDiscovery-->>SidecarSync: return path status and hop count
  alt path available
    SidecarSync-->>AutoApply: start sync
  else path unavailable
    SidecarSync-->>AutoApply: return PROPAGATION_PATH_UNKNOWN
  end
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: failing propagation-node synchronization quickly when the path is unknown.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pn

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@reticulum-sidecar/src/stack/live.rs`:
- Around line 3623-3639: The propagation sync flow must validate the direct path
before doing peering work. In the relevant propagation-start method, move
ensure_path_for_direct immediately after announce settlement and the
outbound-busy check, return PROPAGATION_PATH_UNKNOWN with existing failure-state
cleanup when it fails, and invoke resolve_propagation_peering only after the
path succeeds. Add a regression case covering nonzero peering cost with a
missing path.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Pro Plus

Run ID: 33e998ef-08a5-4db6-b782-8c1418fab529

📥 Commits

Reviewing files that changed from the base of the PR and between 6336f1e and 834b0b4.

⛔ Files ignored due to path filters (16)
  • src/renderer/locales/cs/translation.json is excluded by !src/renderer/locales/**
  • src/renderer/locales/de/translation.json is excluded by !src/renderer/locales/**
  • src/renderer/locales/en/translation.json is excluded by !src/renderer/locales/**
  • src/renderer/locales/es/translation.json is excluded by !src/renderer/locales/**
  • src/renderer/locales/fr/translation.json is excluded by !src/renderer/locales/**
  • src/renderer/locales/id/translation.json is excluded by !src/renderer/locales/**
  • src/renderer/locales/it/translation.json is excluded by !src/renderer/locales/**
  • src/renderer/locales/ja/translation.json is excluded by !src/renderer/locales/**
  • src/renderer/locales/ko/translation.json is excluded by !src/renderer/locales/**
  • src/renderer/locales/nl/translation.json is excluded by !src/renderer/locales/**
  • src/renderer/locales/pl/translation.json is excluded by !src/renderer/locales/**
  • src/renderer/locales/pt-BR/translation.json is excluded by !src/renderer/locales/**
  • src/renderer/locales/ru/translation.json is excluded by !src/renderer/locales/**
  • src/renderer/locales/tr/translation.json is excluded by !src/renderer/locales/**
  • src/renderer/locales/uk/translation.json is excluded by !src/renderer/locales/**
  • src/renderer/locales/zh/translation.json is excluded by !src/renderer/locales/**
📒 Files selected for processing (11)
  • docs/agents/reticulum.md
  • reticulum-sidecar/src/stack/live.rs
  • reticulum-sidecar/src/stack/propagation_bridge.rs
  • src/main/support-bundle.test.ts
  • src/main/support-bundle.ts
  • src/renderer/lib/reticulum/reticulumPropagationAutoApply.test.ts
  • src/renderer/lib/reticulum/reticulumPropagationAutoApply.ts
  • src/renderer/lib/reticulum/reticulumPropagationMode.test.ts
  • src/renderer/lib/reticulum/reticulumPropagationMode.ts
  • src/renderer/lib/reticulum/reticulumPropagationSync.test.ts
  • src/renderer/lib/reticulum/reticulumPropagationSync.ts

Comment thread reticulum-sidecar/src/stack/live.rs
Avoid burning nonzero peering_cost PoW when ensure_path_for_direct fails;
keep PATH_UNKNOWN fail-fast and assert path → peering → start_sync order.
@rinchen
rinchen merged commit 6b99225 into main Aug 9, 2026
21 checks passed
@rinchen
rinchen deleted the pn branch August 9, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant