penumbra-zone / penumbra

Penumbra is a fully private proof-of-stake network and decentralized exchange for the Cosmos ecosystem.
https://penumbra.zone
Apache License 2.0
357 stars 287 forks source link

our vendored `TxResult` is different from cosmos-sdk's abci `TxResult #3396

Open hdevalence opened 7 months ago

hdevalence commented 7 months ago

Describe the bug

Compare https://buf.build/cosmos/cosmos-sdk/docs/main:tendermint.abci#tendermint.abci.TxResult with https://buf.build/penumbra-zone/penumbra/docs/main:penumbra.util.tendermint_proxy.v1alpha1#penumbra.util.tendermint_proxy.v1alpha1.TxResult

why are these different? are they actually different? is there any canonical upstream here?

conorsch commented 7 months ago

The Penumbra proto messages are hardcoded here: https://github.com/penumbra-zone/penumbra/blob/v0.63.2/proto/penumbra/penumbra/util/tendermint_proxy/v1alpha1/tendermint_proxy.proto#L54-L59 My guess is that the Tendermint proto messages were vendored (i.e. copy/pasted) from the upstream Cosmos protos at a prior version. While the Cosmos proto message you linked to is indeed different, it's also tracking "main" of the upstream cosmos protos, which our setup very much does not do: https://github.com/penumbra-zone/penumbra/blob/v0.63.2/proto/penumbra/buf.yaml#L7-L12

If I adjust the Cosmos URL to use the same commit we pin our buf build setup, then I get yet a third message type: https://buf.build/cosmos/cosmos-sdk/docs/e7a85cef453e4b999ad9aff8714ae05f:tendermint.abci#tendermint.abci.TxResult

So to resolve this, we need to:

  1. Decide on a version of the upstream Cosmos SDK proto messages
  2. Ensure compatibility between that version and the version of CometBFT we're using
  3. Update the buf build tooling in this repo to regenerate
  4. Fix Rust code as necessary

As the comment on the buf.yaml file shows, last time we tried a naive "use latest upstream Cosmos protos" we encountered compatibility errors around vote extensions. I just tried again locally, and indeed, the problem persists:

error[E0063]: missing fields `extension` and `extension_signature` in initializer of `penumbra_proto::tendermint::types::Vote`
   --> crates/util/tendermint-proxy/src/tendermint_proxy.rs:386:50
    |
386 | ...                   vote_a: Some(proto::tendermint::types::Vote{
    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `extension` and `extension_signature`

error[E0063]: missing fields `extension` and `extension_signature` in initializer of `penumbra_proto::tendermint::types::Vote`
   --> crates/util/tendermint-proxy/src/tendermint_proxy.rs:408:50
    |
408 | ...                   vote_b: Some(proto::tendermint::types::Vote{
    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `extension` and `extension_signature`

For more information about this error, try `rustc --explain E0063`.
error: could not compile `penumbra-tendermint-proxy` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...