Skip to content

cmd/devp2p: add discovery endpoint tests - #35534

Draft
flcl42 wants to merge 2 commits into
ethereum:masterfrom
flcl42:devp2p-discovery-endpoint-tests
Draft

cmd/devp2p: add discovery endpoint tests#35534
flcl42 wants to merge 2 commits into
ethereum:masterfrom
flcl42:devp2p-discovery-endpoint-tests

Conversation

@flcl42

@flcl42 flcl42 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a discv4 protocol test that bonds a synthetic peer with distinct UDP and TCP ports, then verifies FINDNODE/NEIGHBORS preserves both endpoint ports.
  • Extend the discv5 FINDNODE zero-distance test to validate the returned self ENR endpoint entries are usable and internally paired.
  • Add optional devp2p discv5 test flags for expected IPv4 and IPv6 self-record endpoint addresses so external harnesses can validate configured dual-stack advertisements.
  • Make the discv5 test listener use net.JoinHostPort so IPv6 listen addresses work.

Validation

  • go test ./cmd/devp2p/...
  • go test ./p2p/discover/... ./p2p/enode/... ./p2p/enr/...
  • go build ./cmd/devp2p
  • git diff --check

Related

@flcl42
flcl42 force-pushed the devp2p-discovery-endpoint-tests branch from ca8098b to d850ad1 Compare August 13, 2026 15:50
@flcl42 flcl42 changed the title Add devp2p discovery endpoint tests cmd/devp2p: add discovery endpoint tests Aug 13, 2026
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.

1 participant