From 1d9b4d9c7924770557b6263e5753653937978a18 Mon Sep 17 00:00:00 2001 From: huangyi Date: Fri, 16 Feb 2024 20:55:26 +0800 Subject: [PATCH] Problem: nixpkgs is too old Solution: - update to release-23.11 vendor hash use nixpkgs 23.05 NIXPKGS_ALLOW_INSECURE=1 optional event_query_tx fix gov upgrade update deps --- .github/workflows/nix.yml | 3 + flake.lock | 20 +-- flake.nix | 6 +- integration_tests/poetry.lock | 18 ++- integration_tests/pyproject.toml | 6 +- integration_tests/test_gov.py | 41 ++++-- integration_tests/test_hardware_wallet.py | 2 +- integration_tests/test_ibc.py | 21 ++- integration_tests/test_ibc_channel_genesis.py | 8 +- integration_tests/test_ibc_extended.py | 14 +- integration_tests/test_nft.py | 38 +++++- integration_tests/test_slashing.py | 4 +- integration_tests/test_staking.py | 51 ++++++-- integration_tests/test_upgrade.py | 23 +++- integration_tests/test_vesting_staking.py | 9 +- nix/build_overlay.nix | 11 -- nix/bundle-win-exe.nix | 6 +- nix/default.nix | 2 +- nix/hermes.nix | 6 +- nix/sources.json | 34 +++-- nix/testenv.nix | 6 +- nix/zstd.nix | 122 ------------------ 22 files changed, 227 insertions(+), 224 deletions(-) delete mode 100644 nix/zstd.nix diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 8c6f4d275..53acce1bf 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -9,6 +9,9 @@ on: tags: - "*" +env: + NIXPKGS_ALLOW_INSECURE: 1 + jobs: lint: runs-on: ubuntu-latest diff --git a/flake.lock b/flake.lock index 6f8778999..d71b302aa 100644 --- a/flake.lock +++ b/flake.lock @@ -17,19 +17,19 @@ }, "gomod2nix": { "inputs": { + "flake-utils": [ + "flake-utils" + ], "nixpkgs": [ "nixpkgs" - ], - "utils": [ - "flake-utils" ] }, "locked": { - "lastModified": 1677459247, - "narHash": "sha256-JbakfAiPYmCCV224yAMq/XO0udN5coWv/oazblMKdoY=", + "lastModified": 1705314449, + "narHash": "sha256-yfQQ67dLejP0FLK76LKHbkzcQqNIrux6MFe32MMFGNQ=", "owner": "nix-community", "repo": "gomod2nix", - "rev": "3cbf3a51fe32e2f57af4c52744e7228bab22983d", + "rev": "30e3c3a9ec4ac8453282ca7f67fca9e1da12c3e6", "type": "github" }, "original": { @@ -56,16 +56,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1682538316, - "narHash": "sha256-YuHgVsR7S9zxJWHo7lo2ugd+uDC4ESWg1hA4bEZQv3Y=", + "lastModified": 1708053705, + "narHash": "sha256-K6kCu54cOM3zSUkVmfB9zPqWyKFpEkMkDLbRl9sxES4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "15b75800dce80225b44f067c9012b09de37dfad2", + "rev": "0ed7136921ea094c771db674c9d2566b14852a01", "type": "github" }, "original": { "owner": "NixOS", - "ref": "release-22.11", + "ref": "release-23.11", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 37401fad2..e54461e2e 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/release-22.11"; + nixpkgs.url = "github:NixOS/nixpkgs/release-23.05"; flake-utils.url = "github:numtide/flake-utils"; nix-bundle-exe = { url = "github:3noch/nix-bundle-exe"; @@ -9,7 +9,7 @@ gomod2nix = { url = "github:nix-community/gomod2nix"; inputs.nixpkgs.follows = "nixpkgs"; - inputs.utils.follows = "flake-utils"; + inputs.flake-utils.follows = "flake-utils"; }; }; @@ -49,7 +49,7 @@ devShells = { chain-maind = pkgs.mkShell { buildInputs = with pkgs; [ - go_1_20 + go_1_21 rocksdb ]; }; diff --git a/integration_tests/poetry.lock b/integration_tests/poetry.lock index e51619f5a..84fd991c6 100644 --- a/integration_tests/poetry.lock +++ b/integration_tests/poetry.lock @@ -516,19 +516,17 @@ files = [ [[package]] name = "isort" -version = "5.8.0" +version = "5.13.2" description = "A Python utility / library to sort Python imports." optional = false -python-versions = ">=3.6,<4.0" +python-versions = ">=3.8.0" files = [ - {file = "isort-5.8.0-py3-none-any.whl", hash = "sha256:2bb1680aad211e3c9944dbce1d4ba09a989f04e238296c87fe2139faa26d655d"}, - {file = "isort-5.8.0.tar.gz", hash = "sha256:0a943902919f65c5684ac4e0154b1ad4fac6dcaa5d9f3426b732f1c8b5419be6"}, + {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, + {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, ] [package.extras] -colors = ["colorama (>=0.4.3,<0.5.0)"] -pipfile-deprecated-finder = ["pipreqs", "requirementslib"] -requirements-deprecated-finder = ["pip-api", "pipreqs"] +colors = ["colorama (>=0.4.6)"] [[package]] name = "jsonmerge" @@ -801,8 +799,8 @@ tomlkit = "^0.7.0" [package.source] type = "git" url = "https://github.com/crypto-com/pystarport.git" -reference = "main" -resolved_reference = "b2aa98544958811429948aff3ab4bb3881f56a1f" +reference = "d86272f" +resolved_reference = "d86272fa850a1bb1b0d0117b9a3833cd06a0c76d" [[package]] name = "pytest" @@ -1156,4 +1154,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "e49dc78a7fc6e19c0929da8ddaff97feaebeabcc0dd357311253adc7f7e9f286" +content-hash = "cb4ef440f8f06480333fb8a97873c16d454a9a8f9673b6158bf94edea9b0a45d" diff --git a/integration_tests/pyproject.toml b/integration_tests/pyproject.toml index 0ce35572b..858e10a2b 100644 --- a/integration_tests/pyproject.toml +++ b/integration_tests/pyproject.toml @@ -19,7 +19,7 @@ pytest-github-actions-annotate-failures = "^0.1.7" protobuf = "^3.20.2" pyyaml = "^6.0.1" python-dateutil = "^2.8.1" -pystarport = { git = "https://github.com/crypto-com/pystarport.git", branch = "main" } +pystarport = { git = "https://github.com/crypto-com/pystarport.git", branch = "main", rev = "d86272f" } chainlibpy = "^2.2.0" # manually upgrade to make hatchling build success in poetry2nix @@ -28,5 +28,5 @@ pathspec = "^0.10.1" [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" diff --git a/integration_tests/test_gov.py b/integration_tests/test_gov.py index b2bb950a3..604522e11 100644 --- a/integration_tests/test_gov.py +++ b/integration_tests/test_gov.py @@ -58,16 +58,27 @@ def approve_proposal(cluster, rsp, vote_option="yes"): assert proposal["status"] == "PROPOSAL_STATUS_DEPOSIT_PERIOD", proposal amount = cluster.balance(cluster.address("ecosystem")) - rsp = cluster.gov_deposit("ecosystem", proposal_id, "1cro") + rsp = cluster.gov_deposit("ecosystem", proposal_id, "1cro", event_query_tx=False) assert rsp["code"] == 0, rsp["raw_log"] assert cluster.balance(cluster.address("ecosystem")) == amount - 100000000 proposal = cluster.query_proposal(proposal_id) assert proposal["status"] == "PROPOSAL_STATUS_VOTING_PERIOD", proposal if vote_option is not None: - rsp = cluster.gov_vote("validator", proposal_id, vote_option) + rsp = cluster.gov_vote( + "validator", + proposal_id, + vote_option, + event_query_tx=False, + ) assert rsp["code"] == 0, rsp["raw_log"] - rsp = cluster.gov_vote("validator", proposal_id, vote_option, i=1) + rsp = cluster.gov_vote( + "validator", + proposal_id, + vote_option, + i=1, + event_query_tx=False, + ) assert rsp["code"] == 0, rsp["raw_log"] assert ( int(cluster.query_tally(proposal_id, i=1)[vote_option + "_count"]) @@ -128,7 +139,12 @@ def test_deposit_period_expires(cluster): amount2 = cluster.balance(cluster.address("ecosystem")) - rsp = cluster.gov_deposit("ecosystem", proposal_id, "5000basecro") + rsp = cluster.gov_deposit( + "ecosystem", + proposal_id, + "5000basecro", + event_query_tx=False, + ) assert rsp["code"] == 0, rsp["raw_log"] proposal = cluster.query_proposal(proposal_id) assert proposal["total_deposit"] == [{"denom": "basecro", "amount": "10000"}] @@ -182,9 +198,9 @@ def test_community_pool_spend_proposal(cluster): proposal_id = ev["proposal_id"] # vote - rsp = cluster.gov_vote("validator", proposal_id, "yes") + rsp = cluster.gov_vote("validator", proposal_id, "yes", event_query_tx=False) assert rsp["code"] == 0, rsp["raw_log"] - rsp = cluster.gov_vote("validator", proposal_id, "yes", i=1) + rsp = cluster.gov_vote("validator", proposal_id, "yes", i=1, event_query_tx=False) assert rsp["code"] == 0, rsp["raw_log"] # wait for voting period end @@ -232,7 +248,7 @@ def test_change_vote(cluster): proposal_id = parse_events(rsp["logs"])["submit_proposal"]["proposal_id"] - rsp = cluster.gov_vote("validator", proposal_id, "yes") + rsp = cluster.gov_vote("validator", proposal_id, "yes", event_query_tx=False) assert rsp["code"] == 0, rsp["raw_log"] cluster.query_tally(proposal_id) == { @@ -243,7 +259,7 @@ def test_change_vote(cluster): } # change vote to no - rsp = cluster.gov_vote("validator", proposal_id, "no") + rsp = cluster.gov_vote("validator", proposal_id, "no", event_query_tx=False) assert rsp["code"] == 0, rsp["raw_log"] cluster.query_tally(proposal_id) == { @@ -285,10 +301,13 @@ def test_inherit_vote(cluster): # non-validator voter voter1 = cluster.address("community") cluster.delegate_amount( - cluster.address("validator", bech="val"), "10basecro", voter1 + cluster.address("validator", bech="val"), + "10basecro", + voter1, + event_query_tx=False, ) - rsp = cluster.gov_vote("validator", proposal_id, "yes") + rsp = cluster.gov_vote("validator", proposal_id, "yes", event_query_tx=False) assert rsp["code"] == 0, rsp["raw_log"] assert cluster.query_tally(proposal_id) == { "yes_count": "1000000010", @@ -297,7 +316,7 @@ def test_inherit_vote(cluster): "no_with_veto_count": "0", } - rsp = cluster.gov_vote(voter1, proposal_id, "no") + rsp = cluster.gov_vote(voter1, proposal_id, "no", event_query_tx=False) assert rsp["code"] == 0, rsp["raw_log"] assert cluster.query_tally(proposal_id) == { diff --git a/integration_tests/test_hardware_wallet.py b/integration_tests/test_hardware_wallet.py index 450bee96a..4afea94f1 100644 --- a/integration_tests/test_hardware_wallet.py +++ b/integration_tests/test_hardware_wallet.py @@ -34,7 +34,7 @@ def test_ledger_transfer(cluster): reserve_balance = cluster.balance(reserve_addr) hw_balance = cluster.balance(hw_addr) - tx = cluster.transfer_from_ledger("hw", reserve_addr, "1cro") + tx = cluster.transfer_from_ledger("hw", reserve_addr, "1cro", event_query_tx=False) print("transfer tx", tx["txhash"]) assert tx["logs"] == [ { diff --git a/integration_tests/test_ibc.py b/integration_tests/test_ibc.py index 463e6c477..6bf727015 100644 --- a/integration_tests/test_ibc.py +++ b/integration_tests/test_ibc.py @@ -38,7 +38,12 @@ def test_ibc(cluster): # do a transfer from ibc-0 to ibc-1 rsp = cluster["ibc-0"].ibc_transfer( - "relayer", addr_1, "10000basecro", src_channel, 1 + "relayer", + addr_1, + "10000basecro", + src_channel, + 1, + event_query_tx=False, ) assert rsp["code"] == 0, rsp["raw_log"] # sender balance decreased @@ -86,7 +91,12 @@ def test_ibc(cluster): # transfer back rsp = cluster["ibc-1"].ibc_transfer( - "relayer", addr_0, f"10000ibc/{denom_hash}", dst_channel, 0 + "relayer", + addr_0, + f"10000ibc/{denom_hash}", + dst_channel, + 0, + event_query_tx=False, ) print("ibc transfer back") assert rsp["code"] == 0, rsp["raw_log"] @@ -185,7 +195,12 @@ def test_update_chain_id(cluster): balance_0 = cluster["ibc-0"].balance(cluster["ibc-0"].address("relayer")) recipient = cluster["ibc-1"].address("relayer") rsp = cluster["ibc-0"].ibc_transfer( - "relayer", recipient, "10000basecro", channels[0]["channel_id"], 1 + "relayer", + recipient, + "10000basecro", + channels[0]["channel_id"], + 1, + event_query_tx=False, ) assert rsp["code"] == 0, rsp["raw_log"] time.sleep(10) diff --git a/integration_tests/test_ibc_channel_genesis.py b/integration_tests/test_ibc_channel_genesis.py index dee1cfab8..39a9572bb 100644 --- a/integration_tests/test_ibc_channel_genesis.py +++ b/integration_tests/test_ibc_channel_genesis.py @@ -65,7 +65,12 @@ def test_ibc_genesis_channel(cluster): # # do a transfer from ibc-0 to ibc-1 rsp = cluster["ibc-0"].ibc_transfer( - "relayer", addr_1, "%dbasecro" % transfer_amount, "channel-0", 1 + "relayer", + addr_1, + "%dbasecro" % transfer_amount, + "channel-0", + 1, + event_query_tx=False, ) assert rsp["code"] == 0, rsp["raw_log"] # sender balance decreased @@ -117,6 +122,7 @@ def test_ibc_genesis_channel(cluster): "%dibc/%s" % (transfer_amount, denom_hash), "channel-0", 0, + event_query_tx=False, ) assert rsp["code"] == 0, rsp["raw_log"] diff --git a/integration_tests/test_ibc_extended.py b/integration_tests/test_ibc_extended.py index 3209c0e42..243124585 100644 --- a/integration_tests/test_ibc_extended.py +++ b/integration_tests/test_ibc_extended.py @@ -41,7 +41,12 @@ def test_ibc_extended(cluster): denom_string = f"transfer/{dst_channel}/basecro" # send A -> C rsp = cluster["ibc-0"].ibc_transfer( - "relayer", addr_1, "10000basecro", src_channel, 1 + "relayer", + addr_1, + "10000basecro", + src_channel, + 1, + event_query_tx=False, ) time.sleep(10) res = json.loads( @@ -65,7 +70,12 @@ def test_ibc_extended(cluster): ] # send B <- C rsp = cluster["ibc-1"].ibc_transfer( - "relayer", addr_0_signer, f"55ibc/{denom_hash}", dst_channel, 0 + "relayer", + addr_0_signer, + f"55ibc/{denom_hash}", + dst_channel, + 0, + event_query_tx=False, ) assert rsp["code"] == 0, rsp["raw_log"] time.sleep(10) diff --git a/integration_tests/test_nft.py b/integration_tests/test_nft.py index cd0b6bdfa..a0a8b5055 100644 --- a/integration_tests/test_nft.py +++ b/integration_tests/test_nft.py @@ -14,7 +14,12 @@ def test_create_nft(cluster): singer1_addr = cluster.address("signer1") denomid = "testdenomid" denomname = "testdenomname" - response = cluster.create_nft(singer1_addr, denomid, denomname) + response = cluster.create_nft( + singer1_addr, + denomid, + denomname, + event_query_tx=False, + ) raw_log = json.loads(response["raw_log"]) assert raw_log[0]["events"][0]["type"] == "issue_denom" @@ -43,7 +48,12 @@ def test_create_nft_token(cluster): singer2_addr = cluster.address("signer2") uri = "testuri" response = cluster.create_nft_token( - singer1_addr, singer2_addr, denomid, tokenid, uri + singer1_addr, + singer2_addr, + denomid, + tokenid, + uri, + event_query_tx=False, ) raw_log = json.loads(response["raw_log"]) assert ( @@ -66,7 +76,13 @@ def test_transfer_nft_token(cluster): tokenid = "testtokenid" singer1_addr = cluster.address("signer1") singer2_addr = cluster.address("signer2") - response = cluster.transfer_nft_token(singer2_addr, singer1_addr, denomid, tokenid) + response = cluster.transfer_nft_token( + singer2_addr, + singer1_addr, + denomid, + tokenid, + event_query_tx=False, + ) raw_log = json.loads(response["raw_log"]) assert ( raw_log[0]["events"][0]["attributes"][0]["value"] @@ -89,7 +105,14 @@ def test_edit_nft_token(cluster): singer1_addr = cluster.address("signer1") newuri = "newuri" newname = "newname" - response = cluster.edit_nft_token(singer1_addr, denomid, tokenid, newuri, newname) + response = cluster.edit_nft_token( + singer1_addr, + denomid, + tokenid, + newuri, + newname, + event_query_tx=False, + ) raw_log = json.loads(response["raw_log"]) assert raw_log[0]["events"][0]["type"] == "edit_nft" assert raw_log[0]["events"][0]["attributes"][2]["key"] == "token_uri" @@ -100,6 +123,11 @@ def test_burn_nft_token(cluster): denomid = "testdenomid" tokenid = "testtokenid" singer1_addr = cluster.address("signer1") - response = cluster.burn_nft_token(singer1_addr, denomid, tokenid) + response = cluster.burn_nft_token( + singer1_addr, + denomid, + tokenid, + event_query_tx=False, + ) raw_log = json.loads(response["raw_log"]) assert raw_log[0]["events"][0]["type"] == "burn_nft" diff --git a/integration_tests/test_slashing.py b/integration_tests/test_slashing.py index 35d67dc7d..f3e8b5137 100644 --- a/integration_tests/test_slashing.py +++ b/integration_tests/test_slashing.py @@ -50,14 +50,14 @@ def test_slashing(cluster): assert val["jailed"], "validator is jailed" # try to unjail - rsp = cluster.unjail(addr, i=2) + rsp = cluster.unjail(addr, i=2, event_query_tx=False) assert rsp["code"] == 4, "still jailed, can't be unjailed" # wait for 60s and unjail again wait_for_block_time( cluster, isoparse(val["unbonding_time"]) + datetime.timedelta(seconds=60) ) - rsp = cluster.unjail(addr, i=2) + rsp = cluster.unjail(addr, i=2, event_query_tx=False) assert rsp["code"] == 0, f"unjail should success {rsp}" wait_for_new_blocks(cluster, 3) diff --git a/integration_tests/test_staking.py b/integration_tests/test_staking.py index 7d7904a5f..da1bbef89 100644 --- a/integration_tests/test_staking.py +++ b/integration_tests/test_staking.py @@ -41,7 +41,10 @@ def test_staking_delegate(cluster): old_amount = cluster.balance(signer1_address) old_bonded = cluster.staking_pool() rsp = cluster.delegate_amount( - validator1_operator_address, "2basecro", signer1_address + validator1_operator_address, + "2basecro", + signer1_address, + event_query_tx=False, ) assert rsp["code"] == 0, rsp["raw_log"] assert cluster.staking_pool() == old_bonded + 2 @@ -61,11 +64,17 @@ def test_staking_unbond(cluster): old_amount = cluster.balance(signer1_address) old_bonded = cluster.staking_pool() rsp = cluster.delegate_amount( - validator1_operator_address, "3basecro", signer1_address + validator1_operator_address, + "3basecro", + signer1_address, + event_query_tx=False, ) assert rsp["code"] == 0, rsp["raw_log"] rsp = cluster.delegate_amount( - validator2_operator_address, "4basecro", signer1_address + validator2_operator_address, + "4basecro", + signer1_address, + event_query_tx=False, ) assert rsp["code"] == 0, rsp["raw_log"] assert cluster.staking_pool() == old_bonded + 7 @@ -73,7 +82,10 @@ def test_staking_unbond(cluster): old_unbonded = cluster.staking_pool(bonded=False) rsp = cluster.unbond_amount( - validator2_operator_address, "2basecro", signer1_address + validator2_operator_address, + "2basecro", + signer1_address, + event_query_tx=False, ) assert rsp["code"] == 0, rsp assert cluster.staking_pool(bonded=False) == old_unbonded + 2 @@ -97,11 +109,17 @@ def test_staking_redelegate(cluster): staking_validator2 = cluster.validator(validator2_operator_address, i=1) assert validator2_operator_address == staking_validator2["operator_address"] rsp = cluster.delegate_amount( - validator1_operator_address, "3basecro", signer1_address + validator1_operator_address, + "3basecro", + signer1_address, + event_query_tx=False, ) assert rsp["code"] == 0, rsp["raw_log"] rsp = cluster.delegate_amount( - validator2_operator_address, "4basecro", signer1_address + validator2_operator_address, + "4basecro", + signer1_address, + event_query_tx=False, ) assert rsp["code"] == 0, rsp["raw_log"] delegation_info = cluster.get_delegated_amount(signer1_address) @@ -150,7 +168,7 @@ def test_join_validator(cluster): # wait for the new node to sync wait_for_block(cluster.cosmos_cli(i), cluster.block_height(0)) # create validator tx - assert cluster.create_validator("1cro", i)["code"] == 0 + assert cluster.create_validator("1cro", i, event_query_tx=False)["code"] == 0 time.sleep(2) count2 = len(cluster.validators()) @@ -167,9 +185,8 @@ def test_join_validator(cluster): "max_rate": "0.200000000000000000", "max_change_rate": "0.010000000000000000", } - assert ( - cluster.edit_validator(i, commission_rate="0.2")["code"] == 12 - ), "commission cannot be changed more than once in 24h" + res = cluster.edit_validator(i, commission_rate="0.2", event_query_tx=False) + assert res["code"] == 12, "commission cannot be changed more than once in 24h" assert edit_validator(cluster, i, new_moniker="awesome node")["code"] == 0 assert cluster.validator(val_addr)["description"]["moniker"] == "awesome node" @@ -183,7 +200,13 @@ def test_min_self_delegation(cluster): oper_addr = cluster.address("validator", i=2, bech="val") acct_addr = cluster.address("validator", i=2) - rsp = cluster.unbond_amount(oper_addr, "90000000basecro", acct_addr, i=2) + rsp = cluster.unbond_amount( + oper_addr, + "90000000basecro", + acct_addr, + i=2, + event_query_tx=False, + ) assert rsp["code"] == 0, rsp["raw_log"] def find_validator(): @@ -201,7 +224,11 @@ def find_validator(): # can't do commit broadcast here rsp = cluster.unbond_amount( - oper_addr, "1basecro", acct_addr, i=2 # , broadcast_mode="async" + oper_addr, + "1basecro", + acct_addr, + i=2, + event_query_tx=False, # , broadcast_mode="async" ) wait_for_new_blocks(cluster, 2) assert ( diff --git a/integration_tests/test_upgrade.py b/integration_tests/test_upgrade.py index a409e9a44..fc84866c0 100644 --- a/integration_tests/test_upgrade.py +++ b/integration_tests/test_upgrade.py @@ -126,9 +126,9 @@ def test_cosmovisor(cosmovisor_cluster): assert ev["proposal_messages"] == ",/cosmos.gov.v1.MsgExecLegacyContent", rsp proposal_id = ev["proposal_id"] - rsp = cluster.gov_vote("validator", proposal_id, "yes") + rsp = cluster.gov_vote("validator", proposal_id, "yes", event_query_tx=False) assert rsp["code"] == 0, rsp["raw_log"] - rsp = cluster.gov_vote("validator", proposal_id, "yes", i=1) + rsp = cluster.gov_vote("validator", proposal_id, "yes", i=1, event_query_tx=False) assert rsp["code"] == 0, rsp["raw_log"] proposal = cluster.query_proposal(proposal_id) @@ -168,9 +168,9 @@ def propose_and_pass(cluster, kind, title, proposal, cosmos_sdk_46=True, **kwarg proposal = cluster.query_proposal(proposal_id) assert proposal["status"] == "PROPOSAL_STATUS_VOTING_PERIOD", proposal - rsp = cluster.gov_vote("validator", proposal_id, "yes") + rsp = cluster.gov_vote("validator", proposal_id, "yes", event_query_tx=False) assert rsp["code"] == 0, rsp["raw_log"] - rsp = cluster.gov_vote("validator", proposal_id, "yes", i=1) + rsp = cluster.gov_vote("validator", proposal_id, "yes", i=1, event_query_tx=False) assert rsp["code"] == 0, rsp["raw_log"] proposal = cluster.query_proposal(proposal_id) @@ -324,11 +324,17 @@ def assert_commission(adr, expected): signer1_address, 0, "0.025basecro", + event_query_tx=False, ) assert rsp["code"] == 0, rsp["raw_log"] assert cluster.staking_pool() == old_bonded + 2009999498 rsp = cluster.delegate_amount( - validator2_operator_address, "1basecro", signer1_address, 0, "0.025basecro" + validator2_operator_address, + "1basecro", + signer1_address, + 0, + "0.025basecro", + event_query_tx=False, ) # vesting bug assert rsp["code"] != 0, rsp["raw_log"] @@ -338,7 +344,12 @@ def assert_commission(adr, expected): upgrade(cluster, "v3.0.0", target_height, cosmos_sdk_46=False) rsp = cluster.delegate_amount( - validator2_operator_address, "1basecro", signer1_address, 0, "0.025basecro" + validator2_operator_address, + "1basecro", + signer1_address, + 0, + "0.025basecro", + event_query_tx=False, ) # vesting bug fixed assert rsp["code"] == 0, rsp["raw_log"] diff --git a/integration_tests/test_vesting_staking.py b/integration_tests/test_vesting_staking.py index 21c1b07f9..c0e7aad97 100644 --- a/integration_tests/test_vesting_staking.py +++ b/integration_tests/test_vesting_staking.py @@ -40,11 +40,17 @@ def test_staking_vesting_redelegate(cluster): signer1_address, 0, "0.025basecro", + event_query_tx=False, ) assert rsp["code"] == 0, rsp["raw_log"] assert cluster.staking_pool() == old_bonded + 2009999498 rsp = cluster.delegate_amount( - validator2_operator_address, "1basecro", signer1_address, 0, "0.025basecro" + validator2_operator_address, + "1basecro", + signer1_address, + 0, + "0.025basecro", + event_query_tx=False, ) assert rsp["code"] == 0, rsp["raw_log"] assert cluster.staking_pool() == old_bonded + 2009999499 @@ -55,6 +61,7 @@ def test_staking_vesting_redelegate(cluster): validator2_operator_address, "2basecro", signer1_address, + event_query_tx=False, ) # delegation_info = cluster.get_delegated_amount(signer1_address) # output = delegation_info["delegation_responses"][0]["balance"]["amount"] diff --git a/nix/build_overlay.nix b/nix/build_overlay.nix index 6875e06dc..476654e66 100644 --- a/nix/build_overlay.nix +++ b/nix/build_overlay.nix @@ -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="; - }; - }); } diff --git a/nix/bundle-win-exe.nix b/nix/bundle-win-exe.nix index 5a156c542..ed31cdf9f 100644 --- a/nix/bundle-win-exe.nix +++ b/nix/bundle-win-exe.nix @@ -20,9 +20,9 @@ runCommand "tarball-${chain-maind.name}" "${zlib}/bin/zlib1.dll" "${zstd.bin}/bin/libzstd.dll" "${windows.mingw_w64_pthreads}/bin/libwinpthread-1.dll" - "${windows.mcfgthreads}/bin/mcfgthread-12.dll" - "${stdenv.cc.cc}/x86_64-w64-mingw32/lib/libgcc_s_seh-1.dll" - "${stdenv.cc.cc}/x86_64-w64-mingw32/lib/libstdc++-6.dll" + "${windows.mcfgthreads}/bin/libmcfgthread-1.dll" + "${stdenv.cc.cc.lib}/x86_64-w64-mingw32/lib/libgcc_s_seh-1.dll" + "${stdenv.cc.cc.lib}/x86_64-w64-mingw32/lib/libstdc++-6.dll" ]; } '' mkdir -p $out diff --git a/nix/default.nix b/nix/default.nix index 393ce79c9..7d34836fe 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -6,7 +6,7 @@ import sources.nixpkgs { name = "cosmovisor"; src = sources.cosmos-sdk + "/cosmovisor"; subPackages = [ "./cmd/cosmovisor" ]; - vendorSha256 = "sha256-OAXWrwpartjgSP7oeNvDJ7cTR9lyYVNhEM8HUnv3acE="; + vendorHash = "sha256-OAXWrwpartjgSP7oeNvDJ7cTR9lyYVNhEM8HUnv3acE="; doCheck = false; }; hermes = pkgs.callPackage ./hermes.nix { src = sources.ibc-rs; }; diff --git a/nix/hermes.nix b/nix/hermes.nix index 7ce1bc900..a71979361 100644 --- a/nix/hermes.nix +++ b/nix/hermes.nix @@ -2,14 +2,14 @@ , lib , stdenv , darwin -, rustPlatform +, rustPackages_1_70 , symlinkJoin , openssl }: -rustPlatform.buildRustPackage rec { +rustPackages_1_70.rustPlatform.buildRustPackage rec { name = "hermes"; inherit src; - cargoSha256 = "sha256-Pkdc1XrhMFjuUcMsMfvltOynCIJtfeWmwEBTPz8Exok="; + cargoSha256 = "sha256-jqmIBmvY3PXpLFfv6XrnXJ0RmR6amFFMNfgK8qDFHb8="; cargoBuildFlags = "-p ibc-relayer-cli"; buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security diff --git a/nix/sources.json b/nix/sources.json index 20aba3331..099fcd051 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -17,34 +17,46 @@ "homepage": null, "owner": "nix-community", "repo": "gomod2nix", - "rev": "3cbf3a51fe32e2f57af4c52744e7228bab22983d", - "sha256": "11kn199nxcw6zspqawkrsfwv8wzx581wif3day160qlg11ya9di5", + "rev": "30e3c3a9ec4ac8453282ca7f67fca9e1da12c3e6", + "sha256": "1m0q0p1xidsp61xfrbj8ld1dqk3fhyrfifxj2ks36yjbnzmi1x69", "type": "tarball", - "url": "https://github.com/nix-community/gomod2nix/archive/3cbf3a51fe32e2f57af4c52744e7228bab22983d.tar.gz", + "url": "https://github.com/nix-community/gomod2nix/archive/30e3c3a9ec4ac8453282ca7f67fca9e1da12c3e6.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "ibc-rs": { - "branch": "v1.4.0", + "branch": "v1.6.0", "description": "IBC modules and relayer - Formal specifications and Rust implementation", "homepage": "", "owner": "informalsystems", "repo": "ibc-rs", - "rev": "daad02843a091bbdb3dd608e5f4ce790895c8845", - "sha256": "1n90sl5mcw4q6xri9k6rlhavxl43nxaza4ma9qwbhz2sh63sbh1l", + "rev": "1c1cf02988db67507de7d484e1a7f317fe494d6c", + "sha256": "08a92qw7mbag51lphxj3515i17qwsqhlam2q0g6fhldhfisa7bya", "type": "tarball", - "url": "https://github.com/informalsystems/ibc-rs/archive/daad02843a091bbdb3dd608e5f4ce790895c8845.tar.gz", + "url": "https://github.com/informalsystems/ibc-rs/archive/1c1cf02988db67507de7d484e1a7f317fe494d6c.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "nixpkgs": { - "branch": "master", + "branch": "release-23.05", "description": "Nix Packages collection", "homepage": "", "owner": "NixOS", "repo": "nixpkgs", - "rev": "90aa73fc8e1550b16d1ebdc436e48d9951f7989b", - "sha256": "0jh4npbcqjlszhnaz5mkziv5g1p5ig6wqp68yjxkjllsc7vhsrw6", + "rev": "9a333eaa80901efe01df07eade2c16d183761fa3", + "sha256": "0xhqjli4m9wkzv7xhs6fr1iajdjbv7xnj0bwvwldq9s6arlwkhj3", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/9a333eaa80901efe01df07eade2c16d183761fa3.tar.gz", + "url_template": "https://github.com///archive/.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///archive/.tar.gz" } } diff --git a/nix/testenv.nix b/nix/testenv.nix index 7499d2145..c1532fbdc 100644 --- a/nix/testenv.nix +++ b/nix/testenv.nix @@ -1,6 +1,6 @@ -{ poetry2nix, python39, lib }: +{ poetry2nix, python310, lib }: poetry2nix.mkPoetryEnv { - python = python39; + python = python310; projectDir = ../integration_tests; overrides = poetry2nix.overrides.withDefaults (lib.composeManyExtensions [ (self: super: @@ -8,7 +8,7 @@ poetry2nix.mkPoetryEnv { buildSystems = { pyparsing = [ "flit-core" ]; hdwallets = [ "poetry" ]; - pystarport = [ "poetry" ]; + pystarport = [ "poetry-core" ]; durations = [ "setuptools" ]; multitail2 = [ "setuptools" ]; pytest-github-actions-annotate-failures = [ "setuptools" ]; diff --git a/nix/zstd.nix b/nix/zstd.nix deleted file mode 100644 index ff8860056..000000000 --- a/nix/zstd.nix +++ /dev/null @@ -1,122 +0,0 @@ -{ lib -, stdenv -, fetchFromGitHub -, cmake -, bash -, gnugrep -, fixDarwinDylibNames -, file -, fetchpatch -, legacySupport ? false -, static ? stdenv.hostPlatform.isStatic - # these need to be ran on the host, thus disable when cross-compiling -, buildContrib ? stdenv.hostPlatform == stdenv.buildPlatform -, doCheck ? stdenv.hostPlatform == stdenv.buildPlatform -, nix-update-script -}: - -stdenv.mkDerivation rec { - pname = "zstd"; - version = "1.5.2"; - - src = fetchFromGitHub { - owner = "facebook"; - repo = "zstd"; - rev = "v${version}"; - sha256 = "sha256-yJvhcysxcbUGuDOqe/TQ3Y5xyM2AUw6r1THSHOqmUy0="; - }; - - nativeBuildInputs = [ cmake ] - ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; - buildInputs = lib.optional stdenv.hostPlatform.isUnix bash; - - patches = [ - # This patches makes sure we do not attempt to use the MD5 implementation - # of the host platform when running the tests - ./playtests-darwin.patch - ]; - - postPatch = lib.optionalString (!static) '' - substituteInPlace build/cmake/CMakeLists.txt \ - --replace 'message(SEND_ERROR "You need to build static library to build tests")' "" - substituteInPlace build/cmake/tests/CMakeLists.txt \ - --replace 'libzstd_static' 'libzstd_shared' - sed -i \ - "1aexport ${lib.optionalString stdenv.isDarwin "DY"}LD_LIBRARY_PATH=$PWD/build_/lib" \ - tests/playTests.sh - ''; - - LDFLAGS = lib.optionalString stdenv.hostPlatform.isRiscV "-latomic"; - - cmakeFlags = lib.attrsets.mapAttrsToList - (name: value: "-DZSTD_${name}:BOOL=${if value then "ON" else "OFF"}") - { - BUILD_SHARED = !static; - BUILD_STATIC = static; - BUILD_CONTRIB = buildContrib; - PROGRAMS_LINK_SHARED = !static; - LEGACY_SUPPORT = legacySupport; - BUILD_TESTS = doCheck; - }; - - cmakeDir = "../build/cmake"; - dontUseCmakeBuildDir = true; - preConfigure = '' - mkdir -p build_ && cd $_ - ''; - - checkInputs = [ file ]; - inherit doCheck; - checkPhase = '' - runHook preCheck - # Patch shebangs for playTests - patchShebangs ../programs/zstdgrep - ctest -R playTests # The only relatively fast test. - runHook postCheck - ''; - - preInstall = '' - mkdir -p $bin/bin - substituteInPlace ../programs/zstdgrep \ - --replace ":-grep" ":-${gnugrep}/bin/grep" \ - --replace ":-zstdcat" ":-$bin/bin/zstdcat" - - substituteInPlace ../programs/zstdless \ - --replace "zstdcat" "$bin/bin/zstdcat" - '' + lib.optionalString buildContrib ( - '' - cp contrib/pzstd/pzstd $bin/bin/pzstd - '' + lib.optionalString stdenv.isDarwin '' - install_name_tool -change @rpath/libzstd.1.dylib $out/lib/libzstd.1.dylib $bin/bin/pzstd - '' - ); - - outputs = [ "bin" "dev" ] - ++ lib.optional stdenv.hostPlatform.isUnix "man" - ++ [ "out" ]; - - passthru = { - updateScript = nix-update-script { - attrPath = pname; - }; - }; - - meta = with lib; { - description = "Zstandard real-time compression algorithm"; - longDescription = '' - Zstd, short for Zstandard, is a fast lossless compression algorithm, - targeting real-time compression scenarios at zlib-level compression - ratio. Zstd can also offer stronger compression ratio at the cost of - compression speed. Speed/ratio trade-off is configurable by small - increment, to fit different situations. Note however that decompression - speed is preserved and remain roughly the same at all settings, a - property shared by most LZ compression algorithms, such as zlib. - ''; - homepage = "https://facebook.github.io/zstd/"; - changelog = "https://github.com/facebook/zstd/blob/v${version}/CHANGELOG"; - license = with licenses; [ bsd3 ]; # Or, at your opinion, GPL-2.0-only. - - platforms = platforms.all; - maintainers = with maintainers; [ orivej ]; - }; -}