From b448aa6480bde9c03e3e1fb821e10b5e24eb177a Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Mon, 3 Jun 2024 13:21:55 +0200 Subject: [PATCH] Update ibc go simapp v8 used in CI (#4010) * 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 --- .../3959-update-juno-to-v21.md | 2 +- .../3960-update-migaloo-to-v4.md | 2 +- .../3961-update-wasmd-to-v0-50.md | 2 +- .../4009-update-ibc-go-v8-ci.md | 3 + .github/workflows/integration.yaml | 2 +- flake.lock | 20 ++--- tools/integration-test/Cargo.toml | 39 ++++----- .../src/tests/channel_upgrade/ica.rs | 10 ++- tools/integration-test/src/tests/ica.rs | 10 ++- tools/test-framework/src/chain/ext/ica.rs | 79 ++++++++++++++++++- 10 files changed, 127 insertions(+), 42 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4009-update-ibc-go-v8-ci.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/3959-update-juno-to-v21.md b/.changelog/unreleased/improvements/ibc-integration-test/3959-update-juno-to-v21.md index 295947659d..17a9b17a68 100644 --- a/.changelog/unreleased/improvements/ibc-integration-test/3959-update-juno-to-v21.md +++ b/.changelog/unreleased/improvements/ibc-integration-test/3959-update-juno-to-v21.md @@ -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)) \ No newline at end of file diff --git a/.changelog/unreleased/improvements/ibc-integration-test/3960-update-migaloo-to-v4.md b/.changelog/unreleased/improvements/ibc-integration-test/3960-update-migaloo-to-v4.md index 3484257822..447e299663 100644 --- a/.changelog/unreleased/improvements/ibc-integration-test/3960-update-migaloo-to-v4.md +++ b/.changelog/unreleased/improvements/ibc-integration-test/3960-update-migaloo-to-v4.md @@ -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)) \ No newline at end of file diff --git a/.changelog/unreleased/improvements/ibc-integration-test/3961-update-wasmd-to-v0-50.md b/.changelog/unreleased/improvements/ibc-integration-test/3961-update-wasmd-to-v0-50.md index 40b8f62a0b..b1847636bd 100644 --- a/.changelog/unreleased/improvements/ibc-integration-test/3961-update-wasmd-to-v0-50.md +++ b/.changelog/unreleased/improvements/ibc-integration-test/3961-update-wasmd-to-v0-50.md @@ -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)) \ No newline at end of file diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4009-update-ibc-go-v8-ci.md b/.changelog/unreleased/improvements/ibc-integration-test/4009-update-ibc-go-v8-ci.md new file mode 100644 index 0000000000..ce8c7ee27e --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4009-update-ibc-go-v8-ci.md @@ -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)) \ No newline at end of file diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 65a2c9df70..8fc11af9bd 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -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 diff --git a/flake.lock b/flake.lock index 2d34b775ad..fbf9d60412 100644 --- a/flake.lock +++ b/flake.lock @@ -212,11 +212,11 @@ "wasmvm_1_beta7-src": "wasmvm_1_beta7-src" }, "locked": { - "lastModified": 1713771294, - "narHash": "sha256-vBfFaW06np8dtxq1lNmo2zA26/8kf82g2CMEhgyqxw4=", + "lastModified": 1717072229, + "narHash": "sha256-166ggriJPlTWZ/xR6YfbPd3kveJ6Hhj0BclEL0DzDYA=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "e68f2d5e7121c10e956fda7f6c0a564becd3a7e0", + "rev": "9a18b54abb037e832a6854f053e274a7ba367074", "type": "github" }, "original": { @@ -930,16 +930,16 @@ "ibc-go-v8-src": { "flake": false, "locked": { - "lastModified": 1712305073, - "narHash": "sha256-J/tuv2U6cW+y51gUi4aXzR39lJD/8J/36lf7h2242sU=", + "lastModified": 1716359952, + "narHash": "sha256-KTjyHwmXA/jgppDKRe85XfRmh8O7AHFKhDyyOb9VROU=", "owner": "cosmos", "repo": "ibc-go", - "rev": "a2f3d7a78d21641178043341de96c3ecf06fa47b", + "rev": "9b6567bf818198ded336490d5f2d89c9d42fd87b", "type": "github" }, "original": { "owner": "cosmos", - "ref": "v8.2.0", + "ref": "v8.3.1", "repo": "ibc-go", "type": "github" } @@ -1338,11 +1338,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1713687659, - "narHash": "sha256-Yd8KuOBpZ0Slau/NxFhMPJI0gBxeax0vq/FD0rqKwuQ=", + "lastModified": 1716977081, + "narHash": "sha256-pFe5jLeIPlKEln5n2h998d7cpzXFdbrBMRe3suz4K1o=", "owner": "nixos", "repo": "nixpkgs", - "rev": "f2d7a289c5a5ece8521dd082b81ac7e4a57c2c5c", + "rev": "ac82a513e55582291805d6f09d35b6d8b60637a1", "type": "github" }, "original": { diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index 826c5035fe..a9056faf4d 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -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 } diff --git a/tools/integration-test/src/tests/channel_upgrade/ica.rs b/tools/integration-test/src/tests/channel_upgrade/ica.rs index 8b738b6855..4b26c9d37b 100644 --- a/tools/integration-test/src/tests/channel_upgrade/ica.rs +++ b/tools/integration-test/src/tests/channel_upgrade/ica.rs @@ -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, @@ -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( @@ -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( diff --git a/tools/integration-test/src/tests/ica.rs b/tools/integration-test/src/tests/ica.rs index 7ed2ef38f0..a6b8427a89 100644 --- a/tools/integration-test/src/tests/ica.rs +++ b/tools/integration-test/src/tests/ica.rs @@ -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::{ @@ -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) @@ -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( diff --git a/tools/test-framework/src/chain/ext/ica.rs b/tools/test-framework/src/chain/ext/ica.rs index c54c252b43..b90b5bb881 100644 --- a/tools/test-framework/src/chain/ext/ica.rs +++ b/tools/test-framework/src/chain/ext/ica.rs @@ -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; @@ -75,11 +79,75 @@ pub fn register_interchain_account( + chain: &MonoTagged, + handle: &Chain, + connection: &ConnectedConnection, +) -> Result< + ( + MonoTagged, + TaggedChannelId, + TaggedPortId, + ), + 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(); @@ -92,7 +160,10 @@ pub fn register_interchain_account