net: surface per-peer connection path in status (M3 groundwork)#4
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.StatusReportgains apeerslist (serde(default), so astatus.tomlwritten by an older daemon still parses);ssync statusprints onepeer: <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.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. AcceptsMixedbecause 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 alwaysDirectthere).peer_paths_report_unconnected_peer_once_as_unknown(ssync-net): bogus peer staysunknown, 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 warningsclean;cargo test --workspace -- --test-threads=1fully green;nix fmt -- --ciclean.