Skip to content

Conversation

@gzliudan
Copy link
Collaborator

Proposed changes

Ref: ethereum#27463

Types of changes

What types of changes does your code introduce to XDC network?
Put an in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)
  • Regular KTLO or any of the maintaince work. e.g code style
  • CICD Improvement

Impacted Components

Which part of the codebase this PR will touch base on,

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
  • 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

Copilot AI review requested due to automatic review settings December 23, 2025 11:17
@coderabbitai
Copy link

coderabbitai bot commented Dec 23, 2025

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.

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

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.


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 and usage tips.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request implements a major architectural refactoring to move the main transaction pool into a subpool system, supporting specialization and modularity in transaction handling.

Summary: The PR restructures the transaction pool to use a coordinator pattern where a main TxPool manages multiple specialized SubPool implementations. The legacy transaction pool logic is moved to core/txpool/legacypool/, and a new wrapper type txpool.Transaction is introduced for better encapsulation.

Key Changes:

  • Introduced subpool architecture with SubPool interface and main TxPool coordinator
  • Moved legacy pool implementation to dedicated legacypool package
  • Added transaction wrapper type (txpool.Transaction) for better type safety
  • Updated API signatures across the codebase (e.g., AddLocalAdd, Stop()Close())

Reviewed changes

Copilot reviewed 37 out of 37 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
core/txpool/txpool.go New main transaction pool coordinator implementing subpool aggregation
core/txpool/subpool.go Defines SubPool interface for specialized transaction pools
core/txpool/legacypool/legacypool.go Refactored legacy pool as a SubPool implementation
core/txpool/errors.go Centralized error definitions for transaction pool
event/multisub.go New utility for joining multiple event subscriptions
eth/backend.go Updated to use new pool initialization pattern
miner/worker.go Type signature updates for transaction maps
internal/ethapi/backend.go Interface signature updates for consistency
eth/protocol.go Updated txPool interface with new method signatures
Multiple test files Updated tests to use new API (e.g., addLocal, addRemote, Close)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 37 out of 37 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 37 out of 37 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gzliudan gzliudan force-pushed the 4844-txpool-subpool branch 14 times, most recently from 8bd1ffc to feb05e2 Compare December 25, 2025 07:38
@gzliudan gzliudan force-pushed the 4844-txpool-subpool branch 5 times, most recently from 66167c3 to 614bab0 Compare December 25, 2025 09:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 38 out of 38 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (2)

miner/worker.go:1

  • The condition on line 993 has been modified to use addition instead of subtraction, which reverses the comparison logic. The original condition checked blkNumber <= w.header.Number.Uint64()-w.config.XDPoS.Epoch*2, but the new condition blkNumber+w.config.XDPoS.Epoch*2 <= w.header.Number.Uint64() is mathematically equivalent only when no overflow occurs. However, if blkNumber + w.config.XDPoS.Epoch*2 overflows uint64, this could lead to incorrect validation. Consider adding overflow protection or reverting to the original subtraction-based logic with a guard against underflow.
    miner/worker.go:1
  • The byte slice extraction has changed from data[8:40] to data[4:36], altering which 32 bytes are interpreted as the block number. This is a breaking change in the data structure interpretation. Ensure this change aligns with updates to the data format specification, as existing transactions may be parsed incorrectly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gzliudan gzliudan force-pushed the 4844-txpool-subpool branch 2 times, most recently from 590f195 to 614bab0 Compare January 4, 2026 05:40
@gzliudan gzliudan force-pushed the 4844-txpool-subpool branch from 614bab0 to 44771b7 Compare January 5, 2026 08:19
@AnilChinchawale AnilChinchawale merged commit b3d354a into XinFinOrg:dev-upgrade Jan 5, 2026
13 checks passed
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