-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for CometBFT proto 0.38 (#1312)
* Generate protos for v0_38 Check out the protos from the v0.38.0-alpha.1 release tag and add the v0_38 fork of generated modules to tendermint-proto. * proto: add serializers for v0_38::types::Evidence * p2p: switch tendermint-proto imports to v0_38 * tendermint: domain type for AbciParams The AbciParams message/object was added in 0.38, used as the "abci" field in ConsensusParams. Add protobuf conversions for v0_38 protos, and serde. * tendermint: BlockIdFlag as a domain type This is needed for the more detailed VoteInfo in 0.38. * Extend VoteInfo to support 0.38 data The BlockSignatureInfo enum is an attempt to represent both the pre-0.38 encoding with the signed_last_block flag, and the current one where the signature information is given by the block_id_flag field. * Rename Signature::to_bytes Rename to Signature::into_bytes to follow Rust naming conventions. * tendermint: v0_38 serialization for Vote The serialization of extension fields is not tested yet. * proto: use v0_38 in BlockId unit tests * tendermint: v0_38 serialization for block::Size * tendermint: v0_38 conversions for abci::Event * Extend tendermint_pb_modules to v0_38 * abci: Update to ABCI 0.38 Change the tendermint-proto structs in use to v0_38 and update the application API accordingly. * light-client-verifier: adapt to new Vote fields * CI: update buf and protoc to latest versions * CI: diff between generated and checked-in files * Restore serde derives on PublicKey There was no apparent value added by defining the impls manually, IDK why the attributes were previously shifted to the enum type. * Regenerate protos from latest release tags Use v0.34.28 and v0.37.1 * tendermint: v0_38 proto support for request::Info * tendermint: support 0.38 extensions for VoteInfo Add members to VoteInfo to be able to convert from and to the ExtendedVoteInfo message type as defined in 0.38 proto. Define conversions from and to the proto type, as well as conversions between CommitInfo and ExtendedCommitInfo in the proto. As a helper to the above, provide Bytes conversions for the Signature domain type. * tendermint: v0.38 ABCI requests and responses Add the v0_38::abci::{Request,Response} enums and the new domain types representing request and response messages added in CometBFT 0.38. * tendermint: version-specific kinded response enums Define {ConsensusRequest, InfoRequest, MempoolRequest, SnapshotRequest} separately for each of the v0_*::abci versioned modules, enumerating just the requests that can be used with the respective version. No panic. * abci: crude logic and tests for finalize_block * tendermint: Re-export v0_38 kinded ABCI enums Just like with abci::Request and abci::Response, the categorized request and response enums get re-exported from the v0_38::abci module. * tendermint: domain type for ExtendedVoteInfo The ExtendedVoteInfo and ExtendedCommitInfo protobuf messages can be encoded only in RequestPrepareProposal. In other contexts the extension fields are not useful.
- Loading branch information
Showing
100 changed files
with
5,595 additions
and
756 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
.changelog/unreleased/breaking-changes/1312-cometbft-0.38.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
- `[tendermint]` Adaptations for CometFBT 0.38 | ||
([\#1312](https://github.com/informalsystems/tendermint-rs/pull/1312)): | ||
* Define `consensus::params::AbciParams` struct, add the `abci` field of this | ||
type to `consensus::Params` to represent the protobuf additions. | ||
* Change the `abci::Request` and `abci::Response` reexports to use the | ||
enums defined in `v0_38`. | ||
- `[tendermint]` Define version-specific categorized request/response enums: | ||
`ConsensusRequest`, `MempoolRequest`, `InfoRequest`, `ShapshotRequest`, | ||
`ConsensusResponse`, `MempoolResponse`, `InfoResponse`, `ShapshotResponse`, | ||
in each of the `v0_*::abci` modules, so that the variants are trimmed to the | ||
requests/responses used by the respective protocol version. | ||
Reexport the types from `v0_38::abci` as aliases for these names in the | ||
`abci` module, continuing the naming as used in older API. | ||
([\#1312](https://github.com/informalsystems/tendermint-rs/pull/1312)). | ||
- `[tendermint]` Rename `Signature::to_bytes` to `Signature::into_bytes` | ||
([\#1312](https://github.com/informalsystems/tendermint-rs/pull/1312)). | ||
- `[tendermint-abci]` Update the `Application` interface to CometBFT 0.38 | ||
([\#1312](https://github.com/informalsystems/tendermint-rs/pull/1312)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
- `[tendermint-proto]` Generate prost bindings for CometBFT 0.38 | ||
under the `tendermint::v0_38` module | ||
([\#1312](https://github.com/informalsystems/tendermint-rs/pull/1312)) | ||
- `[tendermint]` Support for CometBFT 0.38: | ||
([\#1312](https://github.com/informalsystems/tendermint-rs/pull/1312)): | ||
* Add conversions to and from `tendermint::v0_38` protobuf | ||
types generated in [`tendermint-proto`]. | ||
* Add request and response enums under `v0_38::abci` to enumerate all requests | ||
and responses appropriate for CometBFT version 0.38. | ||
* Add request and response types under `abci` to represent the requests | ||
and responses new to ABCI++ 2.0 in CometBFT version 0.38. The names are | ||
`ExtendVote`, `FinalizeBlock`, `VerifyVoteExtension`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.