Skip to content

feat(p2p): automatically detect changes in announce P2P IP#22405

Open
spypsy wants to merge 4 commits intomerge-train/spartanfrom
spy/p2p-ip-refresh-2
Open

feat(p2p): automatically detect changes in announce P2P IP#22405
spypsy wants to merge 4 commits intomerge-train/spartanfrom
spy/p2p-ip-refresh-2

Conversation

@spypsy
Copy link
Copy Markdown
Member

@spypsy spypsy commented Apr 8, 2026

Fixes A-310

Re-implements the IP auto-detection that was reverted in #21606, fixing the bootstrap node deadlock that caused nextnet to fail.

Root cause of the original failure: PR #21606 removed the upfront getPublicIp() call for all nodes, including bootstrap nodes. Bootstrap nodes need an IP in their ENR before any peers connect .

Fix: Only bootstrap nodes call getPublicIp(). Non-bootstrap nodes discover their IP entirely through discv5's PONG-based voting mechanism (enrUpdate), removing the dependency on checkip.amazonaws.com.

Changes

  • discv5 service: Enable enrUpdate when queryForIp is set (not just when p2pIp is absent). Set pingInterval to 10s (vs default 300s) so PONG votes arrive promptly. Emit ip:changed event on multiaddrUpdated.
  • libp2p service: Bridge ip:changed events to libp2p's AddressManager via addObservedAddr/confirmObservedAddr. Allow starting without an announce address when queryForIp is enabled.
  • configureP2PClientAddresses: Remove getPublicIp() call, make synchronous. Non-bootstrap nodes no longer hit the AWS checkip endpoint.

@spypsy spypsy marked this pull request as ready for review April 8, 2026 13:14
@spypsy spypsy added the ci-release-pr Creates a development tag and runs the release suite label Apr 8, 2026
@AztecBot AztecBot removed the ci-release-pr Creates a development tag and runs the release suite label Apr 8, 2026
@spypsy spypsy requested a review from charlielye as a code owner April 8, 2026 14:18
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