Use SenderNonceMempool #520
Merged
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.
Motivation
The NoOpMempool accepts any transactions proposed by the proposer and does not do any validation, see https://github.com/cosmos/cosmos-sdk/blob/v0.50.12/baseapp/abci_utils.go#L385. By switching to a different mempool and making sure the bytes which are not valid TXs are not validated we can get the best of both worlds.
Due to an error in the default config prior to cosmos/cosmos-sdk#20008 it seems most of our validators will have a setting for the MaxTs which results in the SenderNonceMempool being selected: https://github.com/cosmos/cosmos-sdk/blob/v0.50.12/server/util.go#L544. Looking at our testnet and mainnet nodes I can confirm that the
max-txs
attribute in theconfig/app.toml
is set to5000
For these reasons I think we should be fine with the SenderNonceMempool, but we might want to spend a little more time researching the impact of changing mempool implementations.
Explanation of Changes
With this mempool the default ProcessProposal handler will validate that all TXs are valid before accepting a proposal.
Testing
Added a manual mock for the TX verifier, as this is normally handled by the baseapp.
Related PRs and Issues
N.A.