Skip to content

feat(cmd/devp2p): sync devp2p tooling with upstream geth#2462

Open
gzliudan wants to merge 9 commits into
XinFinOrg:dev-upgradefrom
gzliudan:upgrade-cmd-devp2p
Open

feat(cmd/devp2p): sync devp2p tooling with upstream geth#2462
gzliudan wants to merge 9 commits into
XinFinOrg:dev-upgradefrom
gzliudan:upgrade-cmd-devp2p

Conversation

@gzliudan

Copy link
Copy Markdown
Collaborator

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 apply

  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Changes that don't change source code or tests
  • docs: Documentation only changes
  • feat: A new feature
  • fix: A bug fix
  • perf: A code change that improves performance
  • refactor: A code change that neither fixes a bug nor adds a feature
  • revert: Revert something
  • style: Changes that do not affect the meaning of the code
  • test: Adding missing tests or correcting existing tests

Impacted Components

Which parts of the codebase does this PR touch?
Put an in the boxes that apply

  • Consensus
  • Account
  • Network
  • Geth
  • Smart Contract
  • External components
  • Not sure (Please specify below)

Checklist

Put an in the boxes once you have confirmed below actions (or provide reasons on not doing so) that

  • This PR has sufficient test coverage (unit/integration test) OR I have provided reason in the PR description for not having test coverage
  • Tested on a private network from the genesis block and monitored the chain operating correctly for multiple epochs.
  • Provide an end-to-end test plan in the PR description on how to manually test it on the devnet/testnet.
  • Tested the backwards compatibility.
  • Tested with XDC nodes running this version co-exist with those running the previous version.
  • Relevant documentation has been updated as part of this PR
  • N/A

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0303c819-cbfe-4ad2-a2dc-cb7c745fffff

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Node to cache endpoint data using netip and adds new ENR entry types for netip.Addr.
  • Expands cmd/devp2p with 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.

Comment thread p2p/enode/nodedb.go
Comment thread p2p/enode/node.go
Comment thread cmd/devp2p/rlpxcmd.go
Comment thread cmd/devp2p/rlpxcmd.go Outdated
Comment thread cmd/devp2p/discv4cmd.go
@gzliudan
gzliudan force-pushed the upgrade-cmd-devp2p branch from c460ab3 to 5f18d9f Compare July 14, 2026 09:00
@gzliudan
gzliudan force-pushed the upgrade-cmd-devp2p branch from 5f18d9f to a26b498 Compare July 20, 2026 08:54
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.

4 participants