Closed itamarreif closed 1 year ago
to add more context on why this is blocked:
tendermint-rs's Hash
type, which is contained is basically everything to do with blocks, commits, etc. supports deserialization from hex strings only, not base64 strings. however, since we are getting these types with hashes encoded as base64, we are unable to deserialize them into a Hash
for example, this is the result we get from metro:
$ curl http://localhost:1317/cosmos/base/tendermint/v1beta1/blocks/latest
{
"block_id": {
"hash": "JEEXrSESfa01mbd3nH6q4ZSGPKn8NHtlL5wivJB/iYA=",
"part_set_header": {
"total": 1,
"hash": "MerMvPanzEuYLiBfsd1sQ7wvwVBbbxALOMzFHi8EKgw="
}
},
// extra stuff omitted
see the tendermint-rs type here: https://github.com/informalsystems/tendermint-rs/blob/main/proto/src/prost/v0_37/tendermint.types.rs#L63
it only is able to deserialize the Hash
via hex.
note that this appears to be due to the cosmos-sdk specifically, as tendermint itself returns hashes encoded in hex: https://docs.tendermint.com/v0.37/rpc/#/Info/block
this means using "retro" will fix this issue.
blocked by #99
Currently we are redefining CometBFT's
Commit
,CommitSig
,BlockId
andPartSetHeader
types in ourastria-proto/proto/sequencer/v1/data.proto
(for wire types) andsequencer-relayer/src/types.rs
(for domain types) as well as manually converting them. See theto_proto()
andfrom_proto()
funcs acrosstypes.rs
, linked above.This is done because
CometBFT
andtendermint-rs
's protos definitions for these types do not properly serialize Base64 strings, which are used for hashes and signatures. For example, types that do properly serialize to Base64 have the following proc macro in their definition: https://github.com/informalsystems/tendermint-rs/blob/main/rpc/src/endpoint/evidence.rs#L42tasks:
astria-proto/proto/sequencer/v1/data.proto
to use the types imported from tendermint's protos and remove the copied definitions.sequencer-relayer/src/types.rs
and replace them with types imported from tendermint-rs.conductor