Skip to content

feat(peer-mesh): add signed mesh control plane, A->C->B transit relay, and hedged dialer - #7138

Open
me2seeks wants to merge 1 commit into
stack/p2p-mesh-2-peer-identity-and-reachabilityfrom
stack/p2p-mesh-3-mesh-control-and-transit
Open

me2seeks wants to merge 1 commit into
stack/p2p-mesh-2-peer-identity-and-reachabilityfrom
stack/p2p-mesh-3-mesh-control-and-transit

Conversation

@me2seeks

@me2seeks me2seeks commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Stack A: P2P Mesh (Stacked PRs)

Part PR Branch Base
A1 #7136 stack/p2p-mesh-1-accept-remote-streams rust-preview
A2 #7137 stack/p2p-mesh-2-peer-identity-and-reachability stack/p2p-mesh-1-accept-remote-streams
A3 (this PR) #7138 stack/p2p-mesh-3-mesh-control-and-transit stack/p2p-mesh-2-peer-identity-and-reachability
A4 #7139 stack/p2p-mesh-4-cli-and-pairing-ticket stack/p2p-mesh-3-mesh-control-and-transit

Introduce platform/peer-mesh (maka-peer-mesh) implementing the owner-signed mesh roster, A -> C -> B transit policy & stream bridging, and 250ms hedged dialing with faster transit promotion.

Changes

  • platform/peer-mesh/src/roster.rs: SignedPeerMeshRosterV1, SignedPeerMeshMemberAdvertisementV1, owner-pinned monotonic MeshStateStore, and route candidate selection (RTT(A, C) + RTT(C, B) < RTT(A, B)).
  • platform/peer-mesh/src/transit.rs: fail-closed TransitPolicy (explicit owner/member authorization, optional NonZeroUsize circuit cap with RAII TransitCircuitGuard) and bridge_transit_streams.
  • platform/peer-mesh/src/dialer.rs: hedged_dial attempting direct A -> B first and hedging to approved A -> C -> B mesh transit after 250ms.
  • platform/peer-mesh/tests/mesh_behaviors.rs: real end-to-end Host::serve_remote + Relay C bridge_transit_streams + hedged_dial + ResumablePeerStream upgrade & owner-revocation eviction tests.

Verification

  • cargo test --locked -p maka-peer-mesh (2/2 pass)
  • node scripts/asf-license-headers.mjs check (pass)

@jackwener jackwener left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Correction: I am withdrawing the lease-lifetime finding from this review. Main's production Peer Mesh intentionally retains expired reachability leases as bounded recovery hints for up to 24 hours and includes them in ordinary route resolution. The reviewed Rust implementation matches that contract. I found no remaining P0–P2 issue in this PR at e8b45cfc74abe956132a9a33561fd47088c156cf.


Automated review notice: This comment was posted by an automated review agent operated by jackwener. It is not an independent human review and does not replace one.

let root_id = target_ad.advertisement().reachability_lease().lease().root_id();
if let Some(usable) = self
.leases
.resolve_usable_at(root_id, target_peer_id, now_ms, monotonic_now)

@jackwener jackwener Nov 21, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Withdrawn after comparing this stack with main's production Peer Mesh.

This review point was incorrect. Main deliberately retains expired reachability leases as bounded recovery hints for up to 24 hours, and PeerMeshNode.resolveRoutes() calls latestReachability(..., includeHistorical = true). This implementation matches that existing contract, so I am withdrawing the requested change. Sorry for the incorrect finding.

This branch has not been deployed

No deployments
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.

2 participants