Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump prost to v0.13 and tonic to v0.12 #1444

Merged
merged 4 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- `[tendermint-proto]`: Update `prost` to v0.13 and `tonic` to v0.12
([\#1444](https://github.com/informalsystems/tendermint-rs/pull/1444))
2 changes: 1 addition & 1 deletion abci/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ binary = [

[dependencies]
bytes = { version = "1.0", default-features = false }
prost = { version = "0.12", default-features = false }
prost = { version = "0.13", default-features = false }
tendermint-proto = { version = "0.37.0", default-features = false, path = "../proto" }
tracing = { version = "0.1", default-features = false }
flex-error = { version = "0.4.4", default-features = false }
Expand Down
4 changes: 2 additions & 2 deletions p2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ eyre = { version = "0.6", default-features = false }
flume = { version = "0.11.0", default-features = false }
hkdf = { version = "0.12.3", default-features = false }
merlin = { version = "3", default-features = false }
prost = { version = "0.12", default-features = false }
prost = { version = "0.13", default-features = false }
rand_core = { version = "0.6", default-features = false, features = ["std"] }
sha2 = { version = "0.10", default-features = false }
subtle = { version = "2", default-features = false }
Expand All @@ -49,4 +49,4 @@ tendermint-proto = { path = "../proto", version = "0.37.0", default-features = f
tendermint-std-ext = { path = "../std-ext", version = "0.37.0", default-features = false }

# optional dependencies
prost-derive = { version = "0.12", optional = true }
prost-derive = { version = "0.13", optional = true }
6 changes: 3 additions & 3 deletions proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ grpc-server = ["tonic"]
all-features = true

[dependencies]
prost = { version = "0.12", default-features = false }
prost-types = { version = "0.12", default-features = false }
prost = { version = "0.13", default-features = false }
prost-types = { version = "0.13", 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"] }
subtle-encoding = { version = "0.5", default-features = false, features = ["hex", "base64", "alloc"] }
time = { version = "0.3", default-features = false, features = ["macros", "parsing"] }
flex-error = { version = "0.4.4", default-features = false }
tonic = { version = "0.11", optional = true }
tonic = { version = "0.12", optional = true }

[dev-dependencies]
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
54 changes: 15 additions & 39 deletions proto/src/prost/v0_34/tendermint.abci.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// This file is @generated by prost-build.
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down Expand Up @@ -55,7 +56,7 @@ pub struct RequestEcho {
}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RequestFlush {}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down Expand Up @@ -139,19 +140,19 @@ pub struct RequestDeliverTx {
}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RequestEndBlock {
#[prost(int64, tag = "1")]
pub height: i64,
}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RequestCommit {}
/// lists available snapshots
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RequestListSnapshots {}
/// offers a snapshot to the application
#[derive(::serde::Deserialize, ::serde::Serialize)]
Expand All @@ -168,7 +169,7 @@ pub struct RequestOfferSnapshot {
/// loads a snapshot chunk
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RequestLoadSnapshotChunk {
#[prost(uint64, tag = "1")]
pub height: u64,
Expand Down Expand Up @@ -256,7 +257,7 @@ pub struct ResponseEcho {
}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ResponseFlush {}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down Expand Up @@ -422,7 +423,7 @@ pub struct ResponseListSnapshots {
}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ResponseOfferSnapshot {
#[prost(enumeration = "response_offer_snapshot::Result", tag = "1")]
pub result: i32,
Expand Down Expand Up @@ -581,7 +582,7 @@ pub struct ConsensusParams {
/// BlockParams contains limits on the block size.
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct BlockParams {
/// Note: must be greater than 0
#[prost(int64, tag = "1")]
Expand Down Expand Up @@ -870,19 +871,17 @@ pub mod abci_application_server {
}
#[derive(Debug)]
pub struct AbciApplicationServer<T: AbciApplication> {
inner: _Inner<T>,
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
struct _Inner<T>(Arc<T>);
impl<T: AbciApplication> AbciApplicationServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
Expand Down Expand Up @@ -945,7 +944,6 @@ pub mod abci_application_server {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/tendermint.abci.ABCIApplication/Echo" => {
#[allow(non_camel_case_types)]
Expand Down Expand Up @@ -975,7 +973,6 @@ pub mod abci_application_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = EchoSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
Expand Down Expand Up @@ -1020,7 +1017,6 @@ pub mod abci_application_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = FlushSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
Expand Down Expand Up @@ -1065,7 +1061,6 @@ pub mod abci_application_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = InfoSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
Expand Down Expand Up @@ -1111,7 +1106,6 @@ pub mod abci_application_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = SetOptionSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
Expand Down Expand Up @@ -1157,7 +1151,6 @@ pub mod abci_application_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = DeliverTxSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
Expand Down Expand Up @@ -1203,7 +1196,6 @@ pub mod abci_application_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = CheckTxSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
Expand Down Expand Up @@ -1248,7 +1240,6 @@ pub mod abci_application_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = QuerySvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
Expand Down Expand Up @@ -1294,7 +1285,6 @@ pub mod abci_application_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = CommitSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
Expand Down Expand Up @@ -1340,7 +1330,6 @@ pub mod abci_application_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = InitChainSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
Expand Down Expand Up @@ -1386,7 +1375,6 @@ pub mod abci_application_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = BeginBlockSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
Expand Down Expand Up @@ -1432,7 +1420,6 @@ pub mod abci_application_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = EndBlockSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
Expand Down Expand Up @@ -1479,7 +1466,6 @@ pub mod abci_application_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ListSnapshotsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
Expand Down Expand Up @@ -1526,7 +1512,6 @@ pub mod abci_application_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = OfferSnapshotSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
Expand Down Expand Up @@ -1573,7 +1558,6 @@ pub mod abci_application_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = LoadSnapshotChunkSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
Expand Down Expand Up @@ -1623,7 +1607,6 @@ pub mod abci_application_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ApplySnapshotChunkSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
Expand All @@ -1645,8 +1628,11 @@ pub mod abci_application_server {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.header("grpc-status", tonic::Code::Unimplemented as i32)
.header(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
)
.body(empty_body())
.unwrap(),
)
Expand All @@ -1667,16 +1653,6 @@ pub mod abci_application_server {
}
}
}
impl<T: AbciApplication> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(Arc::clone(&self.0))
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: AbciApplication> tonic::server::NamedService for AbciApplicationServer<T> {
const NAME: &'static str = "tendermint.abci.ABCIApplication";
}
Expand Down
9 changes: 5 additions & 4 deletions proto/src/prost/v0_34/tendermint.blockchain.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// This file is @generated by prost-build.
/// BlockRequest requests a block for a specific height
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct BlockRequest {
#[prost(int64, tag = "1")]
pub height: i64,
}
/// NoBlockResponse informs the node that the peer does not have block at the requested height
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct NoBlockResponse {
#[prost(int64, tag = "1")]
pub height: i64,
Expand All @@ -21,11 +22,11 @@ pub struct BlockResponse {
}
/// StatusRequest requests the status of a peer.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct StatusRequest {}
/// StatusResponse is a peer response to inform their status.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct StatusResponse {
#[prost(int64, tag = "1")]
pub height: i64,
Expand Down
9 changes: 5 additions & 4 deletions proto/src/prost/v0_34/tendermint.consensus.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// This file is @generated by prost-build.
/// NewRoundStep is sent for every step taken in the ConsensusState.
/// For every height/round/step transition
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct NewRoundStep {
#[prost(int64, tag = "1")]
pub height: i64,
Expand Down Expand Up @@ -69,7 +70,7 @@ pub struct Vote {
}
/// HasVote is sent to indicate that a particular vote has been received.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct HasVote {
#[prost(int64, tag = "1")]
pub height: i64,
Expand Down Expand Up @@ -150,7 +151,7 @@ pub struct MsgInfo {
}
/// TimeoutInfo internally generated messages which may update the state
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TimeoutInfo {
#[prost(message, optional, tag = "1")]
pub duration: ::core::option::Option<crate::google::protobuf::Duration>,
Expand All @@ -164,7 +165,7 @@ pub struct TimeoutInfo {
/// EndHeight marks the end of the given height inside WAL.
/// @internal used by scripts/wal2json util.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct EndHeight {
#[prost(int64, tag = "1")]
pub height: i64,
Expand Down
1 change: 1 addition & 0 deletions proto/src/prost/v0_34/tendermint.crypto.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// This file is @generated by prost-build.
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down
1 change: 1 addition & 0 deletions proto/src/prost/v0_34/tendermint.libs.bits.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// This file is @generated by prost-build.
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down
1 change: 1 addition & 0 deletions proto/src/prost/v0_34/tendermint.mempool.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// This file is @generated by prost-build.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Txs {
Expand Down
Loading
Loading