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
In Tendermint, the earliest possible block in a chain (i.e. genesis block) has height 1. Currently our BlockHeight type permits BlockHeight(0) which isn't a valid block height and BlockHeight::default() == BlockHeight(0). The first proposed block will be at least BlockHeight(1). We should avoid BlockHeight(0) in our code.
We could define BlockHeight something like:
structBlockHeight(NonZeroU64)
It could be worth having different types for proposed block heights and committed block heights. e.g. shell.storage.last_height represents the last committed block height and so might be of type Option<CommittedBlockHeight>. Often when dealing with ABCI(++) logic, we are interested in the current ProposedBlockHeight rather than the last CommittedBlockHeight, so our functions could explicitly work with ProposedBlockHeights only where appropriate.
The text was updated successfully, but these errors were encountered:
In Tendermint, the earliest possible block in a chain (i.e. genesis block) has height 1. Currently our
BlockHeight
type permitsBlockHeight(0)
which isn't a valid block height andBlockHeight::default() == BlockHeight(0)
. The first proposed block will be at leastBlockHeight(1)
. We should avoidBlockHeight(0)
in our code.We could define
BlockHeight
something like:It could be worth having different types for proposed block heights and committed block heights. e.g.
shell.storage.last_height
represents the last committed block height and so might be of typeOption<CommittedBlockHeight>
. Often when dealing with ABCI(++) logic, we are interested in the currentProposedBlockHeight
rather than the lastCommittedBlockHeight
, so our functions could explicitly work withProposedBlockHeight
s only where appropriate.The text was updated successfully, but these errors were encountered: