Skip to content

feat: disable discv4, run discv5 on port 30303 by default#1071

Draft
meyer9 wants to merge 1 commit into
mainfrom
meyer9/disable-discv4-discovery
Draft

feat: disable discv4, run discv5 on port 30303 by default#1071
meyer9 wants to merge 1 commit into
mainfrom
meyer9/disable-discv4-discovery

Conversation

@meyer9
Copy link
Copy Markdown
Contributor

@meyer9 meyer9 commented May 11, 2026

Summary

  • Adds DISABLE_DISCV4 env var (default false): when set to true, appends --disable-discv4-discovery to reth args so callers can opt in without touching the entrypoint
  • Changes V5_DISCOVERY_PORT default from 920030303 so discv5 runs on the same port as devp2p TCP by default

Motivation

The Base Sepolia snapshot job (admin-base-reth-cbnode-sepolia) runs reth in an environment where outbound UDP to non-standard ports is blocked by NAT/firewall. This results in connected_peers=0 throughout the run — reth can't peer, can't snap-sync, FCUs always return Syncing, and the safe head never advances.

discv4 uses a stateless ping/pong UDP handshake that fails through NAT without hole-punching. discv5 uses a session-based protocol with better NAT traversal characteristics. Running discv5 on port 30303 (the standard devp2p port, already allowed outbound) gives the node the best chance of finding peers in restricted network environments.

Existing deployments are unaffected: DISABLE_DISCV4 defaults to false and V5_DISCOVERY_PORT is still overridable per-deployment.

@cb-heimdall
Copy link
Copy Markdown
Collaborator

cb-heimdall commented May 11, 2026

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

DISABLE_DISCV4=true appends --disable-discv4-discovery so callers can
opt in without changing the entrypoint. V5_DISCOVERY_PORT now defaults
to 30303 (same as devp2p TCP) instead of 9200, improving NAT traversal
in environments where only standard p2p ports are allowed outbound.

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@meyer9 meyer9 force-pushed the meyer9/disable-discv4-discovery branch from 0065815 to 035799e Compare May 11, 2026 22:43
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