Skip to content

Commit 5a019b7

Browse files
deps: bump ibc-proto-rs to v0.38.0 + some other dependency upgrades (#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]>
1 parent 26be5da commit 5a019b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+162
-124
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Bump `ibc-proto-rs` to v0.38.0
2+
([\#949](https://github.com/cosmos/ibc-rs/issues/949))

ci/cw-check/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ci/no-std-check/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ci/no-std-check/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ resolver = "2"
66

77
[dependencies]
88
ibc = { path = "../../crates/ibc", default-features = false, features = ["serde"] }
9-
ibc-proto = { version = "0.37.1", default-features = false, features = [
9+
ibc-proto = { version = "0.38.0", default-features = false, features = [
1010
"parity-scale-codec",
1111
"borsh",
1212
"serde",
@@ -15,10 +15,10 @@ tendermint = { version = "0.34", default-features = false }
1515
tendermint-proto = { version = "0.34", default-features = false }
1616
tendermint-light-client-verifier = { version = "0.34", default-features = false, features = ["rust-crypto"] }
1717

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

2323
# The indirect dependency `syn` 2.0.4 has a bug that causes
2424
# compilation errors in `tendermint`. This is fixed in 2.0.5.

crates/ibc-derive/src/consensus_state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub fn consensus_state_derive_impl(ast: DeriveInput) -> TokenStream {
3636
}
3737
}
3838

39-
fn encode_vec(&self) -> Vec<u8> {
39+
fn encode_vec(self) -> Vec<u8> {
4040
match self {
4141
#(#encode_vec_impl),*
4242
}

crates/ibc-query/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ std = ["ibc-proto/std", "ibc/std"]
1919

2020
[dependencies]
2121
ibc = { version = "0.47.0", path = "../ibc", default-features = false }
22-
ibc-proto = { version = "0.37.1", default-features = false, features = ["server"] }
22+
ibc-proto = { version = "0.38.0", default-features = false, features = ["server"] }
2323
displaydoc = { version = "0.2", default-features = false }
2424
tonic = "0.10"

crates/ibc/Cargo.toml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,34 +50,34 @@ mocks = ["tendermint-testgen", "parking_lot", "typed-builder", "std"]
5050

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

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

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

80-
schemars = { version = "0.8.12", optional = true }
80+
schemars = { version = "0.8.15", optional = true }
8181

8282
[dependencies.tendermint]
8383
version = "0.34"
@@ -99,8 +99,8 @@ default-features = false
9999

100100
[dev-dependencies]
101101
env_logger = "0.10.0"
102-
rstest = "0.18.1"
103-
tracing-subscriber = { version = "0.3.14", features = ["fmt", "env-filter", "json"]}
104-
test-log = { version = "0.2.10", features = ["trace"] }
102+
rstest = "0.18.2"
103+
tracing-subscriber = { version = "0.3.17", features = ["fmt", "env-filter", "json"]}
104+
test-log = { version = "0.2.13", features = ["trace"] }
105105
tendermint-rpc = { version = "0.34", features = ["http-client", "websocket-client"] }
106106
ibc = { path = ".", features = ["mocks"] }

crates/ibc/src/applications/transfer/error.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use core::convert::Infallible;
44
use core::str::Utf8Error;
55

66
use displaydoc::Display;
7-
use ibc_proto::protobuf::Error as TendermintProtoError;
87
use uint::FromDecStrErr;
98

109
use crate::core::ics04_channel::acknowledgement::StatusValue;
@@ -64,8 +63,8 @@ pub enum TokenTransferError {
6463
port_id: PortId,
6564
exp_port_id: PortId,
6665
},
67-
/// decoding raw msg error: `{0}`
68-
DecodeRawMsg(TendermintProtoError),
66+
/// decoding raw msg error: `{reason}`
67+
DecodeRawMsg { reason: String },
6968
/// unknown msg type: `{msg_type}`
7069
UnknownMsgType { msg_type: String },
7170
/// invalid coin string: `{coin}`
@@ -89,7 +88,6 @@ impl std::error::Error for TokenTransferError {
8988
..
9089
} => Some(e),
9190
Self::InvalidAmount(e) => Some(e),
92-
Self::DecodeRawMsg(e) => Some(e),
9391
Self::Utf8Decode(e) => Some(e),
9492
_ => None,
9593
}

crates/ibc/src/applications/transfer/msgs/transfer.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use ibc_proto::google::protobuf::Any;
44
use ibc_proto::ibc::applications::transfer::v1::MsgTransfer as RawMsgTransfer;
5-
use ibc_proto::protobuf::Protobuf;
5+
use ibc_proto::Protobuf;
66

77
use crate::applications::transfer::error::TokenTransferError;
88
use crate::applications::transfer::packet::PacketData;
@@ -115,7 +115,9 @@ impl TryFrom<Any> for MsgTransfer {
115115
fn try_from(raw: Any) -> Result<Self, Self::Error> {
116116
match raw.type_url.as_str() {
117117
TYPE_URL => {
118-
MsgTransfer::decode_vec(&raw.value).map_err(TokenTransferError::DecodeRawMsg)
118+
MsgTransfer::decode_vec(&raw.value).map_err(|e| TokenTransferError::DecodeRawMsg {
119+
reason: e.to_string(),
120+
})
119121
}
120122
_ => Err(TokenTransferError::UnknownMsgType {
121123
msg_type: raw.type_url,

crates/ibc/src/clients/ics07_tendermint/client_state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use ibc_proto::google::protobuf::Any;
1313
use ibc_proto::ibc::core::client::v1::Height as RawHeight;
1414
use ibc_proto::ibc::core::commitment::v1::MerkleProof as RawMerkleProof;
1515
use ibc_proto::ibc::lightclients::tendermint::v1::ClientState as RawTmClientState;
16-
use ibc_proto::protobuf::Protobuf;
16+
use ibc_proto::Protobuf;
1717
use prost::Message;
1818
use tendermint::chain::id::MAX_LENGTH as MaxChainIdLen;
1919
use tendermint::trust_threshold::TrustThresholdFraction as TendermintTrustThresholdFraction;
@@ -770,7 +770,7 @@ impl From<ClientState> for Any {
770770
fn from(client_state: ClientState) -> Self {
771771
Any {
772772
type_url: TENDERMINT_CLIENT_STATE_TYPE_URL.to_string(),
773-
value: Protobuf::<RawTmClientState>::encode_vec(&client_state),
773+
value: Protobuf::<RawTmClientState>::encode_vec(client_state),
774774
}
775775
}
776776
}

crates/ibc/src/clients/ics07_tendermint/consensus_state.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use ibc_proto::google::protobuf::Any;
44
use ibc_proto::ibc::lightclients::tendermint::v1::ConsensusState as RawConsensusState;
5-
use ibc_proto::protobuf::Protobuf;
5+
use ibc_proto::Protobuf;
66
use tendermint::hash::Algorithm;
77
use tendermint::time::Time;
88
use tendermint::Hash;
@@ -126,7 +126,7 @@ impl From<ConsensusState> for Any {
126126
fn from(consensus_state: ConsensusState) -> Self {
127127
Any {
128128
type_url: TENDERMINT_CONSENSUS_STATE_TYPE_URL.to_string(),
129-
value: Protobuf::<RawConsensusState>::encode_vec(&consensus_state),
129+
value: Protobuf::<RawConsensusState>::encode_vec(consensus_state),
130130
}
131131
}
132132
}
@@ -156,7 +156,7 @@ impl ConsensusStateTrait for ConsensusState {
156156
self.timestamp.into()
157157
}
158158

159-
fn encode_vec(&self) -> Vec<u8> {
159+
fn encode_vec(self) -> Vec<u8> {
160160
<Self as Protobuf<Any>>::encode_vec(self)
161161
}
162162
}

crates/ibc/src/clients/ics07_tendermint/header.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use core::str::FromStr;
77
use bytes::Buf;
88
use ibc_proto::google::protobuf::Any;
99
use ibc_proto::ibc::lightclients::tendermint::v1::Header as RawHeader;
10-
use ibc_proto::protobuf::Protobuf;
10+
use ibc_proto::Protobuf;
1111
use pretty::{PrettySignedHeader, PrettyValidatorSet};
1212
use prost::Message;
1313
use tendermint::block::signed_header::SignedHeader;
@@ -186,7 +186,7 @@ impl From<Header> for Any {
186186
fn from(header: Header) -> Self {
187187
Any {
188188
type_url: TENDERMINT_HEADER_TYPE_URL.to_string(),
189-
value: Protobuf::<RawHeader>::encode_vec(&header),
189+
value: Protobuf::<RawHeader>::encode_vec(header),
190190
}
191191
}
192192
}

crates/ibc/src/clients/ics07_tendermint/misbehaviour.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use bytes::Buf;
44
use ibc_proto::google::protobuf::Any;
55
use ibc_proto::ibc::lightclients::tendermint::v1::Misbehaviour as RawMisbehaviour;
6-
use ibc_proto::protobuf::Protobuf;
6+
use ibc_proto::Protobuf;
77
use prost::Message;
88

99
use crate::clients::ics07_tendermint::error::Error;
@@ -135,7 +135,7 @@ impl From<Misbehaviour> for Any {
135135
fn from(misbehaviour: Misbehaviour) -> Self {
136136
Any {
137137
type_url: TENDERMINT_MISBEHAVIOUR_TYPE_URL.to_string(),
138-
value: Protobuf::<RawMisbehaviour>::encode_vec(&misbehaviour),
138+
value: Protobuf::<RawMisbehaviour>::encode_vec(misbehaviour),
139139
}
140140
}
141141
}

crates/ibc/src/clients/ics07_tendermint/trust_threshold.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use core::convert::TryFrom;
66
use core::fmt::{Display, Error as FmtError, Formatter};
77

88
use ibc_proto::ibc::lightclients::tendermint::v1::Fraction;
9-
use ibc_proto::protobuf::Protobuf;
9+
use ibc_proto::Protobuf;
1010
use tendermint::trust_threshold::TrustThresholdFraction;
1111

1212
use crate::core::ics02_client::error::ClientError;

crates/ibc/src/core/context.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ pub enum RouterError {
6565
ContextError(ContextError),
6666
/// unknown type URL `{url}`
6767
UnknownMessageTypeUrl { url: String },
68-
/// the message is malformed and cannot be decoded error: `{0}`
69-
MalformedMessageBytes(ibc_proto::protobuf::Error),
68+
/// the message is malformed and cannot be decoded error: `{reason}`
69+
MalformedMessageBytes { reason: String },
7070
/// port `{port_id}` is unknown
7171
UnknownPort { port_id: PortId },
7272
/// module not found
@@ -84,7 +84,6 @@ impl std::error::Error for RouterError {
8484
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
8585
match &self {
8686
Self::ContextError(e) => Some(e),
87-
Self::MalformedMessageBytes(e) => Some(e),
8887
_ => None,
8988
}
9089
}

crates/ibc/src/core/ics02_client/consensus_state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ pub trait ConsensusState: Send + Sync {
2424
/// Serializes the `ConsensusState`. This is expected to be implemented as
2525
/// first converting to the raw type (i.e. the protobuf definition), and then
2626
/// serializing that.
27-
fn encode_vec(&self) -> Vec<u8>;
27+
fn encode_vec(self) -> Vec<u8>;
2828
}

crates/ibc/src/core/ics02_client/error.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! Defines the client error type
22
33
use displaydoc::Display;
4-
use ibc_proto::protobuf::Error as TendermintProtoError;
54

65
use super::client_state::Status;
76
use crate::core::ics02_client::client_type::ClientType;
@@ -65,8 +64,8 @@ pub enum ClientError {
6564
Decode(prost::DecodeError),
6665
/// invalid client identifier error: `{0}`
6766
InvalidClientIdentifier(IdentifierError),
68-
/// invalid raw header error: `{0}`
69-
InvalidRawHeader(TendermintProtoError),
67+
/// invalid raw header error: `{reason}`
68+
InvalidRawHeader { reason: String },
7069
/// missing raw client message
7170
MissingClientMessage,
7271
/// invalid raw misbehaviour error: `{0}`
@@ -140,7 +139,6 @@ impl std::error::Error for ClientError {
140139
} => Some(e),
141140
Self::InvalidMsgUpdateClientId(e) => Some(e),
142141
Self::InvalidClientIdentifier(e) => Some(e),
143-
Self::InvalidRawHeader(e) => Some(e),
144142
Self::InvalidRawMisbehaviour(e) => Some(e),
145143
Self::InvalidCommitmentProof(e) => Some(e),
146144
Self::InvalidPacketTimestamp(e) => Some(e),

crates/ibc/src/core/ics02_client/height.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use core::str::FromStr;
66

77
use displaydoc::Display;
88
use ibc_proto::ibc::core::client::v1::Height as RawHeight;
9-
use ibc_proto::protobuf::Protobuf;
9+
use ibc_proto::Protobuf;
1010

1111
use crate::core::ics02_client::error::ClientError;
1212
use crate::prelude::*;

crates/ibc/src/core/ics02_client/msgs/create_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use ibc_proto::google::protobuf::Any;
44
use ibc_proto::ibc::core::client::v1::MsgCreateClient as RawMsgCreateClient;
5-
use ibc_proto::protobuf::Protobuf;
5+
use ibc_proto::Protobuf;
66

77
use crate::core::ics02_client::error::ClientError;
88
use crate::core::Msg;

crates/ibc/src/core/ics02_client/msgs/misbehaviour.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use ibc_proto::google::protobuf::Any as ProtoAny;
44
use ibc_proto::ibc::core::client::v1::MsgSubmitMisbehaviour as RawMsgSubmitMisbehaviour;
5-
use ibc_proto::protobuf::Protobuf;
5+
use ibc_proto::Protobuf;
66

77
use crate::core::ics02_client::error::ClientError;
88
use crate::core::ics24_host::identifier::ClientId;

crates/ibc/src/core/ics02_client/msgs/update_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use ibc_proto::google::protobuf::Any;
44
use ibc_proto::ibc::core::client::v1::MsgUpdateClient as RawMsgUpdateClient;
5-
use ibc_proto::protobuf::Protobuf;
5+
use ibc_proto::Protobuf;
66

77
use crate::core::ics02_client::error::ClientError;
88
use crate::core::ics24_host::identifier::ClientId;

crates/ibc/src/core/ics02_client/msgs/upgrade_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use core::str::FromStr;
44

55
use ibc_proto::google::protobuf::Any;
66
use ibc_proto::ibc::core::client::v1::MsgUpgradeClient as RawMsgUpgradeClient;
7-
use ibc_proto::protobuf::Protobuf;
7+
use ibc_proto::Protobuf;
88

99
use crate::core::ics02_client::error::{ClientError, UpgradeClientError};
1010
use crate::core::ics23_commitment::commitment::CommitmentProofBytes;

crates/ibc/src/core/ics03_connection/connection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use ibc_proto::ibc::core::connection::v1::{
88
ConnectionEnd as RawConnectionEnd, Counterparty as RawCounterparty,
99
IdentifiedConnection as RawIdentifiedConnection,
1010
};
11-
use ibc_proto::protobuf::Protobuf;
11+
use ibc_proto::Protobuf;
1212

1313
use crate::core::ics02_client::error::ClientError;
1414
use crate::core::ics03_connection::error::ConnectionError;

crates/ibc/src/core/ics03_connection/error.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
use alloc::string::String;
44

55
use displaydoc::Display;
6-
use ibc_proto::protobuf::Error as ProtoError;
76

87
use crate::core::ics02_client::error as client_error;
98
use crate::core::ics03_connection::version::Version;
@@ -17,8 +16,6 @@ pub enum ConnectionError {
1716
Client(client_error::ClientError),
1817
/// invalid connection state: expected `{expected}`, actual `{actual}`
1918
InvalidState { expected: String, actual: String },
20-
/// invalid connection end error: `{0}`
21-
InvalidConnectionEnd(ProtoError),
2219
/// consensus height claimed by the client on the other party is too advanced: `{target_height}` (host chain current height: `{current_height}`)
2320
InvalidConsensusHeight {
2421
target_height: Height,

crates/ibc/src/core/ics03_connection/handler/conn_open_ack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Protocol logic specific to processing ICS3 messages of type `MsgConnectionOpenAck`.
22
3-
use ibc_proto::protobuf::Protobuf;
3+
use ibc_proto::Protobuf;
44
use prost::Message;
55

66
use crate::core::context::ContextError;

0 commit comments

Comments
 (0)