Skip to content

feat(eth): implement EIP-2464 - xdc/165 transaction fetcher #20234 #21032 #22181 #32210#2490

Open
gzliudan wants to merge 1 commit into
XinFinOrg:dev-upgradefrom
gzliudan:xdc165
Open

feat(eth): implement EIP-2464 - xdc/165 transaction fetcher #20234 #21032 #22181 #32210#2490
gzliudan wants to merge 1 commit into
XinFinOrg:dev-upgradefrom
gzliudan:xdc165

Conversation

@gzliudan

@gzliudan gzliudan commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Proposed changes

implement eth/65 protocol

Ref:

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 23, 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 Plus

Run ID: 16d8ce34-b411-4f9b-9ccf-094d48b16382

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

Adds support for the new xdc/165 (eth/65-style) transaction announcement + pooled transaction retrieval flow (EIP-2464-style), introducing a dedicated transaction fetcher and updating the protocol manager/peer logic to use announcements instead of eager full-tx sync for 165+.

Changes:

  • Add xdc165 protocol version + new tx fetch message codes (NewPooledTransactionHashes, GetPooledTransactions, PooledTransactions).
  • Split the legacy block fetcher into BlockFetcher and new TxFetcher, and wire both into the syncer/handler paths.
  • Update tests and devp2p eth test helpers to reflect renamed message codes and the new 165 tx announcement behavior.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
eth/sync.go Announce tx hashes to xdc/165+ peers during initial tx sync; start/stop new fetchers in syncer.
eth/sync_test.go Run fast-sync disabling test across protocol versions (63/164/165); update peer creation signature.
eth/protocol.go Introduce xdc165, add new message codes, rename TxMsgTransactionMsg, extend txPool interface.
eth/protocol_test.go Extend protocol tests to 165, update tx send/recv expectations, add tx propagation/announcement tests.
eth/peer.go Add async tx announce/broadcast loops and pooled-tx request/response helpers; update handshake for 165.
eth/metrics.go Update metering switch from TxMsg to TransactionMsg.
eth/helper_test.go Update test txpool to support Has/Get + tx feed; update peer creation signature in tests.
eth/handler.go Wire BlockFetcher + new TxFetcher, implement 165 message handling, revamp tx broadcast strategy.
eth/handler_test.go Add BroadcastBlock test, move malformed-block test, update DAO timeout var naming and txpool init.
eth/fetcher/tx_fetcher.go New transaction fetcher implementation for announcement-driven pooled tx retrieval.
eth/fetcher/tx_fetcher_test.go Comprehensive test suite for the new transaction fetcher.
eth/fetcher/metrics.go Remove old fetcher metrics file (metrics moved into block/tx fetchers).
eth/fetcher/block_fetcher.go Rename/adjust existing fetcher to BlockFetcher, move metrics here, minor logging/comment updates.
eth/fetcher/block_fetcher_test.go Update tests to use NewBlockFetcher.
eth/downloader/peer.go Allow idle peers up to protocol 165.
eth/backend.go Update backend hooks to reference blockFetcher instead of fetcher.
cmd/devp2p/internal/ethtest/suite.go Use TransactionMsg instead of TxMsg.
cmd/devp2p/internal/ethtest/conn.go Decode TransactionMsg instead of TxMsg.
cmd/devp2p/internal/ethtest/conn_decode_test.go Update decode test to use TransactionMsg.
Comments suppressed due to low confidence (1)

eth/peer.go:854

  • Per-peer broadcaster goroutines are started here, but there is no corresponding termination signal on disconnect: peer.close() is never invoked when a peer is unregistered, so these goroutines will leak for every connection churn.
	go p.broadcastBlocks()
	go p.broadcastTransactions()
	if p.version >= xdc165 {
		go p.announceTransactions()
	}

Comment thread eth/fetcher/tx_fetcher.go
Comment thread eth/peer.go
Comment thread eth/handler.go
Comment thread eth/protocol_test.go Outdated
Comment thread eth/protocol_test.go
Comment thread eth/handler.go Outdated
@gzliudan
gzliudan force-pushed the xdc165 branch 2 times, most recently from c277381 to 11c2ab3 Compare July 23, 2026 11:31
@gzliudan gzliudan changed the title feat(eth): implement EIP-2464 - xdc/165 transaction fetcher #20234 #21032 feat(eth): implement EIP-2464 - xdc/165 transaction fetcher #20234 #21032 #22181 #32210 Jul 23, 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.

3 participants