Skip to content

fix(net): default discv5 to share the discv4 port#24377

Closed
mattsse wants to merge 1 commit into
mainfrom
mattsse/fix-hive-discv5
Closed

fix(net): default discv5 to share the discv4 port#24377
mattsse wants to merge 1 commit into
mainfrom
mattsse/fix-hive-discv5

Conversation

@mattsse
Copy link
Copy Markdown
Collaborator

@mattsse mattsse commented May 20, 2026

Discv5 was defaulting to UDP port 9200 while the enode URL advertised in admin_nodeInfo only contains the discv4 port (30303). External tools like hive's devp2p discv5 test parse the enode URL and send discv5 packets to that port, so they timed out against a node that never listened on 30303.

Defaulting discv5_port/discv5_port_ipv6 to None makes them fall back to --discovery.port, automatically activating the shared-port mode introduced in #23613. This matches geth's behavior of running discv4 and discv5 on the same UDP port and is what external testers expect.

Verified locally against hive's devp2p simulator with the discv5 suite: before this change all 7 cases time out; after, Ping, PingLargeRequestID, TalkRequest and FindnodeZeroDistance pass. The remaining cases (PingMultiIP, HandshakeResend, FindnodeResults) appear to be docker-network and sigp/discv5 library behavior that's outside the scope of this change.

Discv5 was defaulting to UDP port 9200 while the enode URL advertised in
admin_nodeInfo only contains the discv4 port (30303). External tools like
hive's devp2p discv5 tester send discv5 packets to the port from the enode
URL, so they timed out against a node that never listened on 30303.

Defaulting `discv5_port`/`discv5_port_ipv6` to `None` makes them fall back
to `--discovery.port`, activating the shared-port mode added in #23613.
This matches geth's behavior of running discv4 and discv5 on the same UDP
port and is what external testers expect.
@mattsse mattsse added the A-networking Related to networking in general label May 20, 2026
@mattsse mattsse requested review from Rjected and klkvr as code owners May 20, 2026 18:56
@github-project-automation github-project-automation Bot moved this to Backlog in Reth Tracker May 20, 2026
@mattsse mattsse closed this May 20, 2026
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Reth Tracker May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-networking Related to networking in general

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant