Skip to content

feat(mempool): revert transactions after 3 failures#1832

Merged
Mirko-von-Leipzig merged 44 commits intonextfrom
mirko/mempool-tx-reverting
Mar 29, 2026
Merged

feat(mempool): revert transactions after 3 failures#1832
Mirko-von-Leipzig merged 44 commits intonextfrom
mirko/mempool-tx-reverting

Conversation

@Mirko-von-Leipzig
Copy link
Copy Markdown
Collaborator

@Mirko-von-Leipzig Mirko-von-Leipzig commented Mar 24, 2026

This PR changes the mempool behaviour when rolling back blocks and batches. Transactions are now reverted once they have participated in more than three failed batches and blocks.

The current behaviour is that transactions are never reverted for batch failures, and always reverted for block failures.

The intention here is to weed out transactions which cause these failures e.g. due to a bug in the prover/mempool/node. The new implementation is a bit more forgiving and gives innocent bystander transactions a couple of chances to avoid the buggy one.

The limit of three is arbitrary, but I also don't see a good reason to make this more configurable. Fight me :)

This PR builds on the mempool refactor in #1820.

Closes #594

@Mirko-von-Leipzig Mirko-von-Leipzig added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Mar 24, 2026
@bobbinth bobbinth requested a review from igamigo March 25, 2026 06:00
Copy link
Copy Markdown
Collaborator

@igamigo igamigo left a comment

Choose a reason for hiding this comment

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

LGTM! Left a couple of minor comments

@Mirko-von-Leipzig Mirko-von-Leipzig force-pushed the mirko/mempool-tx-reverting branch from 7706fc9 to f01d124 Compare March 26, 2026 12:40
Base automatically changed from mirko/mempool-v4 to next March 28, 2026 21:19
@Mirko-von-Leipzig Mirko-von-Leipzig force-pushed the mirko/mempool-tx-reverting branch from f684e15 to 59877ef Compare March 29, 2026 08:44
@Mirko-von-Leipzig Mirko-von-Leipzig merged commit 08e47a4 into next Mar 29, 2026
18 checks passed
@Mirko-von-Leipzig Mirko-von-Leipzig deleted the mirko/mempool-tx-reverting branch March 29, 2026 09:02
Copy link
Copy Markdown
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you! I know this has been merged already, but it may be good to do a follow-up PR which clarifies/updates some doc comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog This PR does not require an entry in the `CHANGELOG.md` file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve tx reverting strategy

5 participants