Skip to content

Commit

Permalink
deps: bump ibc-proto-rs to v0.38.0 + some other dependency upgrades (
Browse files Browse the repository at this point in the history
…cosmos#949)

* deps: bump ibc-proto-rs to v0.38.0 + some other dependency upgrades

* chore: add unclog

* nit: unclog link

Co-authored-by: Rano | Ranadeep <[email protected]>
Signed-off-by: Farhad Shabani <[email protected]>

* deps: upgrade some others

---------

Signed-off-by: Farhad Shabani <[email protected]>
Co-authored-by: Rano | Ranadeep <[email protected]>
  • Loading branch information
Farhad-Shabani and rnbguy authored Nov 7, 2023
1 parent 1ec4b8c commit 527bb14
Show file tree
Hide file tree
Showing 58 changed files with 162 additions and 124 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Bump `ibc-proto-rs` to v0.38.0
([\#949](https://github.com/cosmos/ibc-rs/issues/949))
4 changes: 2 additions & 2 deletions ci/cw-check/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ci/no-std-check/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions ci/no-std-check/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ resolver = "2"

[dependencies]
ibc = { path = "../../crates/ibc", default-features = false, features = ["serde"] }
ibc-proto = { version = "0.37.1", default-features = false, features = [
ibc-proto = { version = "0.38.0", default-features = false, features = [
"parity-scale-codec",
"borsh",
"serde",
Expand All @@ -15,10 +15,10 @@ tendermint = { version = "0.34", default-features = false }
tendermint-proto = { version = "0.34", default-features = false }
tendermint-light-client-verifier = { version = "0.34", default-features = false, features = ["rust-crypto"] }

sp-core = { version = "24.0.0", default-features = false, optional = true }
sp-io = { version = "26.0.0", default-features = false, optional = true }
sp-runtime = { version = "27.0.0", default-features = false, optional = true }
sp-std = { version = "11.0.0", default-features = false, optional = true }
sp-core = { version = "25.0.0", default-features = false, optional = true }
sp-io = { version = "27.0.0", default-features = false, optional = true }
sp-runtime = { version = "28.0.0", default-features = false, optional = true }
sp-std = { version = "12.0.0", default-features = false, optional = true }

# The indirect dependency `syn` 2.0.4 has a bug that causes
# compilation errors in `tendermint`. This is fixed in 2.0.5.
Expand Down
2 changes: 1 addition & 1 deletion crates/ibc-derive/src/consensus_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub fn consensus_state_derive_impl(ast: DeriveInput) -> TokenStream {
}
}

fn encode_vec(&self) -> Vec<u8> {
fn encode_vec(self) -> Vec<u8> {
match self {
#(#encode_vec_impl),*
}
Expand Down
2 changes: 1 addition & 1 deletion crates/ibc-query/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ std = ["ibc-proto/std", "ibc/std"]

[dependencies]
ibc = { version = "0.47.0", path = "../ibc", default-features = false }
ibc-proto = { version = "0.37.1", default-features = false, features = ["server"] }
ibc-proto = { version = "0.38.0", default-features = false, features = ["server"] }
displaydoc = { version = "0.2", default-features = false }
tonic = "0.10"
28 changes: 14 additions & 14 deletions crates/ibc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,34 +50,34 @@ mocks = ["tendermint-testgen", "parking_lot", "typed-builder", "std"]

[dependencies]
# Proto definitions for all IBC-related interfaces, e.g., connections or channels.
ibc-proto = { version = "0.37.1", default-features = false }
ibc-proto = { version = "0.38.0", default-features = false }
ics23 = { version = "0.11", default-features = false, features = ["host-functions"] }
time = { version = ">=0.3.0, <0.3.31", default-features = false }
serde_derive = { version = "1.0.104", default-features = false, optional = true }
serde_derive = { version = "1.0", default-features = false, optional = true }
serde = { version = "1.0", default-features = false, optional = true }
serde_json = { package = "serde-json-wasm", version = "1.0.0" , default-features = false, optional = true}
tracing = { version = "0.1.36", default-features = false }
tracing = { version = "0.1.40", default-features = false }
prost = { version = "0.12", default-features = false }
bytes = { version = "1.2.1", default-features = false }
bytes = { version = "1.5.0", default-features = false }
subtle-encoding = { version = "0.5", default-features = false }
sha2 = { version = "0.10.6", default-features = false }
sha2 = { version = "0.10.8", default-features = false }
displaydoc = { version = "0.2", default-features = false }
num-traits = { version = "0.2.15", default-features = false }
num-traits = { version = "0.2.17", default-features = false }
derive_more = { version = "0.99.17", default-features = false, features = ["from", "into", "display", "try_into"] }
uint = { version = "0.9", default-features = false }
primitive-types = { version = "0.12.0", default-features = false, features = ["serde_no_std"] }
primitive-types = { version = "0.12.2", default-features = false, features = ["serde_no_std"] }

## for codec encode or decode
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["full"], optional = true }
scale-info = { version = "2.1.2", default-features = false, features = ["derive"], optional = true }
parity-scale-codec = { version = "3.6.5", default-features = false, features = ["full"], optional = true }
scale-info = { version = "2.10.0", default-features = false, features = ["derive"], optional = true }
## for borsh encode or decode
borsh = {version = "0.10", default-features = false, optional = true }
parking_lot = { version = "0.12.1", default-features = false, optional = true }
typed-builder = { version = "0.17.0", optional = true }
typed-builder = { version = "0.18.0", optional = true }

ibc-derive = { version ="0.3.0", path = "../ibc-derive" }

schemars = { version = "0.8.12", optional = true }
schemars = { version = "0.8.15", optional = true }

[dependencies.tendermint]
version = "0.34"
Expand All @@ -99,8 +99,8 @@ default-features = false

[dev-dependencies]
env_logger = "0.10.0"
rstest = "0.18.1"
tracing-subscriber = { version = "0.3.14", features = ["fmt", "env-filter", "json"]}
test-log = { version = "0.2.10", features = ["trace"] }
rstest = "0.18.2"
tracing-subscriber = { version = "0.3.17", features = ["fmt", "env-filter", "json"]}
test-log = { version = "0.2.13", features = ["trace"] }
tendermint-rpc = { version = "0.34", features = ["http-client", "websocket-client"] }
ibc = { path = ".", features = ["mocks"] }
6 changes: 2 additions & 4 deletions crates/ibc/src/applications/transfer/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use core::convert::Infallible;
use core::str::Utf8Error;

use displaydoc::Display;
use ibc_proto::protobuf::Error as TendermintProtoError;
use uint::FromDecStrErr;

use crate::core::ics04_channel::acknowledgement::StatusValue;
Expand Down Expand Up @@ -64,8 +63,8 @@ pub enum TokenTransferError {
port_id: PortId,
exp_port_id: PortId,
},
/// decoding raw msg error: `{0}`
DecodeRawMsg(TendermintProtoError),
/// decoding raw msg error: `{reason}`
DecodeRawMsg { reason: String },
/// unknown msg type: `{msg_type}`
UnknownMsgType { msg_type: String },
/// invalid coin string: `{coin}`
Expand All @@ -89,7 +88,6 @@ impl std::error::Error for TokenTransferError {
..
} => Some(e),
Self::InvalidAmount(e) => Some(e),
Self::DecodeRawMsg(e) => Some(e),
Self::Utf8Decode(e) => Some(e),
_ => None,
}
Expand Down
6 changes: 4 additions & 2 deletions crates/ibc/src/applications/transfer/msgs/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use ibc_proto::google::protobuf::Any;
use ibc_proto::ibc::applications::transfer::v1::MsgTransfer as RawMsgTransfer;
use ibc_proto::protobuf::Protobuf;
use ibc_proto::Protobuf;

use crate::applications::transfer::error::TokenTransferError;
use crate::applications::transfer::packet::PacketData;
Expand Down Expand Up @@ -115,7 +115,9 @@ impl TryFrom<Any> for MsgTransfer {
fn try_from(raw: Any) -> Result<Self, Self::Error> {
match raw.type_url.as_str() {
TYPE_URL => {
MsgTransfer::decode_vec(&raw.value).map_err(TokenTransferError::DecodeRawMsg)
MsgTransfer::decode_vec(&raw.value).map_err(|e| TokenTransferError::DecodeRawMsg {
reason: e.to_string(),
})
}
_ => Err(TokenTransferError::UnknownMsgType {
msg_type: raw.type_url,
Expand Down
4 changes: 2 additions & 2 deletions crates/ibc/src/clients/ics07_tendermint/client_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use ibc_proto::google::protobuf::Any;
use ibc_proto::ibc::core::client::v1::Height as RawHeight;
use ibc_proto::ibc::core::commitment::v1::MerkleProof as RawMerkleProof;
use ibc_proto::ibc::lightclients::tendermint::v1::ClientState as RawTmClientState;
use ibc_proto::protobuf::Protobuf;
use ibc_proto::Protobuf;
use prost::Message;
use tendermint::chain::id::MAX_LENGTH as MaxChainIdLen;
use tendermint::trust_threshold::TrustThresholdFraction as TendermintTrustThresholdFraction;
Expand Down Expand Up @@ -770,7 +770,7 @@ impl From<ClientState> for Any {
fn from(client_state: ClientState) -> Self {
Any {
type_url: TENDERMINT_CLIENT_STATE_TYPE_URL.to_string(),
value: Protobuf::<RawTmClientState>::encode_vec(&client_state),
value: Protobuf::<RawTmClientState>::encode_vec(client_state),
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions crates/ibc/src/clients/ics07_tendermint/consensus_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use ibc_proto::google::protobuf::Any;
use ibc_proto::ibc::lightclients::tendermint::v1::ConsensusState as RawConsensusState;
use ibc_proto::protobuf::Protobuf;
use ibc_proto::Protobuf;
use tendermint::hash::Algorithm;
use tendermint::time::Time;
use tendermint::Hash;
Expand Down Expand Up @@ -126,7 +126,7 @@ impl From<ConsensusState> for Any {
fn from(consensus_state: ConsensusState) -> Self {
Any {
type_url: TENDERMINT_CONSENSUS_STATE_TYPE_URL.to_string(),
value: Protobuf::<RawConsensusState>::encode_vec(&consensus_state),
value: Protobuf::<RawConsensusState>::encode_vec(consensus_state),
}
}
}
Expand Down Expand Up @@ -156,7 +156,7 @@ impl ConsensusStateTrait for ConsensusState {
self.timestamp.into()
}

fn encode_vec(&self) -> Vec<u8> {
fn encode_vec(self) -> Vec<u8> {
<Self as Protobuf<Any>>::encode_vec(self)
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/ibc/src/clients/ics07_tendermint/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use core::str::FromStr;
use bytes::Buf;
use ibc_proto::google::protobuf::Any;
use ibc_proto::ibc::lightclients::tendermint::v1::Header as RawHeader;
use ibc_proto::protobuf::Protobuf;
use ibc_proto::Protobuf;
use pretty::{PrettySignedHeader, PrettyValidatorSet};
use prost::Message;
use tendermint::block::signed_header::SignedHeader;
Expand Down Expand Up @@ -186,7 +186,7 @@ impl From<Header> for Any {
fn from(header: Header) -> Self {
Any {
type_url: TENDERMINT_HEADER_TYPE_URL.to_string(),
value: Protobuf::<RawHeader>::encode_vec(&header),
value: Protobuf::<RawHeader>::encode_vec(header),
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/ibc/src/clients/ics07_tendermint/misbehaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use bytes::Buf;
use ibc_proto::google::protobuf::Any;
use ibc_proto::ibc::lightclients::tendermint::v1::Misbehaviour as RawMisbehaviour;
use ibc_proto::protobuf::Protobuf;
use ibc_proto::Protobuf;
use prost::Message;

use crate::clients::ics07_tendermint::error::Error;
Expand Down Expand Up @@ -135,7 +135,7 @@ impl From<Misbehaviour> for Any {
fn from(misbehaviour: Misbehaviour) -> Self {
Any {
type_url: TENDERMINT_MISBEHAVIOUR_TYPE_URL.to_string(),
value: Protobuf::<RawMisbehaviour>::encode_vec(&misbehaviour),
value: Protobuf::<RawMisbehaviour>::encode_vec(misbehaviour),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/ibc/src/clients/ics07_tendermint/trust_threshold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use core::convert::TryFrom;
use core::fmt::{Display, Error as FmtError, Formatter};

use ibc_proto::ibc::lightclients::tendermint::v1::Fraction;
use ibc_proto::protobuf::Protobuf;
use ibc_proto::Protobuf;
use tendermint::trust_threshold::TrustThresholdFraction;

use crate::core::ics02_client::error::ClientError;
Expand Down
5 changes: 2 additions & 3 deletions crates/ibc/src/core/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ pub enum RouterError {
ContextError(ContextError),
/// unknown type URL `{url}`
UnknownMessageTypeUrl { url: String },
/// the message is malformed and cannot be decoded error: `{0}`
MalformedMessageBytes(ibc_proto::protobuf::Error),
/// the message is malformed and cannot be decoded error: `{reason}`
MalformedMessageBytes { reason: String },
/// port `{port_id}` is unknown
UnknownPort { port_id: PortId },
/// module not found
Expand All @@ -84,7 +84,6 @@ impl std::error::Error for RouterError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self {
Self::ContextError(e) => Some(e),
Self::MalformedMessageBytes(e) => Some(e),
_ => None,
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/ibc/src/core/ics02_client/consensus_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ pub trait ConsensusState: Send + Sync {
/// Serializes the `ConsensusState`. This is expected to be implemented as
/// first converting to the raw type (i.e. the protobuf definition), and then
/// serializing that.
fn encode_vec(&self) -> Vec<u8>;
fn encode_vec(self) -> Vec<u8>;
}
6 changes: 2 additions & 4 deletions crates/ibc/src/core/ics02_client/error.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Defines the client error type

use displaydoc::Display;
use ibc_proto::protobuf::Error as TendermintProtoError;

use super::client_state::Status;
use crate::core::ics02_client::client_type::ClientType;
Expand Down Expand Up @@ -65,8 +64,8 @@ pub enum ClientError {
Decode(prost::DecodeError),
/// invalid client identifier error: `{0}`
InvalidClientIdentifier(IdentifierError),
/// invalid raw header error: `{0}`
InvalidRawHeader(TendermintProtoError),
/// invalid raw header error: `{reason}`
InvalidRawHeader { reason: String },
/// missing raw client message
MissingClientMessage,
/// invalid raw misbehaviour error: `{0}`
Expand Down Expand Up @@ -140,7 +139,6 @@ impl std::error::Error for ClientError {
} => Some(e),
Self::InvalidMsgUpdateClientId(e) => Some(e),
Self::InvalidClientIdentifier(e) => Some(e),
Self::InvalidRawHeader(e) => Some(e),
Self::InvalidRawMisbehaviour(e) => Some(e),
Self::InvalidCommitmentProof(e) => Some(e),
Self::InvalidPacketTimestamp(e) => Some(e),
Expand Down
2 changes: 1 addition & 1 deletion crates/ibc/src/core/ics02_client/height.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use core::str::FromStr;

use displaydoc::Display;
use ibc_proto::ibc::core::client::v1::Height as RawHeight;
use ibc_proto::protobuf::Protobuf;
use ibc_proto::Protobuf;

use crate::core::ics02_client::error::ClientError;
use crate::prelude::*;
Expand Down
2 changes: 1 addition & 1 deletion crates/ibc/src/core/ics02_client/msgs/create_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use ibc_proto::google::protobuf::Any;
use ibc_proto::ibc::core::client::v1::MsgCreateClient as RawMsgCreateClient;
use ibc_proto::protobuf::Protobuf;
use ibc_proto::Protobuf;

use crate::core::ics02_client::error::ClientError;
use crate::core::Msg;
Expand Down
2 changes: 1 addition & 1 deletion crates/ibc/src/core/ics02_client/msgs/misbehaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use ibc_proto::google::protobuf::Any as ProtoAny;
use ibc_proto::ibc::core::client::v1::MsgSubmitMisbehaviour as RawMsgSubmitMisbehaviour;
use ibc_proto::protobuf::Protobuf;
use ibc_proto::Protobuf;

use crate::core::ics02_client::error::ClientError;
use crate::core::ics24_host::identifier::ClientId;
Expand Down
2 changes: 1 addition & 1 deletion crates/ibc/src/core/ics02_client/msgs/update_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use ibc_proto::google::protobuf::Any;
use ibc_proto::ibc::core::client::v1::MsgUpdateClient as RawMsgUpdateClient;
use ibc_proto::protobuf::Protobuf;
use ibc_proto::Protobuf;

use crate::core::ics02_client::error::ClientError;
use crate::core::ics24_host::identifier::ClientId;
Expand Down
2 changes: 1 addition & 1 deletion crates/ibc/src/core/ics02_client/msgs/upgrade_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use core::str::FromStr;

use ibc_proto::google::protobuf::Any;
use ibc_proto::ibc::core::client::v1::MsgUpgradeClient as RawMsgUpgradeClient;
use ibc_proto::protobuf::Protobuf;
use ibc_proto::Protobuf;

use crate::core::ics02_client::error::{ClientError, UpgradeClientError};
use crate::core::ics23_commitment::commitment::CommitmentProofBytes;
Expand Down
2 changes: 1 addition & 1 deletion crates/ibc/src/core/ics03_connection/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use ibc_proto::ibc::core::connection::v1::{
ConnectionEnd as RawConnectionEnd, Counterparty as RawCounterparty,
IdentifiedConnection as RawIdentifiedConnection,
};
use ibc_proto::protobuf::Protobuf;
use ibc_proto::Protobuf;

use crate::core::ics02_client::error::ClientError;
use crate::core::ics03_connection::error::ConnectionError;
Expand Down
3 changes: 0 additions & 3 deletions crates/ibc/src/core/ics03_connection/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
use alloc::string::String;

use displaydoc::Display;
use ibc_proto::protobuf::Error as ProtoError;

use crate::core::ics02_client::error as client_error;
use crate::core::ics03_connection::version::Version;
Expand All @@ -17,8 +16,6 @@ pub enum ConnectionError {
Client(client_error::ClientError),
/// invalid connection state: expected `{expected}`, actual `{actual}`
InvalidState { expected: String, actual: String },
/// invalid connection end error: `{0}`
InvalidConnectionEnd(ProtoError),
/// consensus height claimed by the client on the other party is too advanced: `{target_height}` (host chain current height: `{current_height}`)
InvalidConsensusHeight {
target_height: Height,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Protocol logic specific to processing ICS3 messages of type `MsgConnectionOpenAck`.

use ibc_proto::protobuf::Protobuf;
use ibc_proto::Protobuf;
use prost::Message;

use crate::core::context::ContextError;
Expand Down
Loading

0 comments on commit 527bb14

Please sign in to comment.