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

Refactor away BlockHeight(0) #377

Closed
james-chf opened this issue Aug 24, 2022 · 1 comment
Closed

Refactor away BlockHeight(0) #377

james-chf opened this issue Aug 24, 2022 · 1 comment

Comments

@james-chf
Copy link
Contributor

james-chf commented Aug 24, 2022

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:

struct BlockHeight(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.

@tzemanovic
Copy link
Member

duplicate of #648

@tzemanovic tzemanovic closed this as not planned Won't fix, can't repro, duplicate, stale Oct 23, 2023
phy-chain pushed a commit to phy-chain/namada that referenced this issue Mar 1, 2024
…#377)

* test: derive transparent and derive shielded address e2e tests

* fix: toast text

* fix: increase timeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants