feat(cmd/devp2p): sync devp2p tooling with upstream geth#2462
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Syncs cmd/devp2p and related p2p/enode/enr helpers with upstream geth, expanding devp2p’s debugging/deployment capabilities (ENR endpoint handling, nodeset filtering, Route53 DNS publishing, and improved RLPx/discovery tooling).
Changes:
- Refactors
p2p/enode.Nodeto cache endpoint data usingnetipand adds new ENR entry types fornetip.Addr. - Expands
cmd/devp2pwith key management commands, nodeset filtering improvements (incl.-limit/-snap), and new discv4/discv5 crawl/listen capabilities. - Adds Route53 DNS deployment support (new AWS SDK deps + tests) and improves RLPx ping disconnect decoding (+ tests).
Reviewed changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| p2p/enr/entries.go | Adds netip-based ENR IP entry types (IPv4Addr/IPv6Addr). |
| p2p/enode/urlv4.go | Updates URL generation to use netip validity instead of Incomplete(). |
| p2p/enode/nodedb.go | Changes DB decode to build nodes via ENR record + cached endpoints. |
| p2p/enode/node.go | Refactors node endpoint handling (cached netip addr/ports, endpoint helpers). |
| p2p/enode/node_test.go | Adds tests for endpoint selection/scoring between v4/v6 entries and ports. |
| p2p/enode/idscheme.go | Updates SignNull to construct nodes via newNodeWithID. |
| core/forkid/forkid.go | Introduces forkid.Filter function type used by devp2p nodeset filters. |
| cmd/devp2p/rlpxcmd.go | Improves RLPx ping (endpoint helpers, disconnect decoding, ethtest hello). |
| cmd/devp2p/rlpxcmd_test.go | Adds unit tests for disconnect payload decoding. |
| cmd/devp2p/README.md | Adds/updates devp2p usage documentation (dns, nodeset, discv4/5, eth tests). |
| cmd/devp2p/nodesetcmd.go | Adds nodeset stats, new filters (-limit, -snap), netip-based CIDR filtering. |
| cmd/devp2p/nodeset.go | Adds topN selection by score for nodeset limiting. |
| cmd/devp2p/main.go | Registers new key subcommand. |
| cmd/devp2p/keycmd.go | Adds node key management commands (generate, to-id, to-enode, to-enr). |
| cmd/devp2p/internal/ethtest/protocol.go | Adds local handshake struct alias for decoding hello messages. |
| cmd/devp2p/enrcmd.go | Improves ENR dump output and attribute formatting. |
| cmd/devp2p/dnscmd.go | Adds Route53 deploy/nuke subcommands and wiring. |
| cmd/devp2p/dns_route53.go | Implements Route53 DNS TXT deployment logic (batching/sorting/splitting). |
| cmd/devp2p/dns_route53_test.go | Adds tests for Route53 change ordering/splitting and “no change” behavior. |
| cmd/devp2p/discv5cmd.go | Refactors discv5 commands to use shared flags and parallel crawl support. |
| cmd/devp2p/discv4cmd.go | Adds discv4 listen/RPC API, extaddr handling, parallel crawl/check updates. |
| cmd/devp2p/crawl.go | Refactors crawler to support bootnode seeding, parallel updates, and progress logging. |
| go.mod | Adds AWS SDK v2 modules for Route53 support. |
| go.sum | Records new AWS SDK v2 dependency checksums. |
c460ab3 to
5f18d9f
Compare
5f18d9f to
a26b498
Compare
Proposed changes
upgrade source code of cmd/devp2p with geth
Types of changes
What types of changes does your code introduce to XDC network?
Put an
✅in the boxes that applyImpacted Components
Which parts of the codebase does this PR touch?
Put an
✅in the boxes that applyChecklist
Put an
✅in the boxes once you have confirmed below actions (or provide reasons on not doing so) that