fix(mempool): Remove tx immediately during FinalizeBlock success #899
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Modifies the EVM mempool removal logic when a tx is included in a block to immediately remove it, instead of not removing it and allowing for it to be removed from
demoteUnexecutableswhen it fails a nonce check next block.This was previously not the behavior, because when removing the tx immediately upon block inclusion via
RemoveTx, it would cause all future txs to be dequeued as well. However we have now modified the api ofRemoveTxto allow for the caller to override thestrictbehavior of thependingpool (the option that forces the pending pool to dequeue future txs on removal), so that we can tell the legacypool to not remove future txs in this specific scenario.To achieve this there would have now been 4 configuration options on
RemoveTx, andstrictwould have had three possible states (nilfor default,trueto override to true,falseto override to false). This felt decently confusing so I did a small refactor to change from passing intrue, false, false, to using functional options.Closes: STACK-1986
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
mainbranch