fix(core/txpool): initialize journal writer for tx tracker #32921#2204
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 aims to fix local transaction journaling reliability in the txpool locals tracker by ensuring the journal writer is initialized, and adds tests around tracker resubmission/journaling behavior.
Changes:
- Initialize the local tx journal writer during
TxTrackerstartup soTrackAllinsertions can be persisted. - Refactor
TxTracker.recheckto handle journal rotation internally (while holding the tracker lock). - Add a new
TxTrackerunit test file covering resubmission and journaling scenarios.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| core/txpool/txpool.go | Moves SetSigner/IsSigner methods (no functional change). |
| core/txpool/locals/tx_tracker.go | Refactors recheck return values; initializes journal writer in the tracker loop; adjusts periodic rejournal logic. |
| core/txpool/locals/journal.go | Adds setupWriter() to open the journal for appends outside of rotate(). |
| core/txpool/locals/tx_tracker_test.go | Introduces new tests for tracker resubmission and journal persistence. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
804bb15 to
73f9a28
Compare
7f96824 to
4c164e3
Compare
There was a problem hiding this comment.
Pull request overview
Fixes local transaction tracker journaling startup so the journal writer is initialized before the tracker begins accepting tracked transactions, preventing early Track/TrackAll calls from failing to persist.
Changes:
- Move journal loading to
TxTracker.Start()and initialize the journal writer before returning. - Simplify
recheckto return only resubmits and perform journal rotation internally while holding the tracker lock. - Update/add tests to validate journaling behavior and that
Start()initializes the journal writer.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| core/txpool/locals/tx_tracker.go | Initializes journal writer during Start, adjusts recheck/loop journaling flow. |
| core/txpool/locals/journal.go | Adds setupWriter() helper to (re)open the journal append writer. |
| core/txpool/locals/tx_tracker_test.go | Updates resubmit assertions and adds journaling + startup writer initialization tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
11d6f30 to
90edbcd
Compare
90edbcd to
3d63bc7
Compare
Proposed changes
Ref: ethereum#32921
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