Skip to content

fix(net): resolve the external ip when discv4 is disabled - #27335

Open
kriss39 wants to merge 4 commits into
paradigmxyz:mainfrom
kriss39:fix/discv5-only-nat-resolver
Open

kriss39 wants to merge 4 commits into
paradigmxyz:mainfrom
kriss39:fix/discv5-only-nat-resolver

Conversation

@kriss39

@kriss39 kriss39 commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Closes #27279

Runs periodic NAT resolution for discv5-only nodes so their local ENR and node info advertise the resolved external IP without waiting for peer votes. Updates preserve advertised ports and configured address families, and resolution stays disabled when no discovery protocol is running.

Network interface lookup and HTTP client setup run on blocking workers so discovery polling does not block the network loop.

The dynamic NAT resolvers (any, upnp, publicip, netif) were only ever run by
the discv4 service, so a node with discv4 disabled and the default --nat any
never resolved its external ip. Its discv5 ENR only learned the ip from peer
votes, and until then admin_nodeInfo and the local enode advertised 127.0.0.1.

The discovery service now runs the resolver itself when discv4 is disabled and
applies the resolved ip to the local discv5 ENR, using the same interval as
discv4.
@mattsse mattsse added C-bug An unexpected or incorrect behavior A-networking Related to networking in general A-discv5 Related to discv5 discovery labels Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-discv5 Related to discv5 discovery A-networking Related to networking in general C-bug An unexpected or incorrect behavior

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

op-reth: discv5-only NAT advertise falls back to 127.0.0.1

2 participants