Skip to content

[Feature]: Explore setting create_empty_blocks to false #20733

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:

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

No one assigned

    Type

    No type

    Projects

    • Status

      📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions