Skip to content

(cherrypick) Rollback unsuccessful preconfs in the mempool (#3264)#3275

Closed
MitchTurner wants to merge 2 commits intorelease/v0.47.4from
cherrypick/preconf-mempool
Closed

(cherrypick) Rollback unsuccessful preconfs in the mempool (#3264)#3275
MitchTurner wants to merge 2 commits intorelease/v0.47.4from
cherrypick/preconf-mempool

Conversation

@MitchTurner
Copy link
Copy Markdown
Member

@MitchTurner MitchTurner commented Apr 17, 2026

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 SqueezedOut notifications. 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 Preview tab and select the appropriate sub-template:

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
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 17, 2026

PR Summary

Low Risk
Low risk: changes are limited to logging text and a changelog entry, with no functional txpool behavior modified.

Overview
Adds a .changes entry documenting rollback of stale preconfirmations.

In txpool_v2’s process_committed_transactions, simplifies/adjusts tracing::warn! messages for missing storage data (invariant-violation paths) without changing control flow.

Reviewed by Cursor Bugbot for commit 2413d4c. Bugbot is set up for automated code reviews on this repo. Configure here.

@MitchTurner MitchTurner changed the title Rollback unsuccessful preconfs in the mempool (#3264) (cherrypick) Rollback unsuccessful preconfs in the mempool (#3264) Apr 17, 2026
@MitchTurner MitchTurner marked this pull request as ready for review April 17, 2026 21:53
@MitchTurner MitchTurner requested review from a team, Dentosal and xgreenx as code owners April 17, 2026 21:53
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 78a204c. Configure here.

@MitchTurner MitchTurner force-pushed the cherrypick/preconf-mempool branch from 78a204c to 2413d4c Compare April 17, 2026 22:17
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