You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
abci: use EndBlock to control empty block creation #1909
Since some apps will change the app hash every block, even with empty blocks, setting create_empty_blocks=false won't achieve anything.
To solve this, we could add a Pause bool field to ResponseEndBlock that tells Tendermint whether to make a new block right away or not.
We should write a proper ADR before making this change. Note that any state transitions that occur in the last block committed will not have light-client proofs until the next block is committed, so apps need to be careful when setting Pause=true
Reacted by b00f, Roman Brodetski, stangi66, Martin, Zhen, Chung Wu and ykc
Reacted by Anton Kaliaev, Ethan Frey and williamcarry
We could remove the dependence on AppHash in the meantime, and only make blocks if there are transactions (or evidence). It means we won't have proofs for time-dependent transitions in the empty proofBlock, but perhaps that is worth it to eliminate the confusion in this feature. We'd still need to make an empty proofBlock if the last block has transactions so we can get proofs for the new state resulting from the previous block.
@ebuchman Can we move "AppHash change" in EndBlock or StateCommit (introduce new one) hook and assign AppHash in current block before commit (like validator set)? I am not sure any implications it might have.
Or atleast have a configuration flag to disable support for block proof?
Note that an application may want to punish absent validators and therefore application state may potentially change in every block. Also applications may want to use block timestamps to perform some time-dependent transitions, which also implies changing hash with every block. Therefore it may be hard to imagine a non-enterprise (local) application which doesn’t potentially change hash with every block, however light clients don’t necessarily need to be interested in such changes. Not depending on AppHash may be a reasonable default then.
Still there may be situations where an application wants to accelerate block creation or create next block in a predictable time, for example when it announces a change in the validator set, so either introducing a Pause boolean or at least creating a block if there is a pending change in the validator set may be a good idea.
So I think we agree that application can decide to commit an empty block or not. Imagine there is an empty block and application decide to not commit it. Then the previous round will be repeated with same validator set, note that most nodes are in consensus about it. In this case the empty block will be processed but not committed and app hash won't change (either the block height).
Someone want to write ADR-036 for this? It should include a mechanism for the app to control the rate of empty block production through ABCI, but I don't think we want it in the ConsensusParams, because we don't need it to be hashed, and it could conceivably stay a subjective/local/non-consensus setting.
Should we use Query for this - to ask the app if or when to make the next empty block? Maybe a path like /consensus/blocks/create_empty and /consensus/blocks/create_empty_interval ?
I would like to share my experience since it may help you addressing this issue.
If there is no transaction in the block (empty block), application hash SHOULD NOT change. In case application hash changes by committing an empty block, it is due to a BUG or naive implementation of the application. I think Tendermint should not be responsible in this case and application should be cautious to not change its state when nothing is happening.
Activity
b00f commentedon Jul 11, 2018
It's good idea giving the application this privilege to decide when pausing block creation.
ebuchman commentedon Oct 29, 2018
Another thing we could consider:
We could remove the dependence on AppHash in the meantime, and only make blocks if there are transactions (or evidence). It means we won't have proofs for time-dependent transitions in the empty proofBlock, but perhaps that is worth it to eliminate the confusion in this feature. We'd still need to make an empty proofBlock if the last block has transactions so we can get proofs for the new state resulting from the previous block.
jdkanani commentedon Nov 1, 2018
@ebuchman Can we move "AppHash change" in EndBlock or StateCommit (introduce new one) hook and assign AppHash in current block before commit (like validator set)? I am not sure any implications it might have.
Or atleast have a configuration flag to disable support for block proof?
b00f commentedon Nov 1, 2018
how about processing but not commiting empty block? I mean every node agree that empty block won't change the state... Just an idea...
KrzysiekJ commentedon Nov 10, 2018
Note that an application may want to punish absent validators and therefore application state may potentially change in every block. Also applications may want to use block timestamps to perform some time-dependent transitions, which also implies changing hash with every block. Therefore it may be hard to imagine a non-enterprise (local) application which doesn’t potentially change hash with every block, however light clients don’t necessarily need to be interested in such changes. Not depending on
AppHashmay be a reasonable default then.Still there may be situations where an application wants to accelerate block creation or create next block in a predictable time, for example when it announces a change in the validator set, so either introducing a
Pauseboolean or at least creating a block if there is a pending change in the validator set may be a good idea.b00f commentedon Nov 11, 2018
So I think we agree that application can decide to commit an empty block or not. Imagine there is an empty block and application decide to not commit it. Then the previous round will be repeated with same validator set, note that most nodes are in consensus about it. In this case the empty block will be processed but not committed and app hash won't change (either the block height).
ebuchman commentedon Nov 11, 2018
Someone want to write ADR-036 for this? It should include a mechanism for the app to control the rate of empty block production through ABCI, but I don't think we want it in the ConsensusParams, because we don't need it to be hashed, and it could conceivably stay a subjective/local/non-consensus setting.
Should we use Query for this - to ask the app if or when to make the next empty block? Maybe a path like
/consensus/blocks/create_emptyand/consensus/blocks/create_empty_interval?jdkanani commentedon Dec 6, 2018
@ebuchman may be a stupid question but what is ADR-036? Would love to fix whole empty block thing between tendermint/cosmos-sdk.
ebuchman commentedon Dec 15, 2018
ADR-36 is an unwritten Architecture Decision Record justifying this change and describing details of its design. See other ADRs for examples: https://github.com/tendermint/tendermint/tree/develop/docs/architecture
Issue #2313 tracks the assignment of numbers to new ADRs.
Would be great if you want to start by writing this up.
jdkanani commentedon Dec 17, 2018
@ebuchman Great. I will work on it.
b00f commentedon Feb 28, 2019
I would like to share my experience since it may help you addressing this issue.
If there is no transaction in the block (empty block), application hash SHOULD NOT change. In case application hash changes by committing an empty block, it is due to a BUG or naive implementation of the application. I think Tendermint should not be responsible in this case and application should be cautious to not change its state when nothing is happening.
Also look here: cosmos/iavl#128
35 remaining items
Included extra parameter in `FinalizeBlock` in an attempt to include t…
Revert "Included extra parameter in `FinalizeBlock` in an attempt to …
Included extra parameter in `FinalizeBlock` in an attempt to include t…
Revert "Included extra parameter in `FinalizeBlock` in an attempt to …
Included extra parameter in `FinalizeBlock` in an attempt to include t…
Revert "Included extra parameter in `FinalizeBlock` in an attempt to …
Included extra parameter in `FinalizeBlock` in an attempt to include t…
Revert "Included extra parameter in `FinalizeBlock` in an attempt to …
Included extra parameter in `FinalizeBlock` in an attempt to include t…
Revert "Included extra parameter in `FinalizeBlock` in an attempt to …
DaMandal0rian commentedon Aug 29, 2022
Any update on this?
arkantos1482 commentedon Feb 7, 2023
if u don't plan to fix this anytime soon, please put that on your documentation.
build(deps): Bump github.com/prometheus/client_golang (tendermint#1909)