diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index dbdd309dfe..0b6b60bc41 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -45,7 +45,7 @@ jobs: fail-fast: false matrix: chain: - - package: gaia11 + - package: gaia12 command: gaiad account_prefix: cosmos - package: ibc-go-v4-simapp @@ -249,7 +249,7 @@ jobs: fail-fast: false matrix: chain: - - package: gaia11 + - package: gaia12 command: gaiad account_prefix: cosmos - package: juno @@ -295,7 +295,7 @@ jobs: fail-fast: false matrix: chain: - - package: .#gaia11 .#stride-no-admin + - package: .#gaia12 .#stride-no-admin command: gaiad,strided account_prefix: cosmos,stride steps: @@ -382,7 +382,7 @@ jobs: fail-fast: false matrix: chain: - - package: gaia11 + - package: gaia12 command: gaiad account_prefix: cosmos steps: @@ -458,7 +458,7 @@ jobs: CHAIN_COMMAND_PATHS: gaiad,${{ matrix.chain.command }} ACCOUNT_PREFIXES: cosmos,${{ matrix.chain.account_prefix }} run: | - nix shell .#gaia11 .#${{ matrix.chain.package }} -c \ + nix shell .#gaia12 .#${{ matrix.chain.package }} -c \ cargo nextest run -p ibc-integration-test --no-fail-fast --failure-output final --test-threads=2 \ --features interchain-security interchain_security:: @@ -501,7 +501,7 @@ jobs: CHAIN_COMMAND_PATHS: gaiad,${{ matrix.chain.command }} ACCOUNT_PREFIXES: cosmos,${{ matrix.chain.account_prefix }} run: | - nix shell .#gaia11 .#${{ matrix.chain.package }} -c \ + nix shell .#gaia12 .#${{ matrix.chain.package }} -c \ cargo nextest run -p ibc-integration-test --no-fail-fast --failure-output final --test-threads=2 \ --features interchain-security,ica interchain_security:: @@ -543,7 +543,7 @@ jobs: CHAIN_COMMAND_PATHS: gaiad,${{ matrix.chain.command }} ACCOUNT_PREFIXES: cosmos,${{ matrix.chain.account_prefix }} run: | - nix shell .#gaia11 .#${{ matrix.chain.package }} -c \ + nix shell .#gaia12 .#${{ matrix.chain.package }} -c \ cargo nextest run -p ibc-integration-test --no-fail-fast --failure-output final --test-threads=2 \ --features interchain-security,ics31 interchain_security:: diff --git a/.github/workflows/misbehaviour.yml b/.github/workflows/misbehaviour.yml index ec4efd417b..8a4c4c819f 100644 --- a/.github/workflows/misbehaviour.yml +++ b/.github/workflows/misbehaviour.yml @@ -43,7 +43,7 @@ jobs: fail-fast: false matrix: chain: - - package: gaia11 + - package: gaia12 command: gaiad account_prefix: cosmos steps: diff --git a/.github/workflows/multi-chains.yaml b/.github/workflows/multi-chains.yaml index 590f004ede..8aab31647d 100644 --- a/.github/workflows/multi-chains.yaml +++ b/.github/workflows/multi-chains.yaml @@ -58,7 +58,7 @@ jobs: fail-fast: false matrix: first-package: - - package: gaia11 + - package: gaia12 command: gaiad account_prefix: cosmos - package: ibc-go-v7-simapp diff --git a/crates/relayer-cli/src/commands/tx/client.rs b/crates/relayer-cli/src/commands/tx/client.rs index 3cb2f51812..e528e0a4bc 100644 --- a/crates/relayer-cli/src/commands/tx/client.rs +++ b/crates/relayer-cli/src/commands/tx/client.rs @@ -435,9 +435,9 @@ impl Runnable for TxUpgradeClientsCmd { .chains .iter() .filter(|&chain| { - (self.reference_chain_id != chain.id + self.reference_chain_id != chain.id && (self.host_chain_id.is_none() - || self.host_chain_id == Some(chain.id.clone()))) + || self.host_chain_id == Some(chain.id.clone())) }) .map(|chain| { self.upgrade_clients_for_chain( diff --git a/flake.lock b/flake.lock index 025f90c08e..6c1750e11d 100644 --- a/flake.lock +++ b/flake.lock @@ -82,6 +82,7 @@ "gaia-main-src": "gaia-main-src", "gaia10-src": "gaia10-src", "gaia11-src": "gaia11-src", + "gaia12-src": "gaia12-src", "gaia5-src": "gaia5-src", "gaia6-ordered-src": "gaia6-ordered-src", "gaia6-src": "gaia6-src", @@ -96,6 +97,8 @@ "ibc-go-v5-src": "ibc-go-v5-src", "ibc-go-v6-src": "ibc-go-v6-src", "ibc-go-v7-src": "ibc-go-v7-src", + "ibc-go-v8-channel-upgrade-src": "ibc-go-v8-channel-upgrade-src", + "ibc-go-v8-src": "ibc-go-v8-src", "ibc-rs-src": "ibc-rs-src", "ica-src": "ica-src", "ignite-cli-src": "ignite-cli-src", @@ -108,9 +111,6 @@ "nix-std": "nix-std", "nixpkgs": "nixpkgs", "osmosis-src": "osmosis-src", - "osmosis6-src": "osmosis6-src", - "osmosis7-src": "osmosis7-src", - "osmosis8-src": "osmosis8-src", "pre-commit-hooks": "pre-commit-hooks", "regen-src": "regen-src", "relayer-src": "relayer-src", @@ -123,7 +123,6 @@ "stoml-src": "stoml-src", "stride-consumer-src": "stride-consumer-src", "stride-src": "stride-src", - "terra-src": "terra-src", "ts-relayer-src": "ts-relayer-src", "umee-src": "umee-src", "wasmd-src": "wasmd-src", @@ -137,11 +136,11 @@ "wasmvm_1_beta7-src": "wasmvm_1_beta7-src" }, "locked": { - "lastModified": 1692348031, - "narHash": "sha256-x61SMPGH/giVKwHJ61SI4I09VFrs21/f8jriCSL+Vf8=", + "lastModified": 1697035289, + "narHash": "sha256-2yPPi/n4IrKZ0Y0BwPSmHGP5UJoY5u5XY6BnKxsuGnc=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "1df7d2191ae20b792d64dfc9830c657ef85eaaeb", + "rev": "e26774d7889a508ad3ac021a886bc6b8cf11cf7e", "type": "github" }, "original": { @@ -235,12 +234,15 @@ } }, "flake-utils": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1649676176, - "narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=", + "lastModified": 1692792214, + "narHash": "sha256-voZDQOvqHsaReipVd3zTKSBwN7LZcUwi3/ThMxRZToU=", "owner": "numtide", "repo": "flake-utils", - "rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678", + "rev": "1721b3e7c882f75f2301b00d48a2884af8c448ae", "type": "github" }, "original": { @@ -251,7 +253,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems" + "systems": "systems_2" }, "locked": { "lastModified": 1681202837, @@ -268,15 +270,30 @@ } }, "flake-utils_3": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_4": { "inputs": { - "systems": "systems_2" + "systems": "systems_3" }, "locked": { - "lastModified": 1689068808, - "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "owner": "numtide", "repo": "flake-utils", - "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "type": "github" }, "original": { @@ -288,11 +305,11 @@ "gaia-main-src": { "flake": false, "locked": { - "lastModified": 1664958609, - "narHash": "sha256-w9tJJXimf0AhYhgColCjdHGh14sAId0Svtz/hHNYNlI=", + "lastModified": 1692777545, + "narHash": "sha256-Gg6pqITR+aqq4FBE0h/HvXpG+whtli2gJXw+dsyoKEE=", "owner": "cosmos", "repo": "gaia", - "rev": "4d3a104f6ce6f441e6588cdb8fa6e600396ad3ac", + "rev": "97d0a1359716c5c534053a6a15a007b740d34780", "type": "github" }, "original": { @@ -335,6 +352,23 @@ "type": "github" } }, + "gaia12-src": { + "flake": false, + "locked": { + "lastModified": 1692870038, + "narHash": "sha256-KqpkazhGGQWzvHiiwCiE7ciA8+L2t2HgxN8270zuGd0=", + "owner": "cosmos", + "repo": "gaia", + "rev": "6f8067d76ce30996f83645862153ccfaf5f13dd1", + "type": "github" + }, + "original": { + "owner": "cosmos", + "ref": "v12.0.0", + "repo": "gaia", + "type": "github" + } + }, "gaia5-src": { "flake": false, "locked": { @@ -581,16 +615,50 @@ "ibc-go-v7-src": { "flake": false, "locked": { - "lastModified": 1687464721, - "narHash": "sha256-UsCzjLKyedW2h3PQDNUNNL7KZiD23MM6kPQSnKS8FNs=", + "lastModified": 1693509694, + "narHash": "sha256-umh/ckDALt0ugXwN8glcaCkGfAQvXY7S3Jd95Do2XeA=", + "owner": "cosmos", + "repo": "ibc-go", + "rev": "c75650a1a037a9fecba5a9005df380f707520ff7", + "type": "github" + }, + "original": { + "owner": "cosmos", + "ref": "v7.3.0", + "repo": "ibc-go", + "type": "github" + } + }, + "ibc-go-v8-channel-upgrade-src": { + "flake": false, + "locked": { + "lastModified": 1695726576, + "narHash": "sha256-mM6h1KAi8lQUrJakxI6f8WI+vpmBhCnAysk3hTZBI7M=", "owner": "cosmos", "repo": "ibc-go", - "rev": "d02ab9db8fc80eb5e55041d3d6416370c33441f7", + "rev": "63c30108f0ecf954108cf51f50f3d36ec58c7e51", "type": "github" }, "original": { "owner": "cosmos", - "ref": "v7.2.0", + "ref": "04-channel-upgrades-alpha.0", + "repo": "ibc-go", + "type": "github" + } + }, + "ibc-go-v8-src": { + "flake": false, + "locked": { + "lastModified": 1695930850, + "narHash": "sha256-BHmsnnqB+SoS8UdfGbEk07EXGZJG9ELo4+2gAbP8LdM=", + "owner": "cosmos", + "repo": "ibc-go", + "rev": "9c7212198d0ef82b8219ea66cee9c96b40e7981d", + "type": "github" + }, + "original": { + "owner": "cosmos", + "ref": "v8.0.0-beta.1", "repo": "ibc-go", "type": "github" } @@ -615,11 +683,11 @@ "ica-src": { "flake": false, "locked": { - "lastModified": 1647255020, - "narHash": "sha256-Ah5pivnAmk3W0fLWnrBbi84tqwJYQETSILSvNVH6fI8=", + "lastModified": 1679480012, + "narHash": "sha256-LFyInZT7z/8/d3RYepYf95ryxA7Pbg3TMQhHrHUvlCA=", "owner": "cosmos", "repo": "interchain-accounts-demo", - "rev": "09b6a493a84a135f395d74d5ec82ea983617a714", + "rev": "fe07f304731161055cecec120e0d2de01e84bad4", "type": "github" }, "original": { @@ -749,11 +817,11 @@ }, "nix-std": { "locked": { - "lastModified": 1658944356, - "narHash": "sha256-+nBrRSPsDIjrmLfLdiB/a22Gj4bhEF53ubWN0z33NJo=", + "lastModified": 1685917625, + "narHash": "sha256-2manVKofCZrCToVDnDYNvtYUFBYOM5JhdDoNGVY4fq4=", "owner": "chessai", "repo": "nix-std", - "rev": "9500903a19ef2720469578de0e10ce9e66623bdf", + "rev": "e20af8822b5739434b875643bfc61fe0195ea2fb", "type": "github" }, "original": { @@ -764,11 +832,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1673947312, - "narHash": "sha256-xx/2nRwRy3bXrtry6TtydKpJpqHahjuDB5sFkQ/XNDE=", + "lastModified": 1692684269, + "narHash": "sha256-zJk2pyF4Cuhtor0khtPlf+hfJIh22rzAUC+KU3Ob31Q=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2d38b664b4400335086a713a0036aafaa002c003", + "rev": "9d757ec498666cc1dcc6f2be26db4fd3e1e9ab37", "type": "github" }, "original": { @@ -780,16 +848,16 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1673800717, - "narHash": "sha256-SFHraUqLSu5cC6IxTprex/nTsI81ZQAtDvlBvGDWfnA=", + "lastModified": 1685801374, + "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2f9fd351ec37f5d479556cd48be4ca340da59b8f", + "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-22.11", + "ref": "nixos-23.05", "repo": "nixpkgs", "type": "github" } @@ -812,84 +880,49 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1692311226, - "narHash": "sha256-mRzNup0PIUD6YxbrYvjzL7f+1oaOGy9nmGCV3AZkQus=", - "owner": "nixos", + "lastModified": 1674990008, + "narHash": "sha256-4zOyp+hFW2Y7imxIpZqZGT8CEqKmDjwgfD6BzRUE0mQ=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "ef8288935ba859fc3b30632fa6e04705f81b9c2a", + "rev": "d2bbcbe6c626d339b25a4995711f07625b508214", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, - "osmosis-src": { - "flake": false, - "locked": { - "lastModified": 1689430935, - "narHash": "sha256-HTXFitKRuxSM6U2Sq7kgLxZhduPA+MofdWaISe//2kg=", - "owner": "osmosis-labs", - "repo": "osmosis", - "rev": "0dcae3392f23e44b8de436ff372c1373dc831b04", - "type": "github" - }, - "original": { - "owner": "osmosis-labs", - "ref": "v16.1.1", - "repo": "osmosis", - "type": "github" - } - }, - "osmosis6-src": { - "flake": false, + "nixpkgs_4": { "locked": { - "lastModified": 1646678581, - "narHash": "sha256-fGcz33PPA5dJ4J9vgfbYvBxNydu3/YuKSCf8pZkn5PM=", - "owner": "osmosis-labs", - "repo": "osmosis", - "rev": "2b61fd38505dbcbad08e78c96b7ab17e7ae1c85d", - "type": "github" - }, - "original": { - "owner": "osmosis-labs", - "ref": "v6.4.1", - "repo": "osmosis", - "type": "github" - } - }, - "osmosis7-src": { - "flake": false, - "locked": { - "lastModified": 1651600564, - "narHash": "sha256-aY6L+5Iw5tu/QOZ1ZgZq163MCy4ZZDHVl53MhZ8AyS4=", - "owner": "osmosis-labs", - "repo": "osmosis", - "rev": "ab02323b075e2573cd7a54736d705c88797d11c5", + "lastModified": 1696757521, + "narHash": "sha256-cfgtLNCBLFx2qOzRLI6DHfqTdfWI+UbvsKYa3b3fvaA=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2646b294a146df2781b1ca49092450e8a32814e1", "type": "github" }, "original": { - "owner": "osmosis-labs", - "ref": "v7.3.0", - "repo": "osmosis", + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", "type": "github" } }, - "osmosis8-src": { + "osmosis-src": { "flake": false, "locked": { - "lastModified": 1652595598, - "narHash": "sha256-upQzIJnzswT+HO6H0welw/X5n4F/K1k/dP4FQMOeC8Q=", + "lastModified": 1692886846, + "narHash": "sha256-VdM6hGqcDyCNx7AR8s7SxE3pEMxHiIhCJ7592sDp3uc=", "owner": "osmosis-labs", "repo": "osmosis", - "rev": "16e3b51f19a58f815a4eabcbcee11886eb33e026", + "rev": "1c5f25d04f19d6302e0bdd585ba1d7a2cc96e397", "type": "github" }, "original": { "owner": "osmosis-labs", - "ref": "v8.0.0", + "ref": "v18.0.0", "repo": "osmosis", "type": "github" } @@ -909,11 +942,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1674122161, - "narHash": "sha256-9QM4rvgUSEwO8DWtJN9sR/afEqrH1s3b6ACsZT5wiAM=", + "lastModified": 1692274144, + "narHash": "sha256-BxTQuRUANQ81u8DJznQyPmRsg63t4Yc+0kcyq6OLz8s=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "53e766957b73298fa68b47478c48cbcc005cc18a", + "rev": "7e3517c03d46159fdbf8c0e5c97f82d5d4b0c8fa", "type": "github" }, "original": { @@ -959,8 +992,8 @@ "root": { "inputs": { "cosmos-nix": "cosmos-nix", - "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_3" + "flake-utils": "flake-utils_4", + "nixpkgs": "nixpkgs_4" } }, "rust-overlay": { @@ -984,12 +1017,16 @@ } }, "sbt-derivation": { + "inputs": { + "flake-utils": "flake-utils_3", + "nixpkgs": "nixpkgs_3" + }, "locked": { - "lastModified": 1617466857, - "narHash": "sha256-Z7eWMLreLtiSiJ3nWDWBy1w9WNEFexkYCgT/dWZF7yo=", + "lastModified": 1675083208, + "narHash": "sha256-+sSFhSpV2jckr1qYlX/SaxQ6IdpagD6o4rru/3HAl0I=", "owner": "zaninime", "repo": "sbt-derivation", - "rev": "920b6f187937493371e2b1687261017e6e014cf1", + "rev": "92d6d6d825e3f6ae5642d1cce8ff571c3368aaf7", "type": "github" }, "original": { @@ -1001,11 +1038,11 @@ "sconfig-src": { "flake": false, "locked": { - "lastModified": 1594094862, - "narHash": "sha256-jR2hkR0YlPyW2nKWJl90kL80R+9psNKGPYxGg7Y/YGw=", + "lastModified": 1679585941, + "narHash": "sha256-ywh9IcqMWbRHqJkGJezcDCvfbBYNJH7ualKvPJQRcHA=", "owner": "freshautomations", "repo": "sconfig", - "rev": "88043754c024aec433b3b059af170b6f555931c3", + "rev": "41450b55f3b37b4b7a0fdf4a69c707619dbeb47c", "type": "github" }, "original": { @@ -1068,11 +1105,11 @@ "stoml-src": { "flake": false, "locked": { - "lastModified": 1622172633, - "narHash": "sha256-PvKkOjjWkmK90PzKcOBq0pUWLjHLjfYs9PRqqzAR7/8=", + "lastModified": 1666796497, + "narHash": "sha256-Adjag1/Hd2wrar2/anD6jQEMDvUc2TOIG7DlEgxpTXc=", "owner": "freshautomations", "repo": "stoml", - "rev": "f5dab84dbf52345a1f36389aec38b02fda086a47", + "rev": "4b2cd09b5795a54fddc215f0d24e24071894b3cf", "type": "github" }, "original": { @@ -1145,20 +1182,18 @@ "type": "github" } }, - "terra-src": { - "flake": false, + "systems_3": { "locked": { - "lastModified": 1645516218, - "narHash": "sha256-7cmVYWFLeOZJtbfw8qaVKLDMVafoeFDXOcrmrMS9buE=", - "owner": "terra-money", - "repo": "core", - "rev": "a6b93b72a7d4fabbbb85fb89e685426f5d07cac1", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { - "owner": "terra-money", - "ref": "v0.5.17", - "repo": "core", + "owner": "nix-systems", + "repo": "default", "type": "github" } }, @@ -1182,11 +1217,11 @@ "umee-src": { "flake": false, "locked": { - "lastModified": 1648176855, - "narHash": "sha256-s7MnAaM+O84JDO1uBNZm1qGN6ZfYmhXD5rCvns4u/rc=", + "lastModified": 1649261156, + "narHash": "sha256-hydRL/88fHCW/k7z7GoqAwvynZuvLEDLyA6A9Cm+6UY=", "owner": "umee-network", "repo": "umee", - "rev": "3c9b8db04d6ab19d31e89df65232abc35d1a8a59", + "rev": "42f57545251ce5337dcc5fe4309520ead89183b9", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 52005d9b06..7cadfe5970 100644 --- a/flake.nix +++ b/flake.nix @@ -28,7 +28,7 @@ inherit (cosmos-nix) gaia6-ordered - gaia11 + gaia12 osmosis wasmd ibc-go-v2-simapp diff --git a/tools/test-framework/src/chain/cli/provider.rs b/tools/test-framework/src/chain/cli/provider.rs index b4c44dd672..e7f0a15522 100644 --- a/tools/test-framework/src/chain/cli/provider.rs +++ b/tools/test-framework/src/chain/cli/provider.rs @@ -1,6 +1,7 @@ +use std::collections::HashMap; use std::str; -use crate::chain::exec::simple_exec; +use crate::chain::exec::{simple_exec, ExecOutput}; use crate::error::Error; pub fn submit_consumer_chain_proposal( @@ -11,6 +12,7 @@ pub fn submit_consumer_chain_proposal( ) -> Result<(), Error> { let proposal_file = format!("{}/consumer_proposal.json", home_path); + // The submission might fail silently if there is not enough gas simple_exec( chain_id, command_path, @@ -30,6 +32,8 @@ pub fn submit_consumer_chain_proposal( rpc_listen_address, "--keyring-backend", "test", + "--gas", + "2000000", "--yes", ], )?; @@ -37,12 +41,37 @@ pub fn submit_consumer_chain_proposal( Ok(()) } +pub fn query_consumer_proposal( + chain_id: &str, + command_path: &str, + home_path: &str, + rpc_listen_address: &str, +) -> Result { + simple_exec( + chain_id, + command_path, + &[ + "--home", + home_path, + "--node", + rpc_listen_address, + "query", + "gov", + "proposal", + "1", + "--output", + "json", + ], + ) +} + pub fn query_consumer_genesis( chain_id: &str, command_path: &str, home_path: &str, rpc_listen_address: &str, consumer_chain_id: &str, + consumer_command_path: &str, ) -> Result { let exec_output = simple_exec( chain_id, @@ -61,7 +90,19 @@ pub fn query_consumer_genesis( ], )?; - Ok(exec_output.stdout) + // Neutron does not have the `PreCCV` configuration in its genesis file, + // and will panic due to an unknown configuration if it is set + let consumer_genesis = if consumer_command_path == "neutrond" { + let mut queried_genesis: HashMap = + serde_json::from_str(&exec_output.stdout).expect("failed to read file"); + + queried_genesis.remove("preCCV"); + serde_json::to_string(&queried_genesis).unwrap() + } else { + exec_output.stdout + }; + + Ok(consumer_genesis) } pub fn replace_genesis_state(chain_id: &str, home_path: &str) -> Result { diff --git a/tools/test-framework/src/chain/ext/bootstrap.rs b/tools/test-framework/src/chain/ext/bootstrap.rs index 8e0dee8e35..72fc668e38 100644 --- a/tools/test-framework/src/chain/ext/bootstrap.rs +++ b/tools/test-framework/src/chain/ext/bootstrap.rs @@ -5,6 +5,7 @@ use serde_json as json; use std::fs; use std::path::PathBuf; use std::str; +use std::time::Duration; use toml; use tracing::debug; @@ -15,13 +16,14 @@ use crate::chain::cli::bootstrap::{ start_chain, }; use crate::chain::cli::provider::{ - copy_validator_key_pair, query_consumer_genesis, replace_genesis_state, - submit_consumer_chain_proposal, + copy_validator_key_pair, query_consumer_genesis, query_consumer_proposal, + replace_genesis_state, submit_consumer_chain_proposal, }; use crate::chain::driver::ChainDriver; use crate::chain::exec::simple_exec; use crate::error::{handle_generic_error, Error}; use crate::ibc::token::Token; +use crate::prelude::assert_eventually_succeed; use crate::types::process::ChildProcess; use crate::types::wallet::{Wallet, WalletAddress, WalletId}; @@ -107,6 +109,28 @@ pub trait ChainBootstrapMethodsExt { spawn_time: &str, ) -> Result<(), Error>; + /** + Assert that the consumer chain proposal is eventually submitted. + */ + fn assert_consumer_chain_proposal_submitted( + &self, + chain_id: &str, + command_path: &str, + home_path: &str, + rpc_listen_address: &str, + ) -> Result<(), Error>; + + /** + Assert that the consumer chain proposal eventually passes. + */ + fn assert_consumer_chain_proposal_passed( + &self, + chain_id: &str, + command_path: &str, + home_path: &str, + rpc_listen_address: &str, + ) -> Result<(), Error>; + /** Query a consumer chain's genesis. */ @@ -277,17 +301,19 @@ impl ChainBootstrapMethodsExt for ChainDriver { "description": "First consumer chain", "chain_id": "{consumer_chain_id}", "initial_height": { + "revision_number": 1, "revision_height": 1 }, "genesis_hash": "Z2VuX2hhc2g=", "binary_hash": "YmluX2hhc2g=", "spawn_time": "{spawn_time}", - "unbonding_period": 100000000000, - "ccv_timeout_period": 100000000000, - "transfer_timeout_period": 100000000000, - "consumer_redistribution_fraction": "0.75", "blocks_per_distribution_transmission": 10, + "consumer_redistribution_fraction": "0.75", + "distribution_transmission_channel": "", "historical_entries": 10000, + "transfer_timeout_period": 100000000000, + "ccv_timeout_period": 100000000000, + "unbonding_period": 100000000000, "deposit": "10000001stake" }"#; @@ -304,6 +330,71 @@ impl ChainBootstrapMethodsExt for ChainDriver { ) } + fn assert_consumer_chain_proposal_submitted( + &self, + chain_id: &str, + command_path: &str, + home_path: &str, + rpc_listen_address: &str, + ) -> Result<(), Error> { + assert_eventually_succeed( + "consumer chain proposal submitted", + 10, + Duration::from_secs(1), + || { + match query_consumer_proposal(chain_id, command_path, home_path, rpc_listen_address) { + Ok(exec_output) => { + let json_res = json::from_str::(&exec_output.stdout).map_err(handle_generic_error)?; + let proposal_status = json_res.get("status") + .ok_or_else(|| eyre!("expected `status` field"))? + .as_str() + .ok_or_else(|| eyre!("expected string field"))?; + if proposal_status == "PROPOSAL_STATUS_VOTING_PERIOD" { + Ok(()) + } else { + Err(Error::generic(eyre!("consumer chain proposal is not in voting period. Proposal status: {proposal_status}"))) + } + }, + Err(e) => Err(Error::generic(eyre!("Error querying the consumer chain proposal. Potential issues could be due to not using enough gas or the proposal submitted is invalid. Error: {e}"))), + } + }, + )?; + Ok(()) + } + + fn assert_consumer_chain_proposal_passed( + &self, + chain_id: &str, + command_path: &str, + home_path: &str, + rpc_listen_address: &str, + ) -> Result<(), Error> { + assert_eventually_succeed( + "consumer chain proposal passed", + 10, + Duration::from_secs(5), + || { + match query_consumer_proposal(chain_id, command_path, home_path, rpc_listen_address) { + Ok(exec_output) => { + let json_res = json::from_str::(&exec_output.stdout).map_err(handle_generic_error)?; + let proposal_status = json_res.get("status") + .ok_or_else(|| eyre!("expected `status` field"))? + .as_str() + .ok_or_else(|| eyre!("expected string field"))?; + + if proposal_status == "PROPOSAL_STATUS_PASSED" { + Ok(()) + } else { + Err(Error::generic(eyre!("consumer chain proposal has not passed. Proposal status: {proposal_status}"))) + } + }, + Err(e) => Err(Error::generic(eyre!("Error querying the consumer chain proposal. Potential issues could be due to not using enough gas or the proposal submitted is invalid. Error: {e}"))), + } + }, + )?; + Ok(()) + } + fn query_consumer_genesis( &self, consumer_chain_driver: &ChainDriver, @@ -315,6 +406,7 @@ impl ChainBootstrapMethodsExt for ChainDriver { &self.home_path, &self.rpc_listen_address(), consumer_chain_id, + &consumer_chain_driver.command_path, )?; consumer_chain_driver.write_file("config/consumer_genesis.json", &consumer_genesis)?; diff --git a/tools/test-framework/src/framework/binary/ics.rs b/tools/test-framework/src/framework/binary/ics.rs index 88959ec8ee..8287353872 100644 --- a/tools/test-framework/src/framework/binary/ics.rs +++ b/tools/test-framework/src/framework/binary/ics.rs @@ -1,6 +1,4 @@ use std::str::FromStr; -use std::thread; -use std::time::Duration; use crate::bootstrap::consumer::bootstrap_consumer_node; use crate::bootstrap::single::bootstrap_single_node; @@ -74,7 +72,14 @@ where .chain_driver .submit_consumer_chain_proposal(chain_id.as_str(), "2023-05-31T12:09:47.048227Z")?; - thread::sleep(Duration::from_secs(2)); + node_a + .chain_driver + .assert_consumer_chain_proposal_submitted( + node_a.chain_driver.chain_id.as_str(), + &node_a.chain_driver.command_path, + &node_a.chain_driver.home_path, + &node_a.chain_driver.rpc_listen_address(), + )?; vote_proposal( node_a.chain_driver.chain_id.as_str(), @@ -84,7 +89,12 @@ where "1200stake", )?; - thread::sleep(Duration::from_secs(30)); + node_a.chain_driver.assert_consumer_chain_proposal_passed( + node_a.chain_driver.chain_id.as_str(), + &node_a.chain_driver.command_path, + &node_a.chain_driver.home_path, + &node_a.chain_driver.rpc_listen_address(), + )?; let node_b = bootstrap_consumer_node( builder,