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 compatibility to IBC-Go v5 and Cosmos SDK v0.46 #2718

Merged
merged 3 commits into from
Oct 10, 2022
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 @@
- Bump compatibility with IBC-Go v5 and Cosmos SDK v0.46
([#2532](https://github.com/informalsystems/ibc-rs/issues/2532))
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ exclude = [
]

[patch.crates-io]
ibc-proto = { git = "https://github.com/cosmos/ibc-proto-rs", rev = "3fac7ce93c80126cc690d565c85be042e384b31c" }
ibc-proto = { git = "https://github.com/cosmos/ibc-proto-rs", rev = "65c050e3a20e3a1ef3c1247788b5013112e207d7" }
# tendermint = { git = "https://github.com/informalsystems/tendermint-rs", branch = "v0.23.x" }
# tendermint-rpc = { git = "https://github.com/informalsystems/tendermint-rs", branch = "v0.23.x" }
# tendermint-proto = { git = "https://github.com/informalsystems/tendermint-rs", branch = "v0.23.x" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ impl Protobuf<RawMsgConnectionOpenTry> for MsgConnectionOpenTry {}
impl TryFrom<RawMsgConnectionOpenTry> for MsgConnectionOpenTry {
type Error = Error;

#[allow(deprecated)]
fn try_from(msg: RawMsgConnectionOpenTry) -> Result<Self, Self::Error> {
let previous_connection_id = Some(msg.previous_connection_id)
.filter(|x| !x.is_empty())
Expand Down Expand Up @@ -125,6 +126,7 @@ impl TryFrom<RawMsgConnectionOpenTry> for MsgConnectionOpenTry {
}

impl From<MsgConnectionOpenTry> for RawMsgConnectionOpenTry {
#[allow(deprecated)]
fn from(ics_msg: MsgConnectionOpenTry) -> Self {
RawMsgConnectionOpenTry {
client_id: ics_msg.client_id.as_str().to_string(),
Expand Down Expand Up @@ -194,6 +196,7 @@ pub mod test_util {
/// `proof_height` represents the height, on the source chain, at which this chain produced the
/// proof. Parameter `consensus_height` represents the height of destination chain which a
/// client on the source chain stores.
#[allow(deprecated)]
pub fn get_dummy_raw_msg_conn_open_try(
proof_height: u64,
consensus_height: u64,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ impl Protobuf<RawMsgChannelOpenTry> for MsgChannelOpenTry {}
impl TryFrom<RawMsgChannelOpenTry> for MsgChannelOpenTry {
type Error = ChannelError;

#[allow(deprecated)]
fn try_from(raw_msg: RawMsgChannelOpenTry) -> Result<Self, Self::Error> {
let proofs = Proofs::new(
raw_msg
Expand Down Expand Up @@ -115,6 +116,7 @@ impl TryFrom<RawMsgChannelOpenTry> for MsgChannelOpenTry {
}

impl From<MsgChannelOpenTry> for RawMsgChannelOpenTry {
#[allow(deprecated)]
fn from(domain_msg: MsgChannelOpenTry) -> Self {
RawMsgChannelOpenTry {
port_id: domain_msg.port_id.to_string(),
Expand All @@ -141,6 +143,7 @@ pub mod test_util {
use ibc_proto::ibc::core::client::v1::Height;

/// Returns a dummy `RawMsgChannelOpenTry`, for testing only!
#[allow(deprecated)]
pub fn get_dummy_raw_msg_chan_open_try(proof_height: u64) -> RawMsgChannelOpenTry {
RawMsgChannelOpenTry {
port_id: PortId::default().to_string(),
Expand Down Expand Up @@ -168,6 +171,7 @@ mod tests {
use test_log::test;

#[test]
#[allow(deprecated)]
fn channel_open_try_from_raw() {
struct Test {
name: String,
Expand Down
4 changes: 2 additions & 2 deletions crates/relayer/src/chain/cosmos/compatibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use super::version;
/// # Note: Should be consistent with [features] guide page.
///
/// [features]: https://hermes.informal.systems/features.html
const SDK_MODULE_VERSION_REQ: &str = ">=0.41, <0.46";
const SDK_MODULE_VERSION_REQ: &str = ">=0.41, <0.47";

/// Specifies the IBC-go module version requirement.
/// At the moment, we support both chains with and without
Expand All @@ -20,7 +20,7 @@ const SDK_MODULE_VERSION_REQ: &str = ">=0.41, <0.46";
/// # Note: Should be consistent with [features] guide page.
///
/// [features]: https://hermes.informal.systems/features.html
const IBC_GO_MODULE_VERSION_REQ: &str = ">=1.1, <=3";
const IBC_GO_MODULE_VERSION_REQ: &str = ">=1.1, <=5";

#[derive(Error, Debug)]
pub enum Diagnostic {
Expand Down
3 changes: 3 additions & 0 deletions crates/relayer/src/chain/cosmos/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ fn auth_info_and_bytes(signer_info: SignerInfo, fee: Fee) -> Result<(AuthInfo, V
let auth_info = AuthInfo {
signer_infos: vec![signer_info],
fee: Some(fee),

// Since Cosmos SDK v0.46.0
tip: None,
};

// A protobuf serialization of a AuthInfo
Expand Down