-
Notifications
You must be signed in to change notification settings - Fork 34
ABCI tighter type constraints #59
Comments
I believe this issue may be relevant in tendermint to change the int64 types to uint64 types in proto files where needed? |
I agree with you @tomtau. Also, @marbar3778 is right that the proto files (and hence the generated code) should match the tendermint repo. Actually discussing signed vs unsinged integers has a long tradition: IIRC, we wanted to switch to unsigned where values could never go negative but focused on other things. |
Ad that block height discussion: Rust does under/overflow assertion checks in debug releases by default; one could enable them in production builds in a Cargo profile configuration. |
Besides block height (and perhaps time), there are a few other examples where the protobuf type doesn't indicate to what the specs say -- for example, for Tags: https://tendermint.com/docs/spec/abci/abci.html#tags it mentions keys/values must be UTF-8 strings, but they are Vec. Another thing is "Query": https://tendermint.com/docs/spec/abci/abci.html#query
Currently, the trait doesn't force implementors to do so -- on the other hand, I didn't observe any consequences if one doesn't do so? |
Any reason not having
in Cargo.toml? |
@martinholovsky https://doc.rust-lang.org/cargo/reference/manifest.html#the-profile-sections
rust-abci is a library, i.e. won't be top-level. My guess (from that description) is that regardless what's declared here, profiles of application crates override it (so it should be declared in Cargo.toml of applications rather than here). |
Some of the message types generated by protobuf have a bit imprecise types -- for example, the block height is returned as
i64
even though it should never be negativeThe text was updated successfully, but these errors were encountered: