(cherrypick) Rollback unsuccessful preconfs in the mempool (#3264)#3275
(cherrypick) Rollback unsuccessful preconfs in the mempool (#3264)#3275MitchTurner wants to merge 2 commits intorelease/v0.47.4from
Conversation
Closes #3098. When a block producer sends preconfirmation updates, sentry nodes optimistically treat the included transactions as committed, removing them from the mempool and marking their inputs as spent. If the producer crashes and re-produces a block at the same height without those transactions, the mempool is left in a stale state: inputs stay marked as spent and outputs linger in `extracted_outputs`, preventing re-submission of rolled-back transactions and causing dependents to reference non-existent UTXOs. This PR makes preconfirmed transactions tentative until the canonical block at their height is imported. On import, preconfirmed txs present in the block are confirmed and their tracking is cleared; those absent are rolled back by restoring inputs, purging dependents, and emitting `SqueezedOut` notifications. It also adds integration tests: re-insertion after rollback, dependent eviction, normal confirmation, and stale-height cleanup. - [x] Breaking changes are clearly marked as such in the PR description and changelog - [x] New behavior is reflected in tests - [x] [The specification](https://github.com/FuelLabs/fuel-specs/) matches the implemented behavior (link update PR if changes are needed) - [ ] I have reviewed the code myself - [x] I have created follow-up issues caused by this PR and linked them here
PR SummaryLow Risk Overview In Reviewed by Cursor Bugbot for commit 2413d4c. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 78a204c. Configure here.
| tracing::warn!( | ||
| "Storage data not found for the transaction during `remove_transaction`." | ||
| ); | ||
| tracing::warn!("Storage data not found for the transaction during."); |
There was a problem hiding this comment.
Truncated log message ends with dangling "during."
Low Severity
The warning message "Storage data not found for the transaction during." is grammatically incomplete — "during" is a preposition left without an object. The original message referenced `remove_transaction` after "during", which was accidentally removed instead of being kept or the entire trailing clause being dropped.
Reviewed by Cursor Bugbot for commit 78a204c. Configure here.
78a204c to
2413d4c
Compare


cherrrypick #3264
Closes #3098.
When a block producer sends preconfirmation updates, sentry nodes optimistically treat the included transactions as committed, removing them from the mempool and marking their inputs as spent. If the producer crashes and re-produces a block at the same height without those transactions, the mempool is left in a stale state: inputs stay marked as spent and outputs linger in
extracted_outputs, preventing re-submission of rolled-back transactions and causing dependents to reference non-existent UTXOs.This PR makes preconfirmed transactions tentative until the canonical block at their height is imported. On import, preconfirmed txs present in the block are confirmed and their tracking is cleared; those absent are rolled back by restoring inputs, purging dependents, and emitting
SqueezedOutnotifications. It also adds integration tests: re-insertion after rollback, dependent eviction, normal confirmation, and stale-height cleanup.Breaking changes are clearly marked as such in the PR description and changelog
New behavior is reflected in tests
The specification matches the implemented behavior (link update PR if changes are needed)
I have reviewed the code myself
I have created follow-up issues caused by this PR and linked them here
Please go to the
Previewtab and select the appropriate sub-template: