From 89da5f63f48f83c2e9ab3aa70e2521aedd9ba94a Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Fri, 22 Sep 2023 22:51:56 +0300 Subject: [PATCH] Update to prost 0.12 and tonic 0.10 (#1349) * Update to prost 0.12 and tonic 0.10 * proto: regenerate from latest versions Use these version tags to generate protobuf bindings for the supported CometBFT releases: - v0.34.29 - v0.37.2 - v0.38.0-rc3 --- .../1349-prost-0.12-and-tonic-0.10.md | 2 + abci/Cargo.toml | 2 +- p2p/Cargo.toml | 4 +- proto/Cargo.toml | 6 +- proto/src/prost/v0_34/tendermint.abci.rs | 59 +++++++++++++----- proto/src/prost/v0_34/tendermint.rpc.grpc.rs | 6 +- proto/src/prost/v0_37/tendermint.abci.rs | 61 ++++++++++++++----- proto/src/prost/v0_37/tendermint.rpc.grpc.rs | 6 +- proto/src/prost/v0_38/tendermint.abci.rs | 48 ++++++++++----- proto/src/prost/v0_38/tendermint.rpc.grpc.rs | 10 ++- proto/src/tendermint/v0_34.rs | 2 +- proto/src/tendermint/v0_37.rs | 2 +- proto/src/tendermint/v0_38.rs | 2 +- tendermint/Cargo.toml | 4 +- .../src/abci/response/process_proposal.rs | 12 ++-- .../abci/response/verify_vote_extension.rs | 6 +- tendermint/src/abci/types.rs | 12 ++-- tools/Cargo.toml | 1 + tools/proto-compiler/Cargo.toml | 4 +- tools/proto-compiler/src/constants.rs | 6 +- 20 files changed, 176 insertions(+), 79 deletions(-) create mode 100644 .changelog/unreleased/breaking-changes/1349-prost-0.12-and-tonic-0.10.md diff --git a/.changelog/unreleased/breaking-changes/1349-prost-0.12-and-tonic-0.10.md b/.changelog/unreleased/breaking-changes/1349-prost-0.12-and-tonic-0.10.md new file mode 100644 index 000000000..6a48654f3 --- /dev/null +++ b/.changelog/unreleased/breaking-changes/1349-prost-0.12-and-tonic-0.10.md @@ -0,0 +1,2 @@ +- `[tendermint-proto]` Update dependencies to prost 0.12 and tonic 0.10 + ([\#1349](https://github.com/informalsystems/tendermint-rs/pull/1349)) diff --git a/abci/Cargo.toml b/abci/Cargo.toml index 71983a7ff..75149452d 100644 --- a/abci/Cargo.toml +++ b/abci/Cargo.toml @@ -32,7 +32,7 @@ binary = [ [dependencies] bytes = { version = "1.0", default-features = false } -prost = { version = "0.11", default-features = false } +prost = { version = "0.12", default-features = false } tendermint-proto = { version = "0.33.2", default-features = false, path = "../proto" } tracing = { version = "0.1", default-features = false } flex-error = { version = "0.4.4", default-features = false } diff --git a/p2p/Cargo.toml b/p2p/Cargo.toml index 53ac74edc..5c8c4a171 100644 --- a/p2p/Cargo.toml +++ b/p2p/Cargo.toml @@ -33,7 +33,7 @@ eyre = { version = "0.6", default-features = false } flume = { version = "0.10.7", default-features = false } hkdf = { version = "0.12.3", default-features = false } merlin = { version = "2", default-features = false } -prost = { version = "0.11", default-features = false } +prost = { version = "0.12", default-features = false } rand_core = { version = "0.5", default-features = false, features = ["std"] } sha2 = { version = "0.10", default-features = false } subtle = { version = "2", default-features = false } @@ -49,4 +49,4 @@ tendermint-proto = { path = "../proto", version = "0.33.2", default-features = f tendermint-std-ext = { path = "../std-ext", version = "0.33.2", default-features = false } # optional dependencies -prost-derive = { version = "0.11", optional = true } +prost-derive = { version = "0.12", optional = true } diff --git a/proto/Cargo.toml b/proto/Cargo.toml index 1f7debfef..18458bef1 100644 --- a/proto/Cargo.toml +++ b/proto/Cargo.toml @@ -22,8 +22,8 @@ grpc-server = ["tonic"] all-features = true [dependencies] -prost = { version = "0.11", default-features = false } -prost-types = { version = "0.11", default-features = false } +prost = { version = "0.12", default-features = false } +prost-types = { version = "0.12", default-features = false } bytes = { version = "1.0", default-features = false, features = ["serde"]} serde = { version = "1.0", default-features = false, features = ["derive"] } serde_bytes = { version = "0.11", default-features = false, features = ["alloc"] } @@ -32,7 +32,7 @@ num-traits = { version = "0.2", default-features = false } num-derive = { version = "0.3", default-features = false } time = { version = "0.3", default-features = false, features = ["macros", "parsing"] } flex-error = { version = "0.4.4", default-features = false } -tonic = { version = "0.9", optional = true } +tonic = { version = "0.10", optional = true } [dev-dependencies] serde_json = { version = "1.0", default-features = false, features = ["alloc"] } diff --git a/proto/src/prost/v0_34/tendermint.abci.rs b/proto/src/prost/v0_34/tendermint.abci.rs index 65e159e5a..2bb9c5a05 100644 --- a/proto/src/prost/v0_34/tendermint.abci.rs +++ b/proto/src/prost/v0_34/tendermint.abci.rs @@ -914,7 +914,9 @@ pub mod abci_application_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).echo(request).await }; + let fut = async move { + ::echo(&inner, request).await + }; Box::pin(fut) } } @@ -957,7 +959,9 @@ pub mod abci_application_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).flush(request).await }; + let fut = async move { + ::flush(&inner, request).await + }; Box::pin(fut) } } @@ -1000,7 +1004,9 @@ pub mod abci_application_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).info(request).await }; + let fut = async move { + ::info(&inner, request).await + }; Box::pin(fut) } } @@ -1044,7 +1050,9 @@ pub mod abci_application_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).set_option(request).await }; + let fut = async move { + ::set_option(&inner, request).await + }; Box::pin(fut) } } @@ -1088,7 +1096,9 @@ pub mod abci_application_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).deliver_tx(request).await }; + let fut = async move { + ::deliver_tx(&inner, request).await + }; Box::pin(fut) } } @@ -1132,7 +1142,9 @@ pub mod abci_application_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).check_tx(request).await }; + let fut = async move { + ::check_tx(&inner, request).await + }; Box::pin(fut) } } @@ -1175,7 +1187,9 @@ pub mod abci_application_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).query(request).await }; + let fut = async move { + ::query(&inner, request).await + }; Box::pin(fut) } } @@ -1219,7 +1233,9 @@ pub mod abci_application_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).commit(request).await }; + let fut = async move { + ::commit(&inner, request).await + }; Box::pin(fut) } } @@ -1263,7 +1279,9 @@ pub mod abci_application_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).init_chain(request).await }; + let fut = async move { + ::init_chain(&inner, request).await + }; Box::pin(fut) } } @@ -1307,7 +1325,9 @@ pub mod abci_application_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).begin_block(request).await }; + let fut = async move { + ::begin_block(&inner, request).await + }; Box::pin(fut) } } @@ -1351,7 +1371,9 @@ pub mod abci_application_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).end_block(request).await }; + let fut = async move { + ::end_block(&inner, request).await + }; Box::pin(fut) } } @@ -1396,7 +1418,8 @@ pub mod abci_application_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).list_snapshots(request).await + ::list_snapshots(&inner, request) + .await }; Box::pin(fut) } @@ -1442,7 +1465,8 @@ pub mod abci_application_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).offer_snapshot(request).await + ::offer_snapshot(&inner, request) + .await }; Box::pin(fut) } @@ -1488,7 +1512,8 @@ pub mod abci_application_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).load_snapshot_chunk(request).await + ::load_snapshot_chunk(&inner, request) + .await }; Box::pin(fut) } @@ -1534,7 +1559,11 @@ pub mod abci_application_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).apply_snapshot_chunk(request).await + ::apply_snapshot_chunk( + &inner, + request, + ) + .await }; Box::pin(fut) } diff --git a/proto/src/prost/v0_34/tendermint.rpc.grpc.rs b/proto/src/prost/v0_34/tendermint.rpc.grpc.rs index 99d72ab66..cef8f2f15 100644 --- a/proto/src/prost/v0_34/tendermint.rpc.grpc.rs +++ b/proto/src/prost/v0_34/tendermint.rpc.grpc.rs @@ -132,7 +132,9 @@ pub mod broadcast_api_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).ping(request).await }; + let fut = async move { + ::ping(&inner, request).await + }; Box::pin(fut) } } @@ -177,7 +179,7 @@ pub mod broadcast_api_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).broadcast_tx(request).await + ::broadcast_tx(&inner, request).await }; Box::pin(fut) } diff --git a/proto/src/prost/v0_37/tendermint.abci.rs b/proto/src/prost/v0_37/tendermint.abci.rs index cde610000..e68e18cd6 100644 --- a/proto/src/prost/v0_37/tendermint.abci.rs +++ b/proto/src/prost/v0_37/tendermint.abci.rs @@ -1003,7 +1003,9 @@ pub mod abci_application_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).echo(request).await }; + let fut = async move { + ::echo(&inner, request).await + }; Box::pin(fut) } } @@ -1046,7 +1048,9 @@ pub mod abci_application_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).flush(request).await }; + let fut = async move { + ::flush(&inner, request).await + }; Box::pin(fut) } } @@ -1089,7 +1093,9 @@ pub mod abci_application_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).info(request).await }; + let fut = async move { + ::info(&inner, request).await + }; Box::pin(fut) } } @@ -1133,7 +1139,9 @@ pub mod abci_application_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).deliver_tx(request).await }; + let fut = async move { + ::deliver_tx(&inner, request).await + }; Box::pin(fut) } } @@ -1177,7 +1185,9 @@ pub mod abci_application_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).check_tx(request).await }; + let fut = async move { + ::check_tx(&inner, request).await + }; Box::pin(fut) } } @@ -1220,7 +1230,9 @@ pub mod abci_application_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).query(request).await }; + let fut = async move { + ::query(&inner, request).await + }; Box::pin(fut) } } @@ -1264,7 +1276,9 @@ pub mod abci_application_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).commit(request).await }; + let fut = async move { + ::commit(&inner, request).await + }; Box::pin(fut) } } @@ -1308,7 +1322,9 @@ pub mod abci_application_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).init_chain(request).await }; + let fut = async move { + ::init_chain(&inner, request).await + }; Box::pin(fut) } } @@ -1352,7 +1368,9 @@ pub mod abci_application_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).begin_block(request).await }; + let fut = async move { + ::begin_block(&inner, request).await + }; Box::pin(fut) } } @@ -1396,7 +1414,9 @@ pub mod abci_application_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).end_block(request).await }; + let fut = async move { + ::end_block(&inner, request).await + }; Box::pin(fut) } } @@ -1441,7 +1461,8 @@ pub mod abci_application_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).list_snapshots(request).await + ::list_snapshots(&inner, request) + .await }; Box::pin(fut) } @@ -1487,7 +1508,8 @@ pub mod abci_application_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).offer_snapshot(request).await + ::offer_snapshot(&inner, request) + .await }; Box::pin(fut) } @@ -1533,7 +1555,8 @@ pub mod abci_application_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).load_snapshot_chunk(request).await + ::load_snapshot_chunk(&inner, request) + .await }; Box::pin(fut) } @@ -1579,7 +1602,11 @@ pub mod abci_application_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).apply_snapshot_chunk(request).await + ::apply_snapshot_chunk( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -1625,7 +1652,8 @@ pub mod abci_application_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).prepare_proposal(request).await + ::prepare_proposal(&inner, request) + .await }; Box::pin(fut) } @@ -1671,7 +1699,8 @@ pub mod abci_application_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).process_proposal(request).await + ::process_proposal(&inner, request) + .await }; Box::pin(fut) } diff --git a/proto/src/prost/v0_37/tendermint.rpc.grpc.rs b/proto/src/prost/v0_37/tendermint.rpc.grpc.rs index 99d72ab66..cef8f2f15 100644 --- a/proto/src/prost/v0_37/tendermint.rpc.grpc.rs +++ b/proto/src/prost/v0_37/tendermint.rpc.grpc.rs @@ -132,7 +132,9 @@ pub mod broadcast_api_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).ping(request).await }; + let fut = async move { + ::ping(&inner, request).await + }; Box::pin(fut) } } @@ -177,7 +179,7 @@ pub mod broadcast_api_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).broadcast_tx(request).await + ::broadcast_tx(&inner, request).await }; Box::pin(fut) } diff --git a/proto/src/prost/v0_38/tendermint.abci.rs b/proto/src/prost/v0_38/tendermint.abci.rs index a13d43ce5..c355fe679 100644 --- a/proto/src/prost/v0_38/tendermint.abci.rs +++ b/proto/src/prost/v0_38/tendermint.abci.rs @@ -1086,7 +1086,9 @@ pub mod abci_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).echo(request).await }; + let fut = async move { + ::echo(&inner, request).await + }; Box::pin(fut) } } @@ -1128,7 +1130,9 @@ pub mod abci_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).flush(request).await }; + let fut = async move { + ::flush(&inner, request).await + }; Box::pin(fut) } } @@ -1170,7 +1174,9 @@ pub mod abci_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).info(request).await }; + let fut = async move { + ::info(&inner, request).await + }; Box::pin(fut) } } @@ -1212,7 +1218,9 @@ pub mod abci_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).check_tx(request).await }; + let fut = async move { + ::check_tx(&inner, request).await + }; Box::pin(fut) } } @@ -1254,7 +1262,9 @@ pub mod abci_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).query(request).await }; + let fut = async move { + ::query(&inner, request).await + }; Box::pin(fut) } } @@ -1296,7 +1306,9 @@ pub mod abci_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).commit(request).await }; + let fut = async move { + ::commit(&inner, request).await + }; Box::pin(fut) } } @@ -1338,7 +1350,9 @@ pub mod abci_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).init_chain(request).await }; + let fut = async move { + ::init_chain(&inner, request).await + }; Box::pin(fut) } } @@ -1383,7 +1397,7 @@ pub mod abci_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).list_snapshots(request).await + ::list_snapshots(&inner, request).await }; Box::pin(fut) } @@ -1429,7 +1443,7 @@ pub mod abci_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).offer_snapshot(request).await + ::offer_snapshot(&inner, request).await }; Box::pin(fut) } @@ -1475,7 +1489,7 @@ pub mod abci_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).load_snapshot_chunk(request).await + ::load_snapshot_chunk(&inner, request).await }; Box::pin(fut) } @@ -1521,7 +1535,7 @@ pub mod abci_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).apply_snapshot_chunk(request).await + ::apply_snapshot_chunk(&inner, request).await }; Box::pin(fut) } @@ -1567,7 +1581,7 @@ pub mod abci_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).prepare_proposal(request).await + ::prepare_proposal(&inner, request).await }; Box::pin(fut) } @@ -1613,7 +1627,7 @@ pub mod abci_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).process_proposal(request).await + ::process_proposal(&inner, request).await }; Box::pin(fut) } @@ -1656,7 +1670,9 @@ pub mod abci_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).extend_vote(request).await }; + let fut = async move { + ::extend_vote(&inner, request).await + }; Box::pin(fut) } } @@ -1701,7 +1717,7 @@ pub mod abci_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).verify_vote_extension(request).await + ::verify_vote_extension(&inner, request).await }; Box::pin(fut) } @@ -1747,7 +1763,7 @@ pub mod abci_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).finalize_block(request).await + ::finalize_block(&inner, request).await }; Box::pin(fut) } diff --git a/proto/src/prost/v0_38/tendermint.rpc.grpc.rs b/proto/src/prost/v0_38/tendermint.rpc.grpc.rs index 1cb42bb56..0084885c0 100644 --- a/proto/src/prost/v0_38/tendermint.rpc.grpc.rs +++ b/proto/src/prost/v0_38/tendermint.rpc.grpc.rs @@ -38,6 +38,10 @@ pub mod broadcast_api_server { tonic::Status, >; } + /// BroadcastAPI + /// + /// Deprecated: This API will be superseded by a more comprehensive gRPC-based + /// broadcast API, and is scheduled for removal after v0.38. #[derive(Debug)] pub struct BroadcastApiServer { inner: _Inner, @@ -132,7 +136,9 @@ pub mod broadcast_api_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).ping(request).await }; + let fut = async move { + ::ping(&inner, request).await + }; Box::pin(fut) } } @@ -177,7 +183,7 @@ pub mod broadcast_api_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).broadcast_tx(request).await + ::broadcast_tx(&inner, request).await }; Box::pin(fut) } diff --git a/proto/src/tendermint/v0_34.rs b/proto/src/tendermint/v0_34.rs index 0bd49d93b..0fe8d876a 100644 --- a/proto/src/tendermint/v0_34.rs +++ b/proto/src/tendermint/v0_34.rs @@ -62,5 +62,5 @@ pub mod version { pub mod meta { pub const REPOSITORY: &str = "https://github.com/cometbft/cometbft"; - pub const COMMITISH: &str = "v0.34.28"; + pub const COMMITISH: &str = "v0.34.29"; } diff --git a/proto/src/tendermint/v0_37.rs b/proto/src/tendermint/v0_37.rs index 580b38d92..56c9112ee 100644 --- a/proto/src/tendermint/v0_37.rs +++ b/proto/src/tendermint/v0_37.rs @@ -62,5 +62,5 @@ pub mod version { pub mod meta { pub const REPOSITORY: &str = "https://github.com/cometbft/cometbft"; - pub const COMMITISH: &str = "v0.37.1"; + pub const COMMITISH: &str = "v0.37.2"; } diff --git a/proto/src/tendermint/v0_38.rs b/proto/src/tendermint/v0_38.rs index f3eb9433e..6fb6daadd 100644 --- a/proto/src/tendermint/v0_38.rs +++ b/proto/src/tendermint/v0_38.rs @@ -62,5 +62,5 @@ pub mod version { pub mod meta { pub const REPOSITORY: &str = "https://github.com/cometbft/cometbft"; - pub const COMMITISH: &str = "v0.38.0-alpha.1"; + pub const COMMITISH: &str = "v0.38.0-rc3"; } diff --git a/tendermint/Cargo.toml b/tendermint/Cargo.toml index cd0fcf857..7c8eb28ba 100644 --- a/tendermint/Cargo.toml +++ b/tendermint/Cargo.toml @@ -35,8 +35,8 @@ ed25519 = { version = "2", default-features = false, features = ["alloc"] } futures = { version = "0.3", default-features = false } num-traits = { version = "0.2", default-features = false } once_cell = { version = "1.3", default-features = false } -prost = { version = "0.11", default-features = false } -prost-types = { version = "0.11", default-features = false } +prost = { version = "0.12", default-features = false } +prost-types = { version = "0.12", default-features = false } serde = { version = "1", default-features = false, features = ["derive"] } serde_json = { version = "1", default-features = false, features = ["alloc"] } serde_bytes = { version = "0.11", default-features = false } diff --git a/tendermint/src/abci/response/process_proposal.rs b/tendermint/src/abci/response/process_proposal.rs index e89d74aad..83a031bf9 100644 --- a/tendermint/src/abci/response/process_proposal.rs +++ b/tendermint/src/abci/response/process_proposal.rs @@ -35,8 +35,10 @@ mod v0_37 { fn try_from(message: pb::ResponseProcessProposal) -> Result { use pb::response_process_proposal::ProposalStatus; - let status = ProposalStatus::from_i32(message.status) - .ok_or_else(Error::unsupported_process_proposal_status)?; + let status = message + .status + .try_into() + .map_err(|_| Error::unsupported_process_proposal_status())?; let value = match status { ProposalStatus::Unknown => ProcessProposal::Unknown, @@ -70,8 +72,10 @@ mod v0_38 { fn try_from(message: pb::ResponseProcessProposal) -> Result { use pb::response_process_proposal::ProposalStatus; - let status = ProposalStatus::from_i32(message.status) - .ok_or_else(Error::unsupported_process_proposal_status)?; + let status = message + .status + .try_into() + .map_err(|_| Error::unsupported_process_proposal_status())?; let value = match status { ProposalStatus::Unknown => ProcessProposal::Unknown, diff --git a/tendermint/src/abci/response/verify_vote_extension.rs b/tendermint/src/abci/response/verify_vote_extension.rs index 685d9d317..292f6d2e6 100644 --- a/tendermint/src/abci/response/verify_vote_extension.rs +++ b/tendermint/src/abci/response/verify_vote_extension.rs @@ -31,8 +31,10 @@ mod v0_38 { fn try_from(message: pb::ResponseVerifyVoteExtension) -> Result { use pb::response_verify_vote_extension::VerifyStatus; - let status = VerifyStatus::from_i32(message.status) - .ok_or_else(Error::unsupported_verify_vote_extension_status)?; + let status = message + .status + .try_into() + .map_err(|_| Error::unsupported_verify_vote_extension_status())?; let value = match status { VerifyStatus::Unknown => VerifyVoteExtension::Unknown, diff --git a/tendermint/src/abci/types.rs b/tendermint/src/abci/types.rs index f52b4bf47..c892e0957 100644 --- a/tendermint/src/abci/types.rs +++ b/tendermint/src/abci/types.rs @@ -694,8 +694,10 @@ mod v0_38 { type Error = Error; fn try_from(vi: pb::VoteInfo) -> Result { - let block_id_flag = - RawBlockIdFlag::from_i32(vi.block_id_flag).ok_or_else(Error::block_id_flag)?; + let block_id_flag: RawBlockIdFlag = vi + .block_id_flag + .try_into() + .map_err(|_| Error::block_id_flag())?; Ok(Self { validator: vi .validator @@ -724,8 +726,10 @@ mod v0_38 { type Error = Error; fn try_from(vi: pb::ExtendedVoteInfo) -> Result { - let block_id_flag = - RawBlockIdFlag::from_i32(vi.block_id_flag).ok_or_else(Error::block_id_flag)?; + let block_id_flag: RawBlockIdFlag = vi + .block_id_flag + .try_into() + .map_err(|_| Error::block_id_flag())?; Ok(Self { validator: vi .validator diff --git a/tools/Cargo.toml b/tools/Cargo.toml index 37ecb9722..b3dfab572 100644 --- a/tools/Cargo.toml +++ b/tools/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "abci-test", diff --git a/tools/proto-compiler/Cargo.toml b/tools/proto-compiler/Cargo.toml index 49f31887b..0eb8f885b 100644 --- a/tools/proto-compiler/Cargo.toml +++ b/tools/proto-compiler/Cargo.toml @@ -7,11 +7,11 @@ publish = false [dependencies] walkdir = { version = "2.3" } -prost-build = { version = "0.11.4" } +prost-build = { version = "0.12.0" } git2 = { version = "0.16" } tempfile = { version = "3.5.0" } subtle-encoding = { version = "0.5" } serde = { version = "1.0", features = ["derive"] } serde_yaml = { version = "0.9" } thiserror = { version = "1.0" } -tonic-build = { version = "0.9" } +tonic-build = { version = "0.10.0" } diff --git a/tools/proto-compiler/src/constants.rs b/tools/proto-compiler/src/constants.rs index 4c150e6b9..09e239db5 100644 --- a/tools/proto-compiler/src/constants.rs +++ b/tools/proto-compiler/src/constants.rs @@ -19,17 +19,17 @@ pub const TENDERMINT_VERSIONS: &[TendermintVersion] = &[ TendermintVersion { repo: "https://github.com/cometbft/cometbft", ident: "v0_34", - commitish: "v0.34.28", + commitish: "v0.34.29", }, TendermintVersion { repo: "https://github.com/cometbft/cometbft", ident: "v0_37", - commitish: "v0.37.1", + commitish: "v0.37.2", }, TendermintVersion { repo: "https://github.com/cometbft/cometbft", ident: "v0_38", - commitish: "v0.38.0-alpha.1", + commitish: "v0.38.0-rc3", }, ];