Skip to content

Commit

Permalink
Update ibc go simapp v8 used in CI (#4010)
Browse files Browse the repository at this point in the history
* Nix flake update

* Add changelog entry and fix typo in other changelog entries

* Fix test for closing ordered ICA channel on timeout by using non-legacy message

* Apply github suggestions

* Fix ICA channel upgrade test by registering with ordered channel configuration
  • Loading branch information
ljoss17 authored Jun 3, 2024
1 parent fc8376b commit b448aa6
Show file tree
Hide file tree
Showing 10 changed files with 127 additions and 42 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
- Update the version of Juno running the integraiton tests in the CI from `v17.1.1`
- Update the version of Juno running the integration tests in the CI from `v17.1.1`
to `v21.0.0` ([\#3959](https://github.com/informalsystems/hermes/issues/3959))
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
- Update the version of Migaloo Chain running the
integraiton tests in the CI from `v3.0.2` to `v4.1.3`
integration tests in the CI from `v3.0.2` to `v4.1.3`
([\#3960](https://github.com/informalsystems/hermes/issues/3960))
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
- Update the version of `wasmd` running the
integraiton tests in the CI from `v0.30.0` to `v0.50.0`
integration tests in the CI from `v0.30.0` to `v0.50.0`
([\#3961](https://github.com/informalsystems/hermes/issues/3961))
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Update the version of ibc-go simapp running the
integration tests in the CI from `v8.2.0` to `v8.3.1`
([\#4009](https://github.com/informalsystems/hermes/issues/4009))
2 changes: 1 addition & 1 deletion .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
command: simd
account_prefix: cosmos
native_token: stake
features: ica,ics29-fee,channel-upgrade
features: ica,ics29-fee,new-register-interchain-account,channel-upgrade
- package: wasmd
command: wasmd
account_prefix: wasm
Expand Down
20 changes: 10 additions & 10 deletions flake.lock

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

39 changes: 20 additions & 19 deletions tools/integration-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,29 @@ toml = { workspace = true }
tonic = { workspace = true, features = ["tls", "tls-roots"] }

[features]
default = []
example = []
manual = []
ordered = []
ica = []
ics29-fee = []
experimental = []
mbt = []
forward-packet = []
ics31 = []
clean-workers = []
fee-grant = []
channel-upgrade = []
interchain-security = []
celestia = []
async-icq = []
juno = []
dynamic-gas-fee = []
default = []
example = []
manual = []
ordered = []
ica = []
ics29-fee = []
experimental = []
mbt = []
forward-packet = []
ics31 = []
clean-workers = []
fee-grant = []
channel-upgrade = []
interchain-security = []
celestia = []
async-icq = []
juno = []
dynamic-gas-fee = []
new-register-interchain-account = []

[[bin]]
name = "test_setup_with_binary_channel"
doc = true
doc = true

[dev-dependencies]
tempfile = { workspace = true }
10 changes: 7 additions & 3 deletions tools/integration-test/src/tests/channel_upgrade/ica.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use ibc_relayer_types::tx_msg::Msg;
use ibc_test_framework::chain::config::{
add_allow_message_interchainaccounts, set_max_deposit_period, set_voting_period,
};
use ibc_test_framework::chain::ext::ica::register_interchain_account;
use ibc_test_framework::chain::ext::ica::register_ordered_interchain_account;
use ibc_test_framework::prelude::*;
use ibc_test_framework::relayer::channel::{
assert_eventually_channel_closed, assert_eventually_channel_established,
Expand Down Expand Up @@ -98,7 +98,11 @@ impl BinaryConnectionTest for ChannelUpgradeICACloseChannel {
// Register an interchain account on behalf of
// controller wallet `user1` where the counterparty chain is the interchain accounts host.
let (wallet, controller_channel_id, controller_port_id) =
register_interchain_account(&chains.node_a, chains.handle_a(), &connection)?;
register_ordered_interchain_account(
&chains.node_a,
chains.handle_a(),
&connection,
)?;

// Check that the corresponding ICA channel is eventually established.
let _counterparty_channel_id = assert_eventually_channel_established(
Expand Down Expand Up @@ -343,7 +347,7 @@ impl BinaryConnectionTest for ChannelUpgradeICAUnordered {
// Register an interchain account on behalf of
// controller wallet `user1` where the counterparty chain is the interchain accounts host.
let (wallet, controller_channel_id, controller_port_id) =
register_interchain_account(&chains.node_a, chains.handle_a(), &connection)?;
register_ordered_interchain_account(&chains.node_a, chains.handle_a(), &connection)?;

// Check that the corresponding ICA channel is eventually established.
let _counterparty_channel_id = assert_eventually_channel_established(
Expand Down
10 changes: 8 additions & 2 deletions tools/integration-test/src/tests/ica.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ use ibc_relayer_types::timestamp::Timestamp;
use ibc_relayer_types::tx_msg::Msg;

use ibc_test_framework::chain::{
config::add_allow_message_interchainaccounts, ext::ica::register_interchain_account,
config::add_allow_message_interchainaccounts,
ext::ica::{register_interchain_account, register_ordered_interchain_account},
};
use ibc_test_framework::prelude::*;
use ibc_test_framework::relayer::channel::{
Expand Down Expand Up @@ -46,6 +47,7 @@ fn test_ica_filter_deny() -> Result<(), Error> {
run_binary_connection_test(&IcaFilterTestDeny)
}

#[cfg(any(doc, feature = "new-register-interchain-account"))]
#[test]
fn test_ica_close_channel() -> Result<(), Error> {
run_binary_connection_test(&ICACloseChannelTest)
Expand Down Expand Up @@ -251,7 +253,11 @@ impl BinaryConnectionTest for ICACloseChannelTest {
// Register an interchain account on behalf of
// controller wallet `user1` where the counterparty chain is the interchain accounts host.
let (wallet, controller_channel_id, controller_port_id) =
register_interchain_account(&chains.node_a, chains.handle_a(), &connection)?;
register_ordered_interchain_account(
&chains.node_a,
chains.handle_a(),
&connection,
)?;

// Check that the corresponding ICA channel is eventually established.
let _counterparty_channel_id = assert_eventually_channel_established(
Expand Down
79 changes: 75 additions & 4 deletions tools/test-framework/src/chain/ext/ica.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
use serde_json::json;

use ibc_relayer::chain::tracking::TrackedMsgs;
use ibc_relayer_types::applications::ics27_ica::msgs::register::LegacyMsgRegisterInterchainAccount;
use ibc_relayer_types::applications::ics27_ica::msgs::register::{
LegacyMsgRegisterInterchainAccount, MsgRegisterInterchainAccount,
};
use ibc_relayer_types::core::ics04_channel::version::Version;
use ibc_relayer_types::events::IbcEvent;
use ibc_relayer_types::tx_msg::Msg;
Expand Down Expand Up @@ -75,11 +79,75 @@ pub fn register_interchain_account<Chain: ChainHandle, Counterparty: ChainHandle

let owner = handle.get_signer()?;

let version_str = format!("{{\"version\":\"ics27-1\",\"encoding\":\"proto3\",\"tx_type\":\"sdk_multi_msg\",\"controller_connection_id\":\"{}\",\"host_connection_id\":\"{}\"}}", connection.connection_id_a.0, connection.connection_id_b.0);
let version_obj = json!({
"version": "ics27-1",
"encoding": "proto3",
"tx_type": "sdk_multi_msg",
"controller_connection_id": connection.connection_id_a.0,
"host_connection_id": connection.connection_id_b.0
});

let msg = LegacyMsgRegisterInterchainAccount {
owner,
connection_id: connection.connection_id_a.0.clone(),
version: Version::new(version_str),
version: Version::new(version_obj.to_string()),
};

let msg_any = msg.to_any();

let tm = TrackedMsgs::new_static(vec![msg_any], "RegisterInterchainAccount");

let events = handle
.send_messages_and_wait_commit(tm)
.map_err(Error::relayer)?;

for event in events.iter() {
if let IbcEvent::OpenInitChannel(open_init) = &event.event {
let channel_id = open_init.channel_id
.clone()
.ok_or(())
.map_err(|_| Error::generic(eyre!("channel_id is empty in the event response after sending MsgRegisterInterchainAccount")))?;
return Ok((
wallet,
TaggedChannelId::new(channel_id),
TaggedPortId::new(open_init.port_id.clone()),
));
}
}

Err(Error::generic(eyre!("could not retrieve an OpenInitChannel event response after sending MsgRegisterInterchainAccount")))
}

#[allow(clippy::type_complexity)]
pub fn register_ordered_interchain_account<Chain: ChainHandle, Counterparty: ChainHandle>(
chain: &MonoTagged<Chain, FullNode>,
handle: &Chain,
connection: &ConnectedConnection<Chain, Counterparty>,
) -> Result<
(
MonoTagged<Chain, Wallet>,
TaggedChannelId<Chain, Counterparty>,
TaggedPortId<Chain, Counterparty>,
),
Error,
> {
let wallet = chain.wallets().relayer().cloned();

let owner = handle.get_signer()?;

let version_obj = json!({
"version": "ics27-1",
"encoding": "proto3",
"tx_type": "sdk_multi_msg",
"controller_connection_id": connection.connection_id_a.0,
"host_connection_id": connection.connection_id_b.0
});

let msg = MsgRegisterInterchainAccount {
owner,
connection_id: connection.connection_id_a.0.clone(),
version: Version::new(version_obj.to_string()),
ordering: Ordering::Ordered,
};

let msg_any = msg.to_any();
Expand All @@ -92,7 +160,10 @@ pub fn register_interchain_account<Chain: ChainHandle, Counterparty: ChainHandle

for event in events.iter() {
if let IbcEvent::OpenInitChannel(open_init) = &event.event {
let channel_id = open_init.channel_id.clone().ok_or(()).map_err(|_| Error::generic(eyre!("channel_id is empty in the event response after sending MsgRegisterInterchainAccount")))?;
let channel_id = open_init.channel_id
.clone()
.ok_or(())
.map_err(|_| Error::generic(eyre!("channel_id is empty in the event response after sending MsgRegisterInterchainAccount")))?;
return Ok((
wallet,
TaggedChannelId::new(channel_id),
Expand Down

0 comments on commit b448aa6

Please sign in to comment.