feat(peer): Leg B relayed connect responder + nat_identity injection (#1532) [BLOCKED: dig-nat 0.11 cascade]#83
Draft
MichaelTaylor3d wants to merge 2 commits into
Draft
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
Wire the responder half of relayed connect (Leg B, #1532/#1536): - inject the persistent NodeCert into GossipConfig::nat_identity so every transport presents the ONE advertised peer_id (#1541) — extracted into the tested apply_persistent_identity helper. - enable the dig-nat relay accept path (RelayStatus::enable_accept) BEFORE the reservation registers, and spawn an accept-loop handing each introduced RelayTunnel to RelayAcceptor::accept, serving the resulting PeerConnection identically to a direct inbound (serve_accepted_relay_conn), bounded by the same accepted-connection semaphore. - bump dig-nat 0.11 + dig-gossip v0.14.0 (rev 31f3f33) + 3-rev lockstep; version 0.55.0. - TDD: apply_persistent_identity one-identity invariant + accept-serve over a real authenticated mTLS session. BLOCKED: the peer stack (dig-gossip 0.14/dig-dht 0.5/dig-download 0.6/ dig-peer-selector 0.5) still pins dig-nat "0.10" (^0.10 excludes 0.11) → two dig-nat versions → RelayStatus/NatConfig type mismatch at the dig-gossip boundary. Needs the release-first dig-nat-0.11 widen+re-release cascade first. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Closes #1532 (Leg B relayed-connect responder half; the #836 flywheel connect finish).
Status: BLOCKED on a release-first cascade — do NOT merge (does not compile yet)
dig-nat 0.11.0 ships the responder API (
RelayStatus::enable_accept+RelayAcceptor), but the rest of the peer stack was NOT re-released onto 0.11:"0.10""0.10""0.10""0.10""0.10"=^0.10=>=0.10,<0.11, which EXCLUDES 0.11. dig-node-core needs 0.11 (forenable_accept), the stack needs 0.10 → two dig-nat versions coexist → type mismatch at the dig-gossip boundary:Required first (release-first, bottom-up, orchestrator-coordinated): widen the dig-nat requirement to allow 0.11 (0.11 is additive/API-compatible) and re-release dig-dht → dig-download → dig-peer-selector → dig-gossip (new tag), THEN this branch resumes.
dig-node-side changes on this branch (correct + ready; compile+green once the stack is on 0.11)
[patch.crates-io]lockstep, Cargo.lock (exactly one dig-gossip stanza verified). version → 0.55.0.apply_persistent_identity(&mut cfg, &identity)sets the advertised pool peer_id from the persistent NodeCert SPKI AND injects the SAME NodeCert asGossipConfig::nat_identity(one identity across all transports; the Leg-B mismatch fix).enable_accept()turned on before the reservation registers (no dropped circuits);spawn_relay_accept_loophands each introducedRelayTunneltoRelayAcceptor::acceptand serves the resulting session viaserve_accepted_relay_conn(identical to a direct inbound), bounded by the accepted-connection semaphore.peer_id_hexderived from the persistent NodeCert (run_relay_connectionregisters that advertised peer_id; the reservation wire is a WebSocket, not mTLS, so it takes the peer_id string, not a cert).apply_persistent_identity_makes_one_identity_span_all_transports;serve_accepted_relay_conn_serves_a_peer_rpc_over_an_authenticated_session(real mTLS, dig-nat Direct client → accepted-circuit server → peer RPC answered).Blast radius (checked)
wire_relay_reservation(return type now(status, Option<Receiver>); one internal caller + one test updated), the gossip config build inrun_peer_network, newspawn_relay_accept_loop/serve_accepted_relay_conn/apply_persistent_identity. No public dig-node API removed/renamed.🤖 Generated with Claude Code