Skip to content
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

[Feature]: Explore setting create_empty_blocks to false #20733

Open
1 task done
facundomedica opened this issue Jun 20, 2024 · 0 comments
Open
1 task done

[Feature]: Explore setting create_empty_blocks to false #20733

facundomedica opened this issue Jun 20, 2024 · 0 comments

Comments

@facundomedica
Copy link
Member

facundomedica commented Jun 20, 2024

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:

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
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant