Skip to content

Commit

Permalink
Merge tag 'v0.38.0' into farhad/wasm-clients
Browse files Browse the repository at this point in the history
ibc-proto-rs v0.38.0

October 19th, 2023

This release contains a breaking change, where the `Protobuf` trait is not
object-safe any longer, but rather re-exported from the `tendermint-proto` crate.

It also updates the Interchain Security protos to include misbehaviour-related messages.

BREAKING CHANGES:

- Switch from using object safe `Protobuf` definitions and re-export
 `Protobuf` from `tendermint-proto` crate` instead.
 (#116)

FEATURES:

- Update CCV provider protos to include misbehaviour-related messages
  (#113)
  • Loading branch information
Farhad-Shabani committed Nov 28, 2023
2 parents 6573eeb + 1075017 commit 6c68e19
Show file tree
Hide file tree
Showing 20 changed files with 839 additions and 543 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Switch from using object safe `Protobuf` definitions and instead, re-export
`Protobuf` from `tendermint-proto` crate`
([#116](https://github.com/cosmos/ibc-proto-rs/issues/116))
2 changes: 2 additions & 0 deletions .changelog/v0.38.0/features/113-ccv-protos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Update CCV provider protos to include misbehaviour-related messages
([\#113](https://github.com/cosmos/ibc-proto-rs/issues/113))
6 changes: 6 additions & 0 deletions .changelog/v0.38.0/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*October 19th, 2023*

This release contains a breaking change, where the `Protobuf` trait is not
object-safe any longer, but rather re-exported from the `tendermint-proto` crate.

It also updates the Interchain Security protos to include misbehaviour-related messages.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# CHANGELOG

## v0.38.0

*October 19th, 2023*

This release contains a breaking change, where the `Protobuf` trait is not
object-safe any longer, but rather re-exported from the `tendermint-proto` crate.

It also updates the Interchain Security protos to include misbehaviour-related messages.

### BREAKING CHANGES

- Switch from using object safe `Protobuf` definitions and re-export
`Protobuf` from `tendermint-proto` crate` instead.
([#116](https://github.com/cosmos/ibc-proto-rs/issues/116))

### FEATURES

- Update CCV provider protos to include misbehaviour-related messages
([\#113](https://github.com/cosmos/ibc-proto-rs/issues/113))

## v0.37.1

*October 10th, 2023*
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ibc-proto"
version = "0.37.1"
version = "0.38.0"
authors = ["Informal Systems <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
12 changes: 6 additions & 6 deletions scripts/sync-protobuf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ COSMOS_ICS_GIT="${COSMOS_ICS_GIT:-$CACHE_PATH/cosmos/interchain-security.git}"

COSMOS_SDK_COMMIT="$(cat src/COSMOS_SDK_COMMIT)"
IBC_GO_COMMIT="$(cat src/IBC_GO_COMMIT)"
COSMOS_ICS_COMMIT="$(cat src/COSMOS_ICS_COMMIT)"
INTERCHAIN_SECURITY_COMMIT="$(cat src/INTERCHAIN_SECURITY_COMMIT)"

echo "COSMOS_SDK_COMMIT: $COSMOS_SDK_COMMIT"
echo "IBC_GO_COMMIT: $IBC_GO_COMMIT"
echo "COSMOS_ICS_COMMIT: $COSMOS_ICS_COMMIT"
echo "INTERCHAIN_SECURITY_COMMIT: $INTERCHAIN_SECURITY_COMMIT"

# Use either --ics-commit flag for commit ID,
# or --ics-tag for git tag. Because we can't modify
# proto-compiler to have smart detection on that.

if [[ "$COSMOS_ICS_COMMIT" =~ ^[a-zA-Z0-9]{40}$ ]]
if [[ "$INTERCHAIN_SECURITY_COMMIT" =~ ^[a-zA-Z0-9]{40}$ ]]
then
ICS_COMMIT_OPTION="--ics-commit"
else
Expand Down Expand Up @@ -111,7 +111,7 @@ COSMOS_ICS_DIR=$(mktemp -d /tmp/interchain-security-XXXXXXXX)

pushd "$COSMOS_ICS_DIR"
git clone "$COSMOS_ICS_GIT" .
git checkout -b "$COSMOS_ICS_COMMIT" "$COSMOS_ICS_COMMIT"
git checkout -b "$INTERCHAIN_SECURITY_COMMIT" "$INTERCHAIN_SECURITY_COMMIT"

cd proto
buf mod update
Expand Down Expand Up @@ -163,13 +163,13 @@ mkdir -p src/prost

cd tools/proto-compiler

cargo build --locked
cargo build

# Run the proto-compiler twice,
# once for std version with --build-tonic set to true
# and once for no-std version with --build-tonic set to false

cargo run --locked -- compile \
cargo run -- compile \
--ics "$COSMOS_ICS_DIR/proto-include" \
--sdk "$COSMOS_SDK_DIR/proto-include" \
--ibc "$IBC_GO_DIR/proto-include" \
Expand Down
1 change: 0 additions & 1 deletion src/COSMOS_ICS_COMMIT

This file was deleted.

2 changes: 1 addition & 1 deletion src/IBC_GO_COMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bd8e2015a67d33d879833374c6638277c067499c
d0c05d5771998626b7b80349747d99c6915cdd4f
1 change: 1 addition & 0 deletions src/INTERCHAIN_SECURITY_COMMIT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ea545b490b53b8e6f422492b4fb2820ab0bc140b
11 changes: 5 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
#![forbid(unsafe_code)]

pub mod google;
pub mod protobuf;

pub use tendermint_proto::Protobuf;

extern crate alloc;

Expand All @@ -31,6 +32,9 @@ pub const COSMOS_SDK_COMMIT: &str = include_str!("COSMOS_SDK_COMMIT");
/// The version (commit hash) of IBC Go used when generating this library.
pub const IBC_GO_COMMIT: &str = include_str!("IBC_GO_COMMIT");

/// The version (commit hash) of Interchain Security used when generating this library.
pub const INTERCHAIN_SECURITY_COMMIT: &str = include_str!("INTERCHAIN_SECURITY_COMMIT");

/// File descriptor set of compiled proto.
#[cfg(feature = "proto-descriptor")]
pub const FILE_DESCRIPTOR_SET: &[u8] = include_bytes!("prost/proto_descriptor.bin");
Expand Down Expand Up @@ -63,11 +67,6 @@ pub mod cosmos {
}
}
}
pub mod evidence {
pub mod v1beta1 {
include_proto!("cosmos.evidence.v1beta1.rs");
}
}
pub mod staking {
pub mod v1beta1 {
include_proto!("cosmos.staking.v1beta1.rs");
Expand Down
18 changes: 0 additions & 18 deletions src/prost/cosmos.evidence.v1beta1.rs

This file was deleted.

111 changes: 111 additions & 0 deletions src/prost/ibc.core.channel.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2006,6 +2006,35 @@ pub struct QueryNextSequenceReceiveResponse {
#[prost(message, optional, tag = "3")]
pub proof_height: ::core::option::Option<super::super::client::v1::Height>,
}
/// QueryNextSequenceSendRequest is the request type for the
/// Query/QueryNextSequenceSend RPC method
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryNextSequenceSendRequest {
/// port unique identifier
#[prost(string, tag = "1")]
pub port_id: ::prost::alloc::string::String,
/// channel unique identifier
#[prost(string, tag = "2")]
pub channel_id: ::prost::alloc::string::String,
}
/// QueryNextSequenceSendResponse is the request type for the
/// Query/QueryNextSequenceSend RPC method
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryNextSequenceSendResponse {
/// next sequence send number
#[prost(uint64, tag = "1")]
pub next_sequence_send: u64,
/// merkle proof of existence
#[prost(bytes = "vec", tag = "2")]
pub proof: ::prost::alloc::vec::Vec<u8>,
/// height at which the proof was retrieved
#[prost(message, optional, tag = "3")]
pub proof_height: ::core::option::Option<super::super::client::v1::Height>,
}
/// Generated client implementations.
#[cfg(feature = "client")]
pub mod query_client {
Expand Down Expand Up @@ -2460,6 +2489,34 @@ pub mod query_client {
);
self.inner.unary(req, path, codec).await
}
/// NextSequenceSend returns the next send sequence for a given channel.
pub async fn next_sequence_send(
&mut self,
request: impl tonic::IntoRequest<super::QueryNextSequenceSendRequest>,
) -> std::result::Result<
tonic::Response<super::QueryNextSequenceSendResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/ibc.core.channel.v1.Query/NextSequenceSend",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("ibc.core.channel.v1.Query", "NextSequenceSend"),
);
self.inner.unary(req, path, codec).await
}
}
}
/// Generated server implementations.
Expand Down Expand Up @@ -2582,6 +2639,14 @@ pub mod query_server {
tonic::Response<super::QueryNextSequenceReceiveResponse>,
tonic::Status,
>;
/// NextSequenceSend returns the next send sequence for a given channel.
async fn next_sequence_send(
&self,
request: tonic::Request<super::QueryNextSequenceSendRequest>,
) -> std::result::Result<
tonic::Response<super::QueryNextSequenceSendResponse>,
tonic::Status,
>;
}
/// Query provides defines the gRPC querier service
#[derive(Debug)]
Expand Down Expand Up @@ -3276,6 +3341,52 @@ pub mod query_server {
};
Box::pin(fut)
}
"/ibc.core.channel.v1.Query/NextSequenceSend" => {
#[allow(non_camel_case_types)]
struct NextSequenceSendSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryNextSequenceSendRequest>
for NextSequenceSendSvc<T> {
type Response = super::QueryNextSequenceSendResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryNextSequenceSendRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::next_sequence_send(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
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 = NextSequenceSendSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
Ok(
Expand Down
Loading

0 comments on commit 6c68e19

Please sign in to comment.