diff --git a/integration_tests/configs/ibc_rly_evm.jsonnet b/integration_tests/configs/ibc_rly_evm.jsonnet index b7b673d082..ac77fde468 100644 --- a/integration_tests/configs/ibc_rly_evm.jsonnet +++ b/integration_tests/configs/ibc_rly_evm.jsonnet @@ -4,6 +4,7 @@ ibc { relayer+: { chains: [super.chains[0] { precompiled_contract_address: '0x0000000000000000000000000000000000000065', + json_rpc_address: 'http://127.0.0.1:26701', }] + super.chains[1:], }, } diff --git a/integration_tests/ibc_utils.py b/integration_tests/ibc_utils.py index a16e6ab6d0..e5593690ec 100644 --- a/integration_tests/ibc_utils.py +++ b/integration_tests/ibc_utils.py @@ -627,7 +627,7 @@ def check_channel_ready(): return False return state == target - wait_for_fn("channel ready", check_channel_ready) + wait_for_fn("channel ready", check_channel_ready, timeout=30) def get_next_channel(cli, connid): diff --git a/integration_tests/install_hermes.nix b/integration_tests/install_hermes.nix deleted file mode 100644 index 9d32d5ff09..0000000000 --- a/integration_tests/install_hermes.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ stdenv, fetchurl, lib }: -let - version = "v1.6.0"; - srcUrl = { - x86_64-linux = { - url = - "https://github.com/informalsystems/hermes/releases/download/${version}/hermes-${version}-x86_64-unknown-linux-gnu.tar.gz"; - sha256 = "sha256-INJ5jiIaa5CVa/0je7Fxtcpf0+E2j7WNT7rD3ACTqts="; - }; - x86_64-darwin = { - url = - "https://github.com/informalsystems/hermes/releases/download/${version}/hermes-${version}-x86_64-apple-darwin.tar.gz"; - sha256 = "sha256-Z1LGmM3PCJFyESqmbkf1rT4ORqtc1JIVzLqb22o8fZ8="; - }; - aarch64-darwin = { - url = - "https://github.com/informalsystems/hermes/releases/download/${version}/hermes-${version}-aarch64-apple-darwin.tar.gz"; - sha256 = "sha256-xzqEu5OlG4jltmTYbO7LaRalSzdGLk7e5T9zUTheKps="; - }; - }.${stdenv.system} or (throw - "Unsupported system: ${stdenv.system}"); -in -stdenv.mkDerivation { - name = "hermes"; - inherit version; - src = fetchurl srcUrl; - sourceRoot = "."; - installPhase = '' - echo "installing hermes ..." - echo $out - mkdir -p $out/bin - install -m 755 -v -D * $out/bin - echo `env` - ''; - meta = with lib; { platforms = with platforms; linux ++ darwin; }; -} diff --git a/integration_tests/test_ibc_rly.py b/integration_tests/test_ibc_rly.py index 6d526a9858..d4ced56e3a 100644 --- a/integration_tests/test_ibc_rly.py +++ b/integration_tests/test_ibc_rly.py @@ -11,10 +11,10 @@ cronos_transfer_source_tokens, cronos_transfer_source_tokens_with_proxy, get_balance, + hermes_transfer, ibc_denom, ibc_incentivized_transfer, prepare_network, - rly_transfer, ) from .utils import ( ADDRS, @@ -53,7 +53,7 @@ def ibc(request, tmp_path_factory): yield from prepare_network( path, name, - relayer=cluster.Relayer.RLY.value, + relayer=cluster.Relayer.HERMES.value, ) @@ -229,7 +229,7 @@ def test_ibc(ibc): w3 = ibc.cronos.w3 wait_for_new_blocks(ibc.cronos.cosmos_cli(), 1) start = w3.eth.get_block_number() - rly_transfer(ibc) + hermes_transfer(ibc) denom = ibc_denom(channel, src_denom) dst_addr = eth_to_bech32(cronos_signer2) old_dst_balance = get_balance(ibc.cronos, dst_addr, dst_denom) diff --git a/nix/default.nix b/nix/default.nix index 82383bcb6f..99076c81df 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -40,7 +40,7 @@ import sources.nixpkgs { paths = with pkgs.openssl; [ out dev ]; }; }; - hermes = pkgs.callPackage ../integration_tests/install_hermes.nix { }; + hermes = pkgs.callPackage ./hermes.nix { src = sources.ibc-rs; }; }) (_: pkgs: { test-env = pkgs.callPackage ./testenv.nix { }; }) (_: pkgs: { diff --git a/nix/hermes.nix b/nix/hermes.nix new file mode 100644 index 0000000000..241285515d --- /dev/null +++ b/nix/hermes.nix @@ -0,0 +1,35 @@ +{ src +, lib +, stdenv +, darwin +, rustPlatform +, symlinkJoin +, openssl +, pkg-config +}: + +rustPlatform.buildRustPackage rec { + name = "hermes"; + inherit src; + cargoBuildFlags = "-p ibc-relayer-cli"; + buildInputs = lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.Security + pkg-config + openssl + darwin.libiconv + darwin.apple_sdk.frameworks.SystemConfiguration + ]; + cargoLock = { + lockFile = "${src}/Cargo.lock"; + outputHashes = { + "ibc-proto-0.38.0" = "sha256-UhpWBzraC6fMPJ0BVK6CxdrywoEayNq0tBU0N3MxmB4="; + }; + }; + doCheck = false; + RUSTFLAGS = "--cfg ossl111 --cfg ossl110 --cfg ossl101"; + OPENSSL_NO_VENDOR = "1"; + OPENSSL_DIR = symlinkJoin { + name = "openssl"; + paths = with openssl; [ out dev ]; + }; +} diff --git a/nix/sources.json b/nix/sources.json index fa853795ad..b30883c006 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -84,6 +84,18 @@ "url": "https://github.com/crypto-org-chain/gravity-bridge/archive/d984b1562242efab5d7595d4108472ed27eba06f.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, + "ibc-rs": { + "branch": "v1.7.0", + "description": "IBC modules and relayer - Formal specifications and Rust implementation", + "homepage": "", + "owner": "informalsystems", + "repo": "ibc-rs", + "rev": "0181c462486b7801d4ec720aa34f34576fcf981b", + "sha256": "1mwm0ia69wlshr5m5a8vblc6zh244rrxxm7np5df74jg330nyw7z", + "type": "tarball", + "url": "https://github.com/devashishdxt/hermes/archive/0181c462486b7801d4ec720aa34f34576fcf981b.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, "niv": { "branch": "master", "description": "Easy dependency management for Nix projects",