informalsystems / tendermint-rs

Client libraries for Tendermint/CometBFT in Rust!
Apache License 2.0
587 stars 213 forks source link

block: domain type validation is too stringent #1435

Closed erwanor closed 1 week ago

erwanor commented 3 weeks ago

What went wrong?

Comet allows non-zero initial heights, those are useful and should be considered frequent (e.g. Penumbra use them to perform offchain state transitions).

However, the domain type validation logic of Block enforces an initialHeight of 1 which is too stringent:

https://github.com/informalsystems/tendermint-rs/blame/94a5fc074964fca05df48acde88ce133a58f4ce7/tendermint/src/block.rs#L125

Definition of "done"

The check is dropped so that it is possible to parse blocks that don't refer to a last commit. Open to better suggestions but that seem straightforward to do.

romac commented 3 weeks ago

Agreed, the domain types are indeed too restrictive in multiple places as we've seen recently. Feel free to open a PR to relax that specific restriction.