Skip to content

cl/sentinel: fix DISCV5 ENR missing IP when discovery address is unspecified.#19647

Merged
lystopad merged 2 commits intorelease/3.3from
feature/lystopad/cherry-pick-to-r3.3-issue-19576
Mar 5, 2026
Merged

cl/sentinel: fix DISCV5 ENR missing IP when discovery address is unspecified.#19647
lystopad merged 2 commits intorelease/3.3from
feature/lystopad/cherry-pick-to-r3.3-issue-19576

Conversation

@lystopad
Copy link
Member

@lystopad lystopad commented Mar 5, 2026

Confirmed it works on sepolia node.

When caplin.discovery.addr defaults to 0.0.0.0, the ENR ends up with no IP because updateEndpoints() rejects unspecified addresses. This makes the node undiscoverable via DISCV5.

Fix by detecting the preferred outbound IP via the OS routing table (net.Dial("udp", ...) without sending traffic) when the configured address is unspecified. Also add a nil-guard in Identity() to prevent panic when ENR has no IP.

Cherry-pick of #19585 to release/3.3 — adapted because on this branch the localnode setup lives in cl/sentinel/sentinel.go (createLocalNode method) rather than in a separate cl/p2p/p2p_localnode.go file.

Fixes #19576

Co-Authored-By: Claude

…ecified

When caplin.discovery.addr defaults to 0.0.0.0, the ENR ends up with no
IP because updateEndpoints() rejects unspecified addresses. This makes
the node undiscoverable via DISCV5.

Fix by detecting the preferred outbound IP via the OS routing table
(net.Dial("udp", ...) without sending traffic) when the configured
address is unspecified. Also add a nil-guard in Identity() to prevent
panic when ENR has no IP.

Cherry-pick of #19585 to release/3.3 — adapted because on this branch
the localnode setup lives in cl/sentinel/sentinel.go (createLocalNode
method) rather than in a separate cl/p2p/p2p_localnode.go file.

Fixes #19576

Co-Authored-By: Claude
@lystopad lystopad requested a review from AskAlexSharov March 5, 2026 08:58
@lystopad lystopad self-assigned this Mar 5, 2026
@lystopad lystopad marked this pull request as ready for review March 5, 2026 08:58
@lystopad lystopad enabled auto-merge (squash) March 5, 2026 08:58
@lystopad lystopad merged commit 4a63bfc into release/3.3 Mar 5, 2026
11 checks passed
@lystopad lystopad deleted the feature/lystopad/cherry-pick-to-r3.3-issue-19576 branch March 5, 2026 10:49
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