Skip to content

net: surface per-peer connection path in status (M3 groundwork)#4

Merged
fosskar merged 2 commits into
mainfrom
m3-peer-path
Jul 9, 2026
Merged

net: surface per-peer connection path in status (M3 groundwork)#4
fosskar merged 2 commits into
mainfrom
m3-peer-path

Conversation

@fosskar

@fosskar fosskar commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Groundwork for the M3 manual cross-network verification (TODO #1): "confirm sync works via the relay" needs evidence of which transport a peer connection actually uses — until now that meant reading iroh debug logs.

What changed

  • Node::peer_paths() (ssync-net): snapshot classifying each known peer from the active transport addresses iroh reports — direct / relay / mixed / unknown. Peers remembered twice (join + resync bookkeeping) are reported once.
  • StatusReport gains a peers list (serde(default), so a status.toml written by an older daemon still parses); ssync status prints one peer: <id> (<path>) line each.
  • docs/m3-cross-network.md: the runbook for the manual check — setup, what each path kind proves, and why relay-sees-only-ciphertext is by construction (age + QUIC), not something to observe.
  • Version 0.5.0 (new user-visible status output).

Testing

TDD, red-first:

  • peer_paths_observe_active_direct_path_once_connected (ssync-net): two in-process nodes; polls until the connection shows an active direct path. Accepts Mixed because on a networked dev machine the n0 relay can also be active — the invariant is the direct path being observed, not relay absence (5/5 stable serial runs; sandboxed CI has no network, so always Direct there).
  • peer_paths_report_unconnected_peer_once_as_unknown (ssync-net): bogus peer stays unknown, duplicate bookkeeping deduped.
  • status_report_lists_known_peers_with_path_kind + status_report_parses_without_peers_field (ssync-core): report wiring and old-daemon status.toml compat.

cargo clippy --workspace --all-targets -- -D warnings clean; cargo test --workspace -- --test-threads=1 fully green; nix fmt -- --ci clean.

fosskar added 2 commits July 9, 2026 13:50
The M3 cross-network check needs evidence of which transport a peer
connection uses; until now that meant reading iroh debug logs. Node
gains peer_paths(): a snapshot classifying each known peer from the
active transport addresses iroh reports (direct / relay / mixed /
unknown), deduped across join and resync bookkeeping.

StatusReport carries the result as a peers list (serde default, so a
status.toml written by an older daemon still parses) and ssync status
prints one peer line each.

docs/m3-cross-network.md is the runbook for the manual verification;
relay-sees-only-ciphertext is by construction (age + QUIC) and needs
no observation.

Version bumped to 0.5.0 (new user-visible status output).
An active custom transport classifies as Unknown; the doc claimed no
address is active in that case.
@fosskar fosskar enabled auto-merge July 9, 2026 11:59
@fosskar fosskar merged commit f8c220d into main Jul 9, 2026
2 checks passed
@fosskar fosskar deleted the m3-peer-path branch July 9, 2026 12:01
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