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

Test hermes #19

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
9 changes: 5 additions & 4 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ buildGoApplication rec {
subPackages = [ "cmd/cronosd" ];
buildFlags = lib.optionalString coverage "-cover";
CGO_ENABLED = "1";
CGO_LDFLAGS =
CGO_LDFLAGS = lib.optionalString (rocksdb != null) (
if static then "-lrocksdb -pthread -lstdc++ -ldl -lzstd -lsnappy -llz4 -lbz2 -lz"
else if stdenv.hostPlatform.isWindows then "-lrocksdb-shared"
else "-lrocksdb -pthread -lstdc++ -ldl";
else "-lrocksdb -pthread -lstdc++ -ldl"
);

postFixup = lib.optionalString stdenv.isDarwin ''
${stdenv.cc.targetPrefix}install_name_tool -change "@rpath/librocksdb.8.dylib" "${rocksdb}/lib/librocksdb.dylib" $out/bin/cronosd
postFixup = lib.optionalString (stdenv.isDarwin && rocksdb != null) ''
${stdenv.cc.bintools.targetPrefix}install_name_tool -change "@rpath/librocksdb.8.dylib" "${rocksdb}/lib/librocksdb.dylib" $out/bin/cronosd
'';

doCheck = false;
Expand Down
8 changes: 4 additions & 4 deletions flake.lock

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

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-22.11";
nixpkgs.url = "github:NixOS/nixpkgs/release-23.11";
flake-utils.url = "github:numtide/flake-utils";
nix-bundle-exe = {
url = "github:3noch/nix-bundle-exe";
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/crypto-org-chain/cronos/v2

go 1.20
go 1.21

require (
cosmossdk.io/api v0.3.1
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/ibc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
36 changes: 0 additions & 36 deletions integration_tests/install_hermes.nix

This file was deleted.

141 changes: 102 additions & 39 deletions integration_tests/poetry.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions integration_tests/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pytest-github-actions-annotate-failures = "^0.1.1"
flake8 = "^4.0.1"
black = "^22.3.0"
flake8-black = "^0.3.2"
flake8-isort = "^4.1.1"
flake8-isort = "^6.1.1"
pep8-naming = "^0.11.1"
protobuf = "^3.13.0"
grpcio = "^1.53.2"
Expand All @@ -20,7 +20,7 @@ python-dateutil = "^2.8.1"
web3 = "^6.0.0b6"
eth-bloom = "^1.0.4"
python-dotenv = "^0.19.2"
pystarport = { git = "https://github.com/crypto-com/pystarport.git", branch = "main", rev = "39ecbd29fcdd50cb3015524c13755fda05bdf23d" }
pystarport = { git = "https://github.com/crypto-com/pystarport.git", branch = "main", rev = "403b845" }
websockets = "^10.3"
toml = "^0.10.2"
pysha3 = "^1.0.2"
Expand All @@ -33,5 +33,5 @@ flaky = "^3.7.0"
[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
1 change: 0 additions & 1 deletion integration_tests/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pkgs.mkShell {
(pkgs.callPackage ../. { coverage = true; }) # cronosd
pkgs.start-scripts
pkgs.go-ethereum
pkgs.gorc
pkgs.cosmovisor
pkgs.poetry
pkgs.nodejs
Expand Down
7 changes: 4 additions & 3 deletions integration_tests/test_ica.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,19 @@ def generated_tx_txt(msg_num):

no_timeout = 60

def submit_msgs(msg_num, timeout_in_s=no_timeout, gas="200000"):
def submit_msgs(msg_num, t=no_timeout, gas="200000"):
num_txs = len(cli_host.query_all_txs(ica_address)["txs"])
# submit transaction on host chain on behalf of interchain account
timeout_duration = f"{t}s" if t < no_timeout else f"{no_timeout}s"
rsp = cli_controller.icaauth_submit_tx(
connid,
generated_tx_txt(msg_num),
timeout_duration=f"{timeout_in_s}s",
timeout_duration=timeout_duration,
gas=gas,
from_="signer2",
)
assert rsp["code"] == 0, rsp["raw_log"]
timeout = timeout_in_s + 3 if timeout_in_s < no_timeout else None
timeout = t + 3 if t < no_timeout else None
wait_for_check_tx(cli_host, ica_address, num_txs, timeout)

# submit large txs to trigger timeout
Expand Down
11 changes: 0 additions & 11 deletions nix/build_overlay.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
# some basic overlays nessesary for the build
final: super: {
# include the fix: https://github.com/NixOS/nixpkgs/pull/211515
zstd = final.callPackage ./zstd.nix {
cmake = final.buildPackages.cmakeMinimal;
};
rocksdb = final.callPackage ./rocksdb.nix { };
go_1_20 = super.go_1_20.overrideAttrs (prev: rec {
version = "1.20.4";
src = final.fetchurl {
url = "https://go.dev/dl/go${version}.src.tar.gz";
hash = "sha256-nzSs4Sh2S3o6SyOLgFhWzBshhDBN+eVpCCWwcQ9CAtY=";
};
});
}
9 changes: 5 additions & 4 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import sources.nixpkgs {
flake-compat = import sources.flake-compat;
chain-maind = pkgs.callPackage sources.chain-main { rocksdb = null; };
}) # update to a version that supports eip-1559
(import "${sources.poetry2nix}/overlay.nix")
(import "${sources.gomod2nix}/overlay.nix")
(pkgs: _:
import ./scripts.nix {
Expand All @@ -39,15 +40,15 @@ 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: {
cosmovisor = pkgs.buildGo118Module rec {
cosmovisor = pkgs.buildGo120Module rec {
name = "cosmovisor";
src = sources.cosmos-sdk + "/cosmovisor";
subPackages = [ "./cmd/cosmovisor" ];
vendorSha256 = "sha256-OAXWrwpartjgSP7oeNvDJ7cTR9lyYVNhEM8HUnv3acE=";
vendorHash = "sha256-OAXWrwpartjgSP7oeNvDJ7cTR9lyYVNhEM8HUnv3acE=";
doCheck = false;
};
})
Expand All @@ -56,7 +57,7 @@ import sources.nixpkgs {
name = "rly";
src = sources.relayer;
subPackages = [ "." ];
vendorSha256 = "sha256-5s5URiAZk59mOfZdUcqYAB/IvzFuBiQH5jDBuh6huTE=";
vendorHash = "sha256-5s5URiAZk59mOfZdUcqYAB/IvzFuBiQH5jDBuh6huTE=";
doCheck = false;
GOWORK = "off";
postInstall = ''
Expand Down
2 changes: 1 addition & 1 deletion nix/go-ethereum.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ buildGoModule rec {
sha256 = "sha256-mZ11xan3MGgaUORbiQczKrXSrxzjvQMhZbpHnEal11Y=";
};

vendorSha256 = "sha256-rjSGR2ie5sFK2OOo4HUZ6+hrDlQuUDtyTKn0sh8jFBY=";
vendorHash = "sha256-rjSGR2ie5sFK2OOo4HUZ6+hrDlQuUDtyTKn0sh8jFBY=";

doCheck = false;

Expand Down
29 changes: 29 additions & 0 deletions nix/hermes.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{ 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";
};
doCheck = false;
RUSTFLAGS = "--cfg ossl111 --cfg ossl110 --cfg ossl101";
OPENSSL_NO_VENDOR = "1";
OPENSSL_DIR = symlinkJoin {
name = "openssl";
paths = with openssl; [ out dev ];
};
}
38 changes: 31 additions & 7 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"homepage": "https://crypto.org",
"owner": "crypto-org-chain",
"repo": "chain-main",
"rev": "02455a4eafa8f2f6e4bd4aa9886904cfd3d518aa",
"sha256": "0ndlld82xw5004ma97ap6z6vhfsbkcma8yhvw891l3bf98rfllgk",
"rev": "04e8e094b7d51a8cf92b74c789394b7b34987b10",
"sha256": "1yqd2i8dwphjhdsvl3v7l8gvrjjl6i6pj4nq58lwcf3s6nhwy6d5",
"type": "tarball",
"url": "https://github.com/crypto-org-chain/chain-main/archive/02455a4eafa8f2f6e4bd4aa9886904cfd3d518aa.tar.gz",
"url": "https://github.com/crypto-org-chain/chain-main/archive/04e8e094b7d51a8cf92b74c789394b7b34987b10.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"cosmos-sdk": {
Expand Down Expand Up @@ -84,6 +84,18 @@
"url": "https://github.com/crypto-org-chain/gravity-bridge/archive/d984b1562242efab5d7595d4108472ed27eba06f.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.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": "8e85859fe28da1ee8703084373fd2fc8980faa46",
"sha256": "0rh73h5bij83b047713799j8hqai96g4wfns6nsi879z2h2kv69c",
"type": "tarball",
"url": "https://github.com/informalsystems/hermes/archive/8e85859fe28da1ee8703084373fd2fc8980faa46.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"niv": {
"branch": "master",
"description": "Easy dependency management for Nix projects",
Expand All @@ -97,15 +109,27 @@
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs": {
"branch": "master",
"branch": "release-23.11",
"description": "Nix Packages collection",
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "90aa73fc8e1550b16d1ebdc436e48d9951f7989b",
"sha256": "0jh4npbcqjlszhnaz5mkziv5g1p5ig6wqp68yjxkjllsc7vhsrw6",
"rev": "0ca77ade2a34c5466be6d54f1267507860c95da8",
"sha256": "11q88xx5njl31h3qrc213qx43yi9fqlfrbfwv2h5dgamgbpp2jk9",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/0ca77ade2a34c5466be6d54f1267507860c95da8.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"poetry2nix": {
"branch": "master",
"description": "Convert poetry projects to nix automagically [maintainer=@adisbladis] ",
"homepage": "",
"owner": "nix-community",
"repo": "poetry2nix",
"rev": "4eb2ac54029af42a001c9901194e9ce19cbd8a40",
"sha256": "16fi71fpywiqsya1z99kkb14dansyrmkkrb2clzs3b5qqx673wf4",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/90aa73fc8e1550b16d1ebdc436e48d9951f7989b.tar.gz",
"url": "https://github.com/nix-community/poetry2nix/archive/4eb2ac54029af42a001c9901194e9ce19cbd8a40.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"relayer": {
Expand Down
3 changes: 2 additions & 1 deletion nix/testenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ poetry2nix.mkPoetryEnv {
let
buildSystems = {
eth-bloom = [ "setuptools" ];
pystarport = [ "poetry" ];
pystarport = [ "poetry-core" ];
cprotobuf = [ "setuptools" ];
durations = [ "setuptools" ];
multitail2 = [ "setuptools" ];
pytest-github-actions-annotate-failures = [ "setuptools" ];
flake8-black = [ "setuptools" ];
flake8-isort = [ "hatchling" ];
multiaddr = [ "setuptools" ];
};
in
Expand Down
Loading
Loading