diff --git a/go.mod b/go.mod index bb31021030..47b6852168 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( cosmossdk.io/x/upgrade v0.1.1 filippo.io/age v1.1.1 github.com/99designs/keyring v1.2.2 - github.com/cometbft/cometbft v0.38.8 + github.com/cometbft/cometbft v0.38.10-0.20240709120009-0792c8bdda44 github.com/cosmos/cosmos-db v1.0.3-0.20240408151834-e75f6e4b28d8 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/cosmos-sdk v0.50.6 diff --git a/go.sum b/go.sum index 9170aef451..349a59337a 100644 --- a/go.sum +++ b/go.sum @@ -368,6 +368,8 @@ github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONN github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= github.com/cometbft/cometbft v0.38.8 h1:XyJ9Cu3xqap6xtNxiemrO8roXZ+KS2Zlu7qQ0w1trvU= github.com/cometbft/cometbft v0.38.8/go.mod h1:xOoGZrtUT+A5izWfHSJgl0gYZUE7lu7Z2XIS1vWG/QQ= +github.com/cometbft/cometbft v0.38.10-0.20240709120009-0792c8bdda44 h1:Tm6SG54Tj/bGVEZUyFPs2UyG0BYvCO3oqvWNyw99bi4= +github.com/cometbft/cometbft v0.38.10-0.20240709120009-0792c8bdda44/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= diff --git a/gomod2nix.toml b/gomod2nix.toml index bfff3b6461..05674fc185 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -154,8 +154,8 @@ schema = 3 version = "v1.0.0" hash = "sha256-z/0E0NiEGo7zxM7d94ImgUf8P0/KG6hbP9T4Vuym4p0=" [mod."github.com/cometbft/cometbft"] - version = "v0.38.8" - hash = "sha256-FJ04SP2VDpkvNGRGojaNeuwCqC54Deru244YJERAmi8=" + version = "v0.38.10-0.20240709120009-0792c8bdda44" + hash = "sha256-ZKAAgJ78Z1Mgww2D8BZz9Qug/m3CXWa9MKM8W4CTbGI=" [mod."github.com/cometbft/cometbft-db"] version = "v0.0.0-20231011055109-57922ac52a63" hash = "sha256-iLs/FN1be3AcoyhKj2+b5Msqeat9j2ja4acyOs+w+Uk=" diff --git a/integration_tests/test_upgrade.py b/integration_tests/test_upgrade.py index f15c0e1faf..f32cb18a1c 100644 --- a/integration_tests/test_upgrade.py +++ b/integration_tests/test_upgrade.py @@ -7,6 +7,7 @@ from pathlib import Path import pytest +import requests from pystarport import ports from pystarport.cluster import SUPERVISOR_CONFIG_FILE @@ -33,6 +34,15 @@ def custom_cronos(tmp_path_factory): yield from setup_cronos_test(tmp_path_factory) +def get_txs(base_port, end): + port = ports.rpc_port(base_port) + res = [] + for h in range(1, end): + url = f"http://127.0.0.1:{port}/block_results?height={h}" + res.append(requests.get(url).json().get("result")["txs_results"]) + return res + + def init_cosmovisor(home): """ build and setup cosmovisor directory structure in each node's home directory @@ -108,7 +118,8 @@ def exec(c, tmp_path_factory): - it should work transparently """ cli = c.cosmos_cli() - port = ports.api_port(c.base_port(0)) + base_port = c.base_port(0) + port = ports.api_port(base_port) send_enable = [ {"denom": "basetcro", "enabled": False}, {"denom": "stake", "enabled": True}, @@ -125,7 +136,7 @@ def exec(c, tmp_path_factory): fp.flush() c.supervisorctl("start", "cronos_777-1-node0", "cronos_777-1-node1") - wait_for_port(ports.evmrpc_port(c.base_port(0))) + wait_for_port(ports.evmrpc_port(base_port)) wait_for_new_blocks(cli, 1) def do_upgrade(plan_name, target, mode=None): @@ -150,7 +161,7 @@ def do_upgrade(plan_name, target, mode=None): ) # block should pass the target height wait_for_block(c.cosmos_cli(), target + 2, timeout=480) - wait_for_port(ports.rpc_port(c.base_port(0))) + wait_for_port(ports.rpc_port(base_port)) # test migrate keystore cli.migrate_keystore() @@ -162,7 +173,7 @@ def do_upgrade(plan_name, target, mode=None): cli = c.cosmos_cli() # check basic tx works - wait_for_port(ports.evmrpc_port(c.base_port(0))) + wait_for_port(ports.evmrpc_port(base_port)) receipt = send_transaction( c.w3, { @@ -198,7 +209,7 @@ def do_upgrade(plan_name, target, mode=None): cli = c.cosmos_cli() # check basic tx works - wait_for_port(ports.evmrpc_port(c.base_port(0))) + wait_for_port(ports.evmrpc_port(base_port)) receipt = send_transaction( c.w3, { @@ -227,7 +238,7 @@ def do_upgrade(plan_name, target, mode=None): ADDRS["validator"] ) # check consensus params - port = ports.rpc_port(c.base_port(0)) + port = ports.rpc_port(base_port) res = get_consensus_params(port, w3.eth.get_block_number()) assert res["block"]["max_gas"] == "60000000" @@ -262,7 +273,9 @@ def do_upgrade(plan_name, target, mode=None): height = cli.block_height() target_height2 = height + 15 print("upgrade v1.3 height", target_height2) + txs = get_txs(base_port, height) do_upgrade("v1.3", target_height2) + assert txs == get_txs(base_port, height) cli = c.cosmos_cli() assert e0 == cli.query_params("evm", height=target_height0 - 1)["params"]