diff --git a/integration_tests/configs/default.jsonnet b/integration_tests/configs/default.jsonnet index f42efc5ac5..dddcb55af0 100644 --- a/integration_tests/configs/default.jsonnet +++ b/integration_tests/configs/default.jsonnet @@ -65,6 +65,19 @@ 'app-config': { 'app-db-backend': 'pebbledb', }, + }, { + coins: '1000000000000000000stake,10000000000000000000000basetcro', + staked: '1000000000000000000stake', + mnemonic: '${VALIDATOR3_MNEMONIC}', + client_config: { + 'broadcast-mode': 'sync', + }, + config: { + db_backend: 'goleveldb', + }, + 'app-config': { + 'app-db-backend': 'goleveldb', + }, }], accounts: [{ name: 'community', diff --git a/integration_tests/test_mempool.py b/integration_tests/test_mempool.py index bdd921cab1..488988848a 100644 --- a/integration_tests/test_mempool.py +++ b/integration_tests/test_mempool.py @@ -61,7 +61,7 @@ def test_mempool(cronos_mempool): print(f"all send tx hash: {sended_hash_set} at {block_num_0}") all_pending = w3.eth.get_filter_changes(filter.filter_id) - assert len(all_pending) == 4 + assert len(all_pending) == len(KEYS.items()) - 1 block_num_1 = w3.eth.get_block_number() print(f"block_num_1 {block_num_1}") diff --git a/integration_tests/test_rollback.py b/integration_tests/test_rollback.py index 9bcce10a3a..040de7a7db 100644 --- a/integration_tests/test_rollback.py +++ b/integration_tests/test_rollback.py @@ -31,8 +31,8 @@ def update_node_cmd(path, cmd, i): def post_init(broken_binary): def inner(path, base_port, config): chain_id = "cronos_777-1" - update_node_cmd(path / chain_id, broken_binary, 2) update_node_cmd(path / chain_id, broken_binary, 3) + update_node_cmd(path / chain_id, broken_binary, 4) return inner @@ -67,10 +67,10 @@ def test_rollback(custom_cronos): - use rollback command to rollback the db. - switch to correct binary should make the node syncing again. - node2: test memiavl node - node3: test iavl node + node3: test memiavl node + node4: test iavl node """ - nodes = [2, 3] + nodes = [3, 4] clis = {i: custom_cronos.cosmos_cli(i) for i in nodes} for i, cli in clis.items(): wait_for_port(ports.rpc_port(custom_cronos.base_port(i))) diff --git a/integration_tests/test_upgrade.py b/integration_tests/test_upgrade.py index f71447c66f..142d5a7429 100644 --- a/integration_tests/test_upgrade.py +++ b/integration_tests/test_upgrade.py @@ -157,7 +157,9 @@ def exec(c, tmp_path_factory): json.dump(json.loads(cli.export()), fp) fp.flush() - c.supervisorctl("start", "cronos_777-1-node0", "cronos_777-1-node1") + c.supervisorctl( + "start", "cronos_777-1-node0", "cronos_777-1-node1", "cronos_777-1-node2" + ) wait_for_port(ports.evmrpc_port(base_port)) wait_for_new_blocks(cli, 1) @@ -278,7 +280,9 @@ def do_upgrade(plan_name, target, mode=None): genesis["genesis_time"] = config.get("genesis-time") file = c.cosmos_cli(i).data_dir / "config/genesis.json" file.write_text(json.dumps(genesis)) - c.supervisorctl("start", "cronos_777-1-node0", "cronos_777-1-node1") + c.supervisorctl( + "start", "cronos_777-1-node0", "cronos_777-1-node1", "cronos_777-1-node2" + ) wait_for_new_blocks(c.cosmos_cli(), 1) height = cli.block_height() diff --git a/integration_tests/test_versiondb.py b/integration_tests/test_versiondb.py index d79dfa5ac3..eece5eebf7 100644 --- a/integration_tests/test_versiondb.py +++ b/integration_tests/test_versiondb.py @@ -72,9 +72,13 @@ def test_versiondb_migration(cronos: Cronos): patch_app_db_backend(cli1.data_dir / "config/app.toml", "rocksdb") print("start all nodes") - print(cronos.supervisorctl("start", "cronos_777-1-node0", "cronos_777-1-node1")) - wait_for_port(ports.evmrpc_port(cronos.base_port(0))) - wait_for_port(ports.evmrpc_port(cronos.base_port(1))) + print( + cronos.supervisorctl( + "start", "cronos_777-1-node0", "cronos_777-1-node1", "cronos_777-1-node2" + ) + ) + for i in range(len(cronos.config["validators"])): + wait_for_port(ports.evmrpc_port(cronos.base_port(i))) assert w3.eth.get_balance(community, block_identifier=block0) == balance0 assert w3.eth.get_balance(community, block_identifier=block1) == balance1 diff --git a/integration_tests/utils.py b/integration_tests/utils.py index c4474d8ce6..5ea3680dbb 100644 --- a/integration_tests/utils.py +++ b/integration_tests/utils.py @@ -36,6 +36,7 @@ ACCOUNTS = { "validator": Account.from_mnemonic(os.getenv("VALIDATOR1_MNEMONIC")), "validator2": Account.from_mnemonic(os.getenv("VALIDATOR2_MNEMONIC")), + "validator3": Account.from_mnemonic(os.getenv("VALIDATOR3_MNEMONIC")), "community": Account.from_mnemonic(os.getenv("COMMUNITY_MNEMONIC")), "signer1": Account.from_mnemonic(os.getenv("SIGNER1_MNEMONIC")), "signer2": Account.from_mnemonic(os.getenv("SIGNER2_MNEMONIC")), diff --git a/scripts/.env b/scripts/.env index 647508dd10..8626f66794 100644 --- a/scripts/.env +++ b/scripts/.env @@ -1,6 +1,7 @@ export PASSWORD='123456' export VALIDATOR1_MNEMONIC="visit craft resemble online window solution west chuckle music diesel vital settle comic tribe project blame bulb armed flower region sausage mercy arrive release" export VALIDATOR2_MNEMONIC="direct travel shrug hand twice agent sail sell jump phone velvet pilot mango charge usual multiply orient garment bleak virtual action mention panda vast" +export VALIDATOR3_MNEMONIC="panda much deny whale fun iron liquid rookie rice ridge artist slush legend salad adapt public all thunder galaxy give ostrich endless prosper good" export COMMUNITY_MNEMONIC="notable error gospel wave pair ugly measure elite toddler cost various fly make eye ketchup despair slab throw tribe swarm word fruit into inmate" export SIGNER1_MNEMONIC="shed crumble dismiss loyal latin million oblige gesture shrug still oxygen custom remove ribbon disorder palace addict again blanket sad flock consider obey popular" export SIGNER2_MNEMONIC="night renew tonight dinner shaft scheme domain oppose echo summer broccoli agent face guitar surface belt veteran siren poem alcohol menu custom crunch index"