-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Make rechecking a tx check the sequence number #12060
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
(cherry picked from commit 8eaff8f)
(cherry picked from commit 8eaff8f)
This is to clean the mempool from the transactions with the same sequence number, right? |
@ValarDragon Does this mean that all user transactions that were not included in a block, will get evicted from mempool? |
For example - Account 'A' with expected sequence 's'. User sends a tx with sequence 's'. CheckTx runs, and passes(assuming all other checks were passed). CheckTx bumps account sequence to s+1. For some reason tx was not included in block. At this point account seq is s+1, but tx seq remains s. Now at end of block(since tx was not included in block), RecheckTx runs on above tx(with above pr this will check the account sequence), and fail bcz of account seq mismatch. Tx is evicted from mempool. |
correct |
(cherry picked from commit 8eaff8f) Co-authored-by: Dev Ojha <[email protected]>
(cherry picked from commit 8eaff8f) Co-authored-by: Dev Ojha <[email protected]>
No, the Tendermint mempool maintains an ordering s.t. a tx with sequence number Therefore if tx w/ seq num |
…mos#12062) (cherry picked from commit 8eaff8f) Co-authored-by: Dev Ojha <[email protected]>
…mos#12062) (cherry picked from commit 8eaff8f) Co-authored-by: Dev Ojha <[email protected]>
Upstream of my change to Osmosis that makes recheck still check sequence numbers.
This has been incorporated into Terra and Secret Network.
osmosis-labs#58
The antehandler check updated (despite its name) is responsible for checking two things:
Previously on recheck, it skipped the entire check, and therefore skipped both of its responsibilities.
Now it only skips the signature verification component, which was the purpose of recheck. (To save the heavy comptutional burden)
Every node with a default mempool, runs this ante handler check in "recheck" mode, on every single tx in their mempool upon each block being committed. Any tx with an invalidated sequence number will then get evicted from the mempool, ensuring that bad sequence numbers no longer enter in blocks produced by nodes with the default mempool.
You only really run into this as a noticeable problem once two conditions are satisfied:
which is the case for Osmosis, Terra, Secret, Evmos
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...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change