refactor(core/txpool/legacypool): move queue out of main txpool #32270#2217
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
This PR refactors the legacy txpool’s “future queue” by extracting queued transaction state and operations out of LegacyPool into a dedicated queue helper, aiming to reduce complexity while preserving behavior.
Changes:
- Introduces
core/txpool/legacypool/queue.goto own queued/beats state and queue operations (evict/stats/content/promote/truncate). - Updates
LegacyPoolto use the queue helper instead of directly manipulating queue/beat maps. - Adapts legacy pool tests to the new queue structure and access patterns.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| core/txpool/legacypool/queue.go | Adds a new helper encapsulating queued tx state, promotion filtering, eviction, and truncation. |
| core/txpool/legacypool/legacypool.go | Rewires LegacyPool to use the queue helper; adjusts promotion and truncation flows accordingly. |
| core/txpool/legacypool/legacypool_test.go | Updates tests to reflect queue extraction and new access methods/structure. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6f0d473 to
731617d
Compare
…eum#32270 Extract future-queue state and operations from LegacyPool into a dedicated queue helper while preserving existing behavior. - Move queued/beats management and queue operations (stats, content, add/remove, evict, promote, truncate) into queue.go. - Update LegacyPool call sites to use queue helper methods instead of direct map access. - Pass TRC21 fee capacity and current block number explicitly into queue promotion filtering. - Keep queue-related metrics updates aligned, including queued and queued account gauges across add/remove/promote paths. - Adapt legacypool tests to the new queue interface (queue.get / queue.addresses) without changing semantic expectations. No functional change intended; this is a structural refactor to reduce complexity in the main txpool file. Ref: ethereum#32270
731617d to
391fb5d
Compare
Proposed changes
Extract future-queue state and operations from LegacyPool into a dedicated queue helper while preserving existing behavior.
No functional change intended; this is a structural refactor to reduce complexity in the main txpool file.
Ref: ethereum#32270
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