Skip to content

feat(node): Clean old P2P stack - #4

Merged
milltay merged 8 commits into
nyksnet:mainfrom
KaffinPX:cleanup-p2p
Aug 3, 2026
Merged

feat(node): Clean old P2P stack#4
milltay merged 8 commits into
nyksnet:mainfrom
KaffinPX:cleanup-p2p

Conversation

@KaffinPX

@KaffinPX KaffinPX commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@KaffinPX
KaffinPX marked this pull request as ready for review August 3, 2026 14:53
@KaffinPX
KaffinPX requested a review from milltay August 3, 2026 14:53
@milltay
milltay merged commit 52d8a51 into nyksnet:main Aug 3, 2026
4 of 5 checks passed
@milltay

milltay commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Reviewed and merged. This matches the removal map end-to-end: the three shared symbols were relocated before the delete (network/codec.rs + close_peer_connected_callback into peer_loop.rs), legacy transport is fully gone (listener, call_peer/answer_peer, magic strings, port-9798 routing, PotentialPeers discovery), HandshakeData.listen_port removed, discovery messages dropped, IP standing now derived directly from the Multiaddr, and the StickyPeers stuck-on-Dialing fix is a nice catch. Verified with a full-workspace cargo check on the merge result against current main (branch was based pre-#3; no conflicts, #3's rpc changes intact).

Follow-ups worth a look, none blocking:

  1. HandshakeData's bincode layout changed but the substream protocol id is still /id/stream-gateway-handshake/1.0 — old↔new nodes will fail with a decode error instead of a clean mismatch. Fine for a coordinated testnet flip; consider bumping to /1.1 as hygiene.
  2. Three CLI flags are now definition-only no-ops: --max-connections-per-ip, --reconnect-cooldown, --handshake-timeout (--restrict-peers-to-list still works via the discovery gate). Either drop them or wire them into the actor's should_bounce.
  3. Pre-existing gaps that matter more now that libp2p is the only stack: spawn_peer_loop passes rand::random_bool(0.5) as the inbound flag (actor.rs:2181 — endpoint.is_dialer() has the truth), and the Main bootstrap seed is still 127.0.0.1:9899 (address_book.rs:315).
  4. MainLoopHandler::now() is newly dead code (its callers went with the legacy machinery).

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