Open
Description
Summary
Related to: #12356
CometBFT has a couple of options (create_empty_blocks
and create_empty_blocks_interval
) that allow blockchains to pause block production if there are no txs in the mempool and if the apphash doesn't change (meaning, there are no changes made to store by the app whenever there is no txs).
In Cosmos SDK we have some modules that will write to store on every block, either in BeginBlock or EndBlock, making the apphash change at every height.
Did some experimentation on this branch: https://github.com/cosmos/cosmos-sdk/compare/facu/avoid-mt-blocks?expand=1
Summary of required changes:
Doable:
- (x/distribution) Removed PreviousProposer (refactor(x/distribution)!: remove PreviousProposer and return early if there are no fees to distribute #20735)
- (x/distribution) Return early when there are no fees to distribute (refactor(x/distribution)!: remove PreviousProposer and return early if there are no fees to distribute #20735)
- (x/mint) Check for differences between current and new minter obj, and only write to disk if there has been changes (refactor(x/mint)!: avoid writing same minter and use millisecond precision for minting #20747)
- (all) Make sure we don't make any assumptions about the correlation of height and time, always use time
Yet to figure out:
- (x/staking) Make HistoricalInfo write to disk only if there are other changes to be written.
- (x/consensus) Once we have SetCometInfo implemented, we'll have to figure out if we can store this in-memory instead of writing it to store
Some ideas:
- a way to keep it in memory and only store it at the very end only if there has been other changes
Problem Definition
Proposed Feature
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Type
Projects
Status
📋 Backlog