From 7273fbabbc4f97ed41df6816384559a430af76ca Mon Sep 17 00:00:00 2001 From: yarkin Date: Tue, 27 Feb 2024 09:27:01 +0800 Subject: [PATCH 01/13] Try update to leap 5 --- .cicd/defaults.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.cicd/defaults.json b/.cicd/defaults.json index ea2c077..5116a4a 100644 --- a/.cicd/defaults.json +++ b/.cicd/defaults.json @@ -1,10 +1,10 @@ { "leap-dev":{ - "target":"4", + "target":"5", "prerelease":false }, "leap":{ - "target":"4", + "target":"5", "prerelease":false }, "cdt":{ From f0717163c69aec80d3c346a494542e7abf3de541 Mon Sep 17 00:00:00 2001 From: yarkin Date: Tue, 27 Feb 2024 12:36:37 +0800 Subject: [PATCH 02/13] Update ci --- .github/workflows/node.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 0cb1378..035ea25 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -62,7 +62,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 1 submodules: 'false' @@ -131,7 +131,7 @@ jobs: private_key: ${{ secrets.TRUSTEVM_CI_APP_KEY }} - name: Checkout Repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 submodules: 'recursive' @@ -250,8 +250,9 @@ jobs: repo: leap target: '${{needs.versions.outputs.leap-dev-target}}' prereleases: ${{fromJSON(needs.versions.outputs.leap-dev-prerelease)}} - file: 'leap-dev.*(x86_64|amd64).deb' + file: 'leap-dev.*ubuntu22\.04_amd64.deb' container-package: experimental-binaries + artifact-name: leap-dev-ubuntu22-amd64 token: ${{ secrets.GITHUB_TOKEN }} - name: Download leap binary @@ -300,7 +301,7 @@ jobs: private_key: ${{ secrets.TRUSTEVM_CI_APP_KEY }} - name: Checkout eos-evm-miner - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: eosnetworkfoundation/eos-evm-miner path: eos-evm-miner From 39459fda4d4b963f25387ee6b9aa7d4b37180d52 Mon Sep 17 00:00:00 2001 From: yarkin Date: Tue, 27 Feb 2024 14:08:02 +0800 Subject: [PATCH 03/13] Update cicd --- .github/workflows/node.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 035ea25..8f865ba 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -255,16 +255,6 @@ jobs: artifact-name: leap-dev-ubuntu22-amd64 token: ${{ secrets.GITHUB_TOKEN }} - - name: Download leap binary - uses: AntelopeIO/asset-artifact-download-action@v3 - with: - owner: AntelopeIO - repo: leap - target: '${{needs.versions.outputs.leap-target}}' - prereleases: ${{fromJSON(needs.versions.outputs.leap-prerelease)}} - file: 'leap.*${{matrix.platform}}.*(x86_64|amd64).deb' - token: ${{ secrets.GITHUB_TOKEN }} - - name: Install Leap run: | apt-get install -y ./leap*.deb From 77fa2d25141bb7315c106e0f4cdc40ccbd59e4a3 Mon Sep 17 00:00:00 2001 From: yarkin Date: Tue, 27 Feb 2024 15:13:04 +0800 Subject: [PATCH 04/13] Try fix the failure --- tests/nodeos_eos_evm_test.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py index 0833a1f..1c6fe53 100755 --- a/tests/nodeos_eos_evm_test.py +++ b/tests/nodeos_eos_evm_test.py @@ -68,12 +68,9 @@ appArgs.add(flag="--genesis-json", type=str, help="File to save generated genesis json", default="eos-evm-genesis.json") appArgs.add(flag="--use-miner", type=str, help="EOS EVM miner to use to send trx to nodeos", default=None) -args=TestHelper.parse_args({"--keep-logs","--dump-error-details","-v","--leave-running","--clean-run" }, applicationSpecificArgs=appArgs) +args=TestHelper.parse_args({"--dump-error-details","-v" }, applicationSpecificArgs=appArgs) debug=args.v -killEosInstances= not args.leave_running dumpErrorDetails=args.dump_error_details -keepLogs=args.keep_logs -killAll=args.clean_run eosEvmContractRoot=args.eos_evm_contract_root eosEvmBuildRoot=args.eos_evm_build_root genesisJson=args.genesis_json @@ -977,14 +974,14 @@ def get_block(num): testSuccessful= not foundErr finally: - TestHelper.shutdown(cluster, walletMgr, testSuccessful=testSuccessful, killEosInstances=killEosInstances, killWallet=killEosInstances, keepLogs=keepLogs, cleanRun=killAll, dumpErrorDetails=dumpErrorDetails) - if killEosInstances: - if evmNodePOpen is not None: - evmNodePOpen.kill() - if evmRPCPOpen is not None: - evmRPCPOpen.kill() - if eosEvmMinerPOpen is not None: - eosEvmMinerPOpen.kill() + TestHelper.shutdown(cluster, walletMgr, testSuccessful=testSuccessful, dumpErrorDetails=dumpErrorDetails) + if evmNodePOpen is not None: + evmNodePOpen.kill() + if evmRPCPOpen is not None: + evmRPCPOpen.kill() + if eosEvmMinerPOpen is not None: + eosEvmMinerPOpen.kill() + exitCode = 0 if testSuccessful else 1 exit(exitCode) From 075a9b12481ba62168318586babfddad0a6e8d11 Mon Sep 17 00:00:00 2001 From: yarkin Date: Tue, 27 Feb 2024 15:43:22 +0800 Subject: [PATCH 05/13] update test script --- tests/nodeos_eos_evm_test.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py index 1c6fe53..a71190f 100755 --- a/tests/nodeos_eos_evm_test.py +++ b/tests/nodeos_eos_evm_test.py @@ -68,8 +68,9 @@ appArgs.add(flag="--genesis-json", type=str, help="File to save generated genesis json", default="eos-evm-genesis.json") appArgs.add(flag="--use-miner", type=str, help="EOS EVM miner to use to send trx to nodeos", default=None) -args=TestHelper.parse_args({"--dump-error-details","-v" }, applicationSpecificArgs=appArgs) +args=TestHelper.parse_args({"--keep-logs","--dump-error-details","-v","--leave-running"}, applicationSpecificArgs=appArgs) debug=args.v +killEosInstances= not args.leave_running dumpErrorDetails=args.dump_error_details eosEvmContractRoot=args.eos_evm_contract_root eosEvmBuildRoot=args.eos_evm_build_root @@ -85,7 +86,7 @@ testSuccessful=False random.seed(seed) # Use a fixed seed for repeatability. -cluster=Cluster(walletd=True) +cluster=Cluster(keepRunning=args.leave_running, keepLogs=args.keep_logs) walletMgr=WalletMgr(True) pnodes=1 @@ -975,12 +976,13 @@ def get_block(num): testSuccessful= not foundErr finally: TestHelper.shutdown(cluster, walletMgr, testSuccessful=testSuccessful, dumpErrorDetails=dumpErrorDetails) - if evmNodePOpen is not None: - evmNodePOpen.kill() - if evmRPCPOpen is not None: - evmRPCPOpen.kill() - if eosEvmMinerPOpen is not None: - eosEvmMinerPOpen.kill() + if killEosInstances: + if evmNodePOpen is not None: + evmNodePOpen.kill() + if evmRPCPOpen is not None: + evmRPCPOpen.kill() + if eosEvmMinerPOpen is not None: + eosEvmMinerPOpen.kill() exitCode = 0 if testSuccessful else 1 From 9259b51a4ea59deb212fba2d3cf431105c9ca0ae Mon Sep 17 00:00:00 2001 From: yarkin Date: Tue, 27 Feb 2024 16:27:53 +0800 Subject: [PATCH 06/13] Seems need leap as well. --- .github/workflows/node.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 8f865ba..ce4845d 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -255,6 +255,16 @@ jobs: artifact-name: leap-dev-ubuntu22-amd64 token: ${{ secrets.GITHUB_TOKEN }} + - name: Download leap binary + uses: AntelopeIO/asset-artifact-download-action@v3 + with: + owner: AntelopeIO + repo: leap + target: '${{needs.versions.outputs.leap-target}}' + prereleases: ${{fromJSON(needs.versions.outputs.leap-prerelease)}} + file: 'leap.*ubuntu22\.04_amd64.deb' + token: ${{ secrets.GITHUB_TOKEN }} + - name: Install Leap run: | apt-get install -y ./leap*.deb From 0df8670b6c6d7d91074f0cd4e11d335dcf05c21f Mon Sep 17 00:00:00 2001 From: yarkin Date: Tue, 27 Feb 2024 17:04:07 +0800 Subject: [PATCH 07/13] update ci --- .github/workflows/node.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index ce4845d..2176c99 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -262,7 +262,8 @@ jobs: repo: leap target: '${{needs.versions.outputs.leap-target}}' prereleases: ${{fromJSON(needs.versions.outputs.leap-prerelease)}} - file: 'leap.*ubuntu22\.04_amd64.deb' + file: 'leap_.*_amd64.deb' + artifact-name: leap-deb-amd64 token: ${{ secrets.GITHUB_TOKEN }} - name: Install Leap From a58ca18833f3ee0edddbd86c163aa2f8efc03a58 Mon Sep 17 00:00:00 2001 From: yarkin Date: Tue, 27 Feb 2024 17:36:55 +0800 Subject: [PATCH 08/13] update test script --- tests/nodeos_eos_evm_test.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py index a71190f..cd4a659 100755 --- a/tests/nodeos_eos_evm_test.py +++ b/tests/nodeos_eos_evm_test.py @@ -244,11 +244,6 @@ def makeReservedEvmAddress(account): cluster.setWalletMgr(walletMgr) - cluster.killall(allInstances=killAll) - cluster.cleanup() - walletMgr.killall(allInstances=killAll) - walletMgr.cleanup() - specificExtraNodeosArgs={} shipNodeNum = total_nodes - 1 specificExtraNodeosArgs[shipNodeNum]="--plugin eosio::state_history_plugin --state-history-endpoint 127.0.0.1:8999 --trace-history --chain-state-history --disable-replay-opts " From ad0ed62447b87d704e465f542bcf26d9f52a48eb Mon Sep 17 00:00:00 2001 From: yarkin Date: Tue, 27 Feb 2024 19:51:19 +0800 Subject: [PATCH 09/13] update test script --- tests/nodeos_eos_evm_server.py | 15 +++++---------- tests/nodeos_eos_evm_test.py | 4 ++-- tests/nodeos_eos_evm_ws_test_basic.py | 16 ++++------------ tests/nodeos_eos_evm_ws_test_fork.py | 16 ++++------------ 4 files changed, 15 insertions(+), 36 deletions(-) diff --git a/tests/nodeos_eos_evm_server.py b/tests/nodeos_eos_evm_server.py index 585804b..0c1aa61 100755 --- a/tests/nodeos_eos_evm_server.py +++ b/tests/nodeos_eos_evm_server.py @@ -20,7 +20,7 @@ sys.path.append(os.getcwd()) sys.path.append(os.path.join(os.getcwd(), "tests")) -from TestHarness import Cluster, TestHelper, Utils, WalletMgr +from TestHarness import Cluster, TestHelper, Utils, WalletMgr, createAccountKeys from TestHarness.TestHelper import AppArgs from TestHarness.testUtils import ReturnType from TestHarness.core_symbol import CORE_SYMBOL @@ -70,12 +70,11 @@ appArgs.add(flag="--read-endpoint", type=str, help="EVM read endpoint (eos-evm-rpc)", default="http://localhost:8881") appArgs.add(flag="--use-eos-vm-oc", type=bool, help="EOS EVM Contract build dir", default=False) -args=TestHelper.parse_args({"--keep-logs","--dump-error-details","-v","--leave-running","--clean-run" }, applicationSpecificArgs=appArgs) +args=TestHelper.parse_args({"--keep-logs","--dump-error-details","-v","--leave-running" }, applicationSpecificArgs=appArgs) debug=args.v killEosInstances= not args.leave_running dumpErrorDetails=args.dump_error_details keepLogs=args.keep_logs -killAll=args.clean_run eosEvmContractRoot=args.eos_evm_contract_root eosEvmBridgeContractsRoot=args.eos_evm_bridge_contracts_root gensisJson=args.genesis_json @@ -94,7 +93,7 @@ testSuccessful=False random.seed(seed) # Use a fixed seed for repeatability. -cluster=Cluster(walletd=True) +cluster=Cluster(keepRunning=args.leave_running, keepLogs=args.keep_logs) walletMgr=WalletMgr(True) @@ -102,10 +101,6 @@ TestHelper.printSystemInfo("BEGIN") cluster.setWalletMgr(walletMgr) - cluster.killall(allInstances=killAll) - cluster.cleanup() - walletMgr.killall(allInstances=killAll) - walletMgr.cleanup() # *** setup topogrophy *** @@ -146,7 +141,7 @@ if eosEvmBridgeContractsRoot: total_accounts_to_create += 3 - accounts=cluster.createAccountKeys(total_accounts_to_create) + accounts=createAccountKeys(total_accounts_to_create) if accounts is None: Utils.errorExit("FAILURE - create keys") @@ -497,7 +492,7 @@ def forward_request(req): app.run(host='0.0.0.0', port=5000) finally: - TestHelper.shutdown(cluster, walletMgr, testSuccessful=testSuccessful, killEosInstances=killEosInstances, killWallet=killEosInstances, keepLogs=keepLogs, cleanRun=killAll, dumpErrorDetails=dumpErrorDetails) + TestHelper.shutdown(cluster, walletMgr, testSuccessful=testSuccessful, dumpErrorDetails=dumpErrorDetails) exitCode = 0 if testSuccessful else 1 exit(exitCode) diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py index cd4a659..c476743 100755 --- a/tests/nodeos_eos_evm_test.py +++ b/tests/nodeos_eos_evm_test.py @@ -27,7 +27,7 @@ os.environ["CORE_SYMBOL_NAME"]='EOS' print(f"CORE_SYMBOL_NAME: {os.environ.get('CORE_SYMBOL_NAME')}") -from TestHarness import Cluster, TestHelper, Utils, WalletMgr, CORE_SYMBOL +from TestHarness import Cluster, TestHelper, Utils, WalletMgr, CORE_SYMBOL, createAccountKeys from TestHarness.TestHelper import AppArgs from TestHarness.testUtils import ReturnType from TestHarness.testUtils import unhandledEnumType @@ -263,7 +263,7 @@ def makeReservedEvmAddress(account): prodNode = cluster.getNode(0) nonProdNode = cluster.getNode(1) - accounts=cluster.createAccountKeys(5) + accounts=createAccountKeys(5) if accounts is None: Utils.errorExit("FAILURE - create keys") diff --git a/tests/nodeos_eos_evm_ws_test_basic.py b/tests/nodeos_eos_evm_ws_test_basic.py index cbde096..a37dd9d 100755 --- a/tests/nodeos_eos_evm_ws_test_basic.py +++ b/tests/nodeos_eos_evm_ws_test_basic.py @@ -28,7 +28,7 @@ os.environ["CORE_SYMBOL_NAME"]='EOS' print(f"CORE_SYMBOL_NAME: {os.environ.get('CORE_SYMBOL_NAME')}") -from TestHarness import Cluster, TestHelper, Utils, WalletMgr, CORE_SYMBOL +from TestHarness import Cluster, TestHelper, Utils, WalletMgr, CORE_SYMBOL, createAccountKeys from TestHarness.TestHelper import AppArgs from TestHarness.testUtils import ReturnType from TestHarness.testUtils import unhandledEnumType @@ -61,12 +61,11 @@ appArgs.add(flag="--eos-evm-build-root", type=str, help="EOS EVM build dir", default=None) appArgs.add(flag="--genesis-json", type=str, help="File to save generated genesis json", default="eos-evm-genesis.json") -args=TestHelper.parse_args({"--keep-logs","--dump-error-details","-v","--leave-running","--clean-run" }, applicationSpecificArgs=appArgs) +args=TestHelper.parse_args({"--keep-logs","--dump-error-details","-v","--leave-running" }, applicationSpecificArgs=appArgs) debug=args.v killEosInstances= not args.leave_running dumpErrorDetails=args.dump_error_details keepLogs=args.keep_logs -killAll=False # args.clean_run eosEvmContractRoot=args.eos_evm_contract_root eosEvmBuildRoot=args.eos_evm_build_root genesisJson=args.genesis_json @@ -80,7 +79,7 @@ testSuccessful=False random.seed(seed) # Use a fixed seed for repeatability. -cluster=Cluster(walletd=True) +cluster=Cluster(keepRunning=args.leave_running, keepLogs=args.keep_logs) walletMgr=WalletMgr(True) pnodes=1 @@ -216,13 +215,6 @@ def makeReservedEvmAddress(account): cluster.setWalletMgr(walletMgr) - cluster.killall(allInstances=killAll) - # cluster.killSomeEosInstances(killCount=999) # used for main branch of leap - cluster.cleanup() - walletMgr.killall(allInstances=killAll) # leap 4.0? - # walletMgr.shutdown() # used for main branch of leap - walletMgr.cleanup() - specificExtraNodeosArgs={} shipNodeNum = total_nodes - 1 specificExtraNodeosArgs[shipNodeNum]="--plugin eosio::state_history_plugin --state-history-endpoint 127.0.0.1:8999 --trace-history --chain-state-history --disable-replay-opts " @@ -242,7 +234,7 @@ def makeReservedEvmAddress(account): prodNode = cluster.getNode(0) nonProdNode = cluster.getNode(1) - accounts=cluster.createAccountKeys(3) + accounts=createAccountKeys(3) if accounts is None: Utils.errorExit("FAILURE - create keys") diff --git a/tests/nodeos_eos_evm_ws_test_fork.py b/tests/nodeos_eos_evm_ws_test_fork.py index 0ca9d11..209cbc0 100755 --- a/tests/nodeos_eos_evm_ws_test_fork.py +++ b/tests/nodeos_eos_evm_ws_test_fork.py @@ -28,7 +28,7 @@ os.environ["CORE_SYMBOL_NAME"]='EOS' print(f"CORE_SYMBOL_NAME: {os.environ.get('CORE_SYMBOL_NAME')}") -from TestHarness import Cluster, TestHelper, Utils, WalletMgr, CORE_SYMBOL +from TestHarness import Cluster, TestHelper, Utils, WalletMgr, CORE_SYMBOL, createAccountKeys from TestHarness.TestHelper import AppArgs from TestHarness.testUtils import ReturnType from TestHarness.testUtils import unhandledEnumType @@ -150,12 +150,11 @@ def getMinHeadAndLib(prodNodes): appArgs.add(flag="--eos-evm-build-root", type=str, help="EOS EVM build dir", default=None) appArgs.add(flag="--genesis-json", type=str, help="File to save generated genesis json", default="eos-evm-genesis.json") -args=TestHelper.parse_args({"--keep-logs","--dump-error-details","-v","--leave-running","--clean-run" }, applicationSpecificArgs=appArgs) +args=TestHelper.parse_args({"--keep-logs","--dump-error-details","-v","--leave-running" }, applicationSpecificArgs=appArgs) debug=args.v killEosInstances= not args.leave_running dumpErrorDetails=args.dump_error_details keepLogs=args.keep_logs -killAll=False # args.clean_run eosEvmContractRoot=args.eos_evm_contract_root eosEvmBuildRoot=args.eos_evm_build_root genesisJson=args.genesis_json @@ -175,7 +174,7 @@ def getMinHeadAndLib(prodNodes): testSuccessful=False random.seed(seed) # Use a fixed seed for repeatability. -cluster=Cluster(walletd=True) +cluster=Cluster(keepRunning=args.leave_running, keepLogs=args.keep_logs) walletMgr=WalletMgr(True) evmNodePOpen = None @@ -309,13 +308,6 @@ def makeReservedEvmAddress(account): cluster.setWalletMgr(walletMgr) - cluster.killall(allInstances=killAll) - # cluster.killSomeEosInstances(killCount=999) # used for main branch of leap - cluster.cleanup() - walletMgr.killall(allInstances=killAll) # leap 4.0? - # walletMgr.shutdown() # used for main branch of leap - walletMgr.cleanup() - specificExtraNodeosArgs={} shipNodeNum = 0 specificExtraNodeosArgs[shipNodeNum]="--plugin eosio::state_history_plugin --state-history-endpoint 127.0.0.1:8999 --trace-history --chain-state-history --disable-replay-opts " @@ -363,7 +355,7 @@ def makeReservedEvmAddress(account): cluster.waitOnClusterSync(blockAdvancing=5) cluster.biosNode.kill(signal.SIGTERM) - accounts=cluster.createAccountKeys(3) + accounts=createAccountKeys(3) if accounts is None: Utils.errorExit("FAILURE - create keys") From 6856ddb86f5eda56f3b12031e07dfc0fafcfb597 Mon Sep 17 00:00:00 2001 From: kayan Date: Wed, 28 Feb 2024 20:15:49 +0800 Subject: [PATCH 10/13] fix test case with leap 5 and latest contract changes --- tests/nodeos_eos_evm_test.py | 139 ++++++++--------------------------- 1 file changed, 30 insertions(+), 109 deletions(-) diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py index c476743..267b41a 100755 --- a/tests/nodeos_eos_evm_test.py +++ b/tests/nodeos_eos_evm_test.py @@ -200,7 +200,7 @@ def processUrllibRequest(endpoint, payload={}, silentErrors=False, exitOnError=F def getGasPrice(): if useMiner is None: - return 1 + return 10000000000 else: result = processUrllibRequest("http://127.0.0.1:18888", payload={"method":"eth_gasPrice","params":[],"id":1,"jsonrpc":"2.0"}) Utils.Print("result: ", result) @@ -246,12 +246,13 @@ def makeReservedEvmAddress(account): specificExtraNodeosArgs={} shipNodeNum = total_nodes - 1 - specificExtraNodeosArgs[shipNodeNum]="--plugin eosio::state_history_plugin --state-history-endpoint 127.0.0.1:8999 --trace-history --chain-state-history --disable-replay-opts " + specificExtraNodeosArgs[shipNodeNum]="--plugin eosio::state_history_plugin --state-history-endpoint 127.0.0.1:8999 --trace-history --chain-state-history --disable-replay-opts " extraNodeosArgs="--contracts-console --resource-monitor-not-shutdown-on-threshold-exceeded" Print("Stand up cluster") - if cluster.launch(pnodes=pnodes, totalNodes=total_nodes, extraNodeosArgs=extraNodeosArgs, specificExtraNodeosArgs=specificExtraNodeosArgs) is False: + time.sleep(5.0) + if cluster.launch(pnodes=pnodes, totalNodes=total_nodes, extraNodeosArgs=extraNodeosArgs, specificExtraNodeosArgs=specificExtraNodeosArgs,delay=5) is False: errorExit("Failed to stand up eos cluster.") Print ("Wait for Cluster stabilization") @@ -331,7 +332,7 @@ def makeReservedEvmAddress(account): cmd="set account permission " + defertest2Acc.name + " active --add-code -p " + defertest2Acc.name + "@active" prodNode.processCleosCmd(cmd, cmd, silentErrors=False, returnType=ReturnType.raw) - trans = prodNode.pushMessage(evmAcc.name, "init", '{{"chainid":15555, "fee_params": {{"gas_price": "10000000000", "miner_cut": 100000, "ingress_bridge_fee": "0.0000 {0}"}}}}'.format(CORE_SYMBOL), '-p eosio.evm') + trans = prodNode.pushMessage(evmAcc.name, "init", '{{"chainid":15555, "fee_params": {{"gas_price": "10000000000", "miner_cut": 10000, "ingress_bridge_fee": "0.0000 {0}"}}}}'.format(CORE_SYMBOL), '-p eosio.evm') prodNode.waitForTransBlockIfNeeded(trans[1], True) transId=prodNode.getTransId(trans[1]) blockNum = prodNode.getBlockNumByTransId(transId) @@ -396,7 +397,7 @@ def makeReservedEvmAddress(account): Utils.Print("addys: [{0}] [{1}] [{2}]".format(i,k[2:].lower(), len(k[2:]))) transferAmount="1000000.0000 {0}".format(CORE_SYMBOL) Print("Transfer funds %s from account %s to %s" % (transferAmount, cluster.eosioAccount.name, evmAcc.name)) - prodNode.transferFunds(cluster.eosioAccount, evmAcc, transferAmount, "0x" + k[2:].lower(), waitForTransBlock=True) + nonProdNode.transferFunds(cluster.eosioAccount, evmAcc, transferAmount, "0x" + k[2:].lower(), waitForTransBlock=True) if not (i+1) % 20: time.sleep(1) Utils.Print("Send balance") @@ -537,11 +538,11 @@ def makeReservedEvmAddress(account): # EOS -> EVM transferAmount="97.5321 {0}".format(CORE_SYMBOL) Print("Transfer funds %s from account %s to %s" % (transferAmount, testAcc.name, evmAcc.name)) - prodNode.transferFunds(testAcc, evmAcc, transferAmount, "0xF0cE7BaB13C99bA0565f426508a7CD8f4C247E5a", waitForTransBlock=True) + nonProdNode.transferFunds(testAcc, evmAcc, transferAmount, "0xF0cE7BaB13C99bA0565f426508a7CD8f4C247E5a", waitForTransBlock=True) row0=prodNode.getTableRow(evmAcc.name, evmAcc.name, "balances", 0) Utils.Print("\tAfter transfer table row:", row0) - assert(row0["balance"]["balance"] == "1.0100 {0}".format(CORE_SYMBOL)) # should have fee at end of transaction + assert(row0["balance"]["balance"] == "1.0126 {0}".format(CORE_SYMBOL)) # should have fee at end of transaction testAccActualAmount=prodNode.getAccountEosBalanceStr(evmAcc.name) Utils.Print("\tEVM Account balance %s" % testAccActualAmount) expectedAmount="60000097.5321 {0}".format(CORE_SYMBOL) @@ -553,16 +554,18 @@ def makeReservedEvmAddress(account): if testAccActualAmount != expectedAmount: Utils.errorExit("Transfer verification failed. Excepted %s, actual: %s" % (expectedAmount, testAccActualAmount)) row3=prodNode.getTableRow(evmAcc.name, evmAcc.name, "account", 3) # 3rd balance of this integration test + + Utils.Print("\tcurrent evm account balance:", row3) assert(row3["eth_address"] == "f0ce7bab13c99ba0565f426508a7cd8f4c247e5a") assert(row3["balance"] == "000000000000000000000000000000000000000000000005496419417a1f4000") # 0x5496419417a1f4000 => 97522100000000000000 (97.5321 - 0.0100) # EOS -> EVM to the same address transferAmount="10.0000 {0}".format(CORE_SYMBOL) Print("Transfer funds %s from account %s to %s" % (transferAmount, testAcc.name, evmAcc.name)) - prodNode.transferFunds(testAcc, evmAcc, transferAmount, "0xF0cE7BaB13C99bA0565f426508a7CD8f4C247E5a", waitForTransBlock=True) + nonProdNode.transferFunds(testAcc, evmAcc, transferAmount, "0xF0cE7BaB13C99bA0565f426508a7CD8f4C247E5a", waitForTransBlock=True) row0=prodNode.getTableRow(evmAcc.name, evmAcc.name, "balances", 0) - Utils.Print("\tAfter transfer table row:", row0) - assert(row0["balance"]["balance"] == "1.0200 {0}".format(CORE_SYMBOL)) # should have fee from both transfers + Utils.Print("\tcurrent evm account balance:", row0) + assert(row0["balance"]["balance"] == "1.0226 {0}".format(CORE_SYMBOL)) # should have fee from both transfers evmAccActualAmount=prodNode.getAccountEosBalanceStr(evmAcc.name) Utils.Print("\tEVM Account balance %s" % evmAccActualAmount) expectedAmount="60000107.5321 {0}".format(CORE_SYMBOL) @@ -574,16 +577,18 @@ def makeReservedEvmAddress(account): if testAccActualAmount != expectedAmount: Utils.errorExit("Transfer verification failed. Excepted %s, actual: %s" % (expectedAmount, testAccActualAmount)) row3=prodNode.getTableRow(evmAcc.name, evmAcc.name, "account", 3) # 3rd balance of this integration test + + Utils.Print("\tcurrent evm account balance:", row3) assert(row3["eth_address"] == "f0ce7bab13c99ba0565f426508a7cd8f4c247e5a") assert(row3["balance"] == "000000000000000000000000000000000000000000000005d407b55394464000") # 0x5d407b55394464000 => 107512100000000000000 (97.5321 + 10.000 - 0.0100 - 0.0100) # EOS -> EVM to diff address transferAmount="42.4242 {0}".format(CORE_SYMBOL) Print("Transfer funds %s from account %s to %s" % (transferAmount, testAcc.name, evmAcc.name)) - prodNode.transferFunds(testAcc, evmAcc, transferAmount, "0x9E126C57330FA71556628e0aabd6B6B6783d99fA", waitForTransBlock=True) + nonProdNode.transferFunds(testAcc, evmAcc, transferAmount, "0x9E126C57330FA71556628e0aabd6B6B6783d99fA", waitForTransBlock=True) row0=prodNode.getTableRow(evmAcc.name, evmAcc.name, "balances", 0) Utils.Print("\tAfter transfer table row:", row0) - assert(row0["balance"]["balance"] == "1.0300 {0}".format(CORE_SYMBOL)) # should have fee from all three transfers + assert(row0["balance"]["balance"] == "1.0326 {0}".format(CORE_SYMBOL)) # should have fee from all three transfers evmAccActualAmount=prodNode.getAccountEosBalanceStr(evmAcc.name) Utils.Print("\tEVM Account balance %s" % evmAccActualAmount) expectedAmount="60000149.9563 {0}".format(CORE_SYMBOL) @@ -687,8 +692,8 @@ def makeReservedEvmAddress(account): accSpecialKey = '344260572d5df010d70597386bfeeaecf863a8dbbe3c9a023f81d7056b28815f' accSpecialAdd = w3.eth.account.from_key(accSpecialKey).address - prodNode.transferFunds(testAcc, evmAcc, "10.0000 EOS", "0x0290ffefa58ee84a3641770ab910c48d3441752d", waitForTransBlock=True) - prodNode.transferFunds(testAcc, evmAcc, "1000.0000 EOS", accSpecialAdd, waitForTransBlock=True) + nonProdNode.transferFunds(testAcc, evmAcc, "10.0000 EOS", "0x0290ffefa58ee84a3641770ab910c48d3441752d", waitForTransBlock=True) + nonProdNode.transferFunds(testAcc, evmAcc, "1000.0000 EOS", accSpecialAdd, waitForTransBlock=True) # Test special signature handling (contract and evm-node) Print("Test special signature handling (both contract and evm-node)") @@ -719,109 +724,25 @@ def makeReservedEvmAddress(account): ), accSpecialKey) actData = {"miner":minerAcc.name, "rlptx":Web3.to_hex(signed_trx.rawTransaction)[2:]} - trans = prodNode.pushMessage(evmAcc.name, "pushtx", json.dumps(actData), '-p {0}'.format(minerAcc.name), silentErrors=True) + trans = prodNode.pushMessage(evmAcc.name, "pushtx", json.dumps(actData), '-p {0}'.format(minerAcc.name), silentErrors=False) prodNode.waitForTransBlockIfNeeded(trans[1], True); # Test special signature: Call from miner account + nonProdNode.transferFunds(cluster.eosioAccount, evmAcc, "10.0000 EOS", minerAcc.name, waitForTransBlock=True) actData = {"from":minerAcc.name, "to":increment_contract[2:], "value":"0000000000000000000000000000000000000000000000000000000000000000", "data":"d09de08a", "gas_limit":"100000"} - trans = prodNode.pushMessage(evmAcc.name, "call", json.dumps(actData), '-p {0}'.format(minerAcc.name), silentErrors=True) + trans = prodNode.pushMessage(evmAcc.name, "call", json.dumps(actData), '-p {0}'.format(minerAcc.name), silentErrors=False) + + Utils.Print("eosio.evm::call trans result", trans) prodNode.waitForTransBlockIfNeeded(trans[1], True); # Test special signature: Call from `0x0290ffefa58ee84a3641770ab910c48d3441752d` - prodNode.transferFunds(testAcc, evmAcc, "10.0000 EOS", "0x0290ffefa58ee84a3641770ab910c48d3441752d", waitForTransBlock=True) + nonProdNode.transferFunds(testAcc, evmAcc, "10.0000 EOS", "0x0290ffefa58ee84a3641770ab910c48d3441752d", waitForTransBlock=True) actData = {"from":"0290ffefa58ee84a3641770ab910c48d3441752d", "to":increment_contract[2:], "value":"0000000000000000000000000000000000000000000000000000000000000000", "data":"d09de08a", "gas_limit":"100000"} - trans = prodNode.pushMessage(evmAcc.name, "admincall", json.dumps(actData), '-p {0}'.format(evmAcc.name), silentErrors=True) + trans = prodNode.pushMessage(evmAcc.name, "admincall", json.dumps(actData), '-p {0}'.format(evmAcc.name), silentErrors=False) prodNode.waitForTransBlockIfNeeded(trans[1], True); ### Special signature test (end) - # test hard-failed transaction (with --delay-sec) - amount=7.0000 - transferAmount="7.000 {0}".format(CORE_SYMBOL) - Print("Test hard-failed EVM transaction (with delay)") - signed_trx = w3.eth.account.sign_transaction(dict( - nonce=nonce + 1000, # Wrong nonce -> should hard fails - gas=100000, #100k Gas - gasPrice=gasP, - to=Web3.to_checksum_address(toAdd), - value=int(amount*10000*szabo*100), - data=b'', - chainId=evmChainId - ), evmSendKey) - actData = {"miner":minerAcc.name, "rlptx":Web3.to_hex(signed_trx.rawTransaction)[2:]} - cmd="push action " + evmAcc.name + " pushtx \"" + json.dumps(actData).replace("\"","\\\"") + "\" --delay-sec 2 -p " + minerAcc.name - trans=prodNode.processCleosCmd(cmd, cmd, silentErrors=False, returnType=ReturnType.raw) - #Utils.Print(f"trans is {trans}"); - time.sleep(4) # sleep enough time to get hard fails. - row4=prodNode.getTableRow(evmAcc.name, evmAcc.name, "account", 4) # 4th balance of this integration test - Utils.Print("\taccount row4: ", row4) - assert(row4["eth_address"] == "9e126c57330fa71556628e0aabd6b6b6783d99fa") - assert(row4["balance"] == "000000000000000000000000000000000000000000000001887f8db687170000") # - assert(row4["nonce"] == 2) - - - # test hard-failed transaction (with defer) - amount=9.0000 - transferAmount="9.000 {0}".format(CORE_SYMBOL) - Print("Test hard-failed EVM transaction (with defer)") - signed_trx = w3.eth.account.sign_transaction(dict( - nonce=nonce + 1000, # Wrong nonce -> should hard fails - gas=100000, #100k Gas - gasPrice=gasP, - to=Web3.to_checksum_address(toAdd), - value=int(amount*10000*szabo*100), - data=b'', - chainId=evmChainId - ), evmSendKey) - actData = {"id":1,"account":evmAcc.name,"miner":minerAcc.name, "rlptx":Web3.to_hex(signed_trx.rawTransaction)[2:], "rlptx2":""} - trans = prodNode.pushMessage(defertestAcc.name, "pushdefer", json.dumps(actData), '-p {0}'.format(defertestAcc.name), silentErrors=False) - prodNode.waitForTransBlockIfNeeded(trans[1], True) - #Utils.Print(f"trans is {trans}"); - time.sleep(4) # sleep enough time to get hard fails. - row4=prodNode.getTableRow(evmAcc.name, evmAcc.name, "account", 4) # 4th balance of this integration test - Utils.Print("\taccount row4: ", row4) - assert(row4["eth_address"] == "9e126c57330fa71556628e0aabd6b6b6783d99fa") - assert(row4["balance"] == "000000000000000000000000000000000000000000000001887f8db687170000") # - assert(row4["nonce"] == 2) # nothing should execute - - - # test soft-failed transaction (with defer) - amount=11.0000 - transferAmount="11.000 {0}".format(CORE_SYMBOL) - Print("Test soft-failed EVM transaction (with defer)") - signed_trx = w3.eth.account.sign_transaction(dict( - nonce=nonce + 1000, # Wrong nonce -> should hard fails - gas=100000, #100k Gas - gasPrice=gasP, - to=Web3.to_checksum_address(toAdd), - value=int(amount*10000*szabo*100), - data=b'', - chainId=evmChainId - ), evmSendKey) - amount=13.0000 - transferAmount="13.000 {0}".format(CORE_SYMBOL) - nonce = nonce + 1 - signed_trx2 = w3.eth.account.sign_transaction(dict( - nonce=nonce, # right nonce - gas=100000, #100k Gas - gasPrice=gasP, - to=Web3.to_checksum_address(toAdd), - value=int(amount*10000*szabo*100), - data=b'', - chainId=evmChainId - ), evmSendKey) - actData = {"id":2,"account":evmAcc.name,"miner":minerAcc.name, "rlptx":Web3.to_hex(signed_trx.rawTransaction)[2:], "rlptx2":Web3.to_hex(signed_trx2.rawTransaction)[2:]} - trans = prodNode.pushMessage(defertestAcc.name, "pushdefer", json.dumps(actData), '-p {0}'.format(defertestAcc.name), silentErrors=False) - prodNode.waitForTransBlockIfNeeded(trans[1], True) - #Utils.Print(f"trans is {trans}"); - time.sleep(4) # sleep enough time to get soft fails. - row4=prodNode.getTableRow(evmAcc.name, evmAcc.name, "account", 4) # 4th balance of this integration test - Utils.Print("\taccount row4: ", row4) - assert(row4["eth_address"] == "9e126c57330fa71556628e0aabd6b6b6783d99fa") - assert(row4["nonce"] == 3) # rlptx2 is executed by onerror handler - assert(row4["balance"] == "000000000000000000000000000000000000000000000000d4158798979be000") - - # test action trace execution order which is different than creation order # defertest2::notifytest(defertest, evmevmevmevm, miner, rlptx, rlptx2) # -> 1. create inline action (a) defertest::pushtxinline(evmevmevmevm, miner, rlptx1) @@ -865,9 +786,9 @@ def makeReservedEvmAddress(account): prodNode.waitForTransBlockIfNeeded(trans[1], True) row4=prodNode.getTableRow(evmAcc.name, evmAcc.name, "account", 4) # 4th balance of this integration test Utils.Print("\taccount row4: ", row4) - assert(row4["nonce"] == 5) + assert(row4["nonce"] == 4) assert(row4["eth_address"] == "9e126c57330fa71556628e0aabd6b6b6783d99fa") - assert(row4["balance"] == "00000000000000000000000000000000000000000000000080cfc165cc75a000") + assert(row4["balance"] == "0000000000000000000000000000000000000000000000013539c783bbf0c000") # Launch eos-evm-node @@ -936,7 +857,7 @@ def get_block(num): time.sleep(2) # Transfer funds to trigger version change - prodNode.transferFunds(cluster.eosioAccount, evmAcc, "111.0000 EOS", "0xB106D2C286183FFC3D1F0C4A6f0753bB20B407c2", waitForTransBlock=True) + nonProdNode.transferFunds(cluster.eosioAccount, evmAcc, "111.0000 EOS", "0xB106D2C286183FFC3D1F0C4A6f0753bB20B407c2", waitForTransBlock=True) time.sleep(2) Utils.Print("Verify evm_version==1") @@ -946,7 +867,7 @@ def get_block(num): Utils.Print("Transfer funds to trigger evmtx event on contract") # Transfer funds (now using version=1) - prodNode.transferFunds(cluster.eosioAccount, evmAcc, "111.0000 EOS", "0xB106D2C286183FFC3D1F0C4A6f0753bB20B407c2", waitForTransBlock=True) + nonProdNode.transferFunds(cluster.eosioAccount, evmAcc, "111.0000 EOS", "0xB106D2C286183FFC3D1F0C4A6f0753bB20B407c2", waitForTransBlock=True) time.sleep(2) Utils.Print("Validate all balances (check evmtx event processing)") From c87596ffdabc248c6e779734e701268777936785 Mon Sep 17 00:00:00 2001 From: kayan Date: Wed, 28 Feb 2024 21:11:29 +0800 Subject: [PATCH 11/13] fix nodeos_eos_evm_ws_test_basic.py with leap5 & latest contract change --- tests/nodeos_eos_evm_ws_test_basic.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/nodeos_eos_evm_ws_test_basic.py b/tests/nodeos_eos_evm_ws_test_basic.py index a37dd9d..6586949 100755 --- a/tests/nodeos_eos_evm_ws_test_basic.py +++ b/tests/nodeos_eos_evm_ws_test_basic.py @@ -222,7 +222,8 @@ def makeReservedEvmAddress(account): extraNodeosArgs="--contracts-console" Print("Stand up cluster") - if cluster.launch(pnodes=pnodes, totalNodes=total_nodes, extraNodeosArgs=extraNodeosArgs, specificExtraNodeosArgs=specificExtraNodeosArgs) is False: + time.sleep(5.0) + if cluster.launch(pnodes=pnodes, totalNodes=total_nodes, extraNodeosArgs=extraNodeosArgs, specificExtraNodeosArgs=specificExtraNodeosArgs, delay=5) is False: errorExit("Failed to stand up eos cluster.") Print ("Wait for Cluster stabilization") @@ -280,7 +281,7 @@ def makeReservedEvmAddress(account): cmd="set account permission eosio.evm active --add-code -p eosio.evm@active" prodNode.processCleosCmd(cmd, cmd, silentErrors=True, returnType=ReturnType.raw) - trans = prodNode.pushMessage(evmAcc.name, "init", '{{"chainid":15555, "fee_params": {{"gas_price": "10000000000", "miner_cut": 100000, "ingress_bridge_fee": "0.0000 {0}"}}}}'.format(CORE_SYMBOL), '-p eosio.evm') + trans = prodNode.pushMessage(evmAcc.name, "init", '{{"chainid":15555, "fee_params": {{"gas_price": "10000000000", "miner_cut": 10000, "ingress_bridge_fee": "0.0000 {0}"}}}}'.format(CORE_SYMBOL), '-p eosio.evm') Utils.Print("EVM init action pushed:" + str(trans)) prodNode.waitForTransBlockIfNeeded(trans[1], True) @@ -485,7 +486,7 @@ def makeReservedEvmAddress(account): row0=prodNode.getTableRow(evmAcc.name, evmAcc.name, "balances", 0) Utils.Print("\tAfter transfer table row:", row0) - assert(row0["balance"]["balance"] == "1.0100 {0}".format(CORE_SYMBOL)) # should have fee at end of transaction + assert(row0["balance"]["balance"] == "1.0143 {0}".format(CORE_SYMBOL)) # should have fee at end of transaction testAccActualAmount=prodNode.getAccountEosBalanceStr(evmAcc.name) Utils.Print("\tEVM Account balance %s" % testAccActualAmount) expectedAmount="60000097.5321 {0}".format(CORE_SYMBOL) @@ -506,7 +507,7 @@ def makeReservedEvmAddress(account): prodNode.transferFunds(testAcc, evmAcc, transferAmount, "0xF0cE7BaB13C99bA0565f426508a7CD8f4C247E5a", waitForTransBlock=False) row0=prodNode.getTableRow(evmAcc.name, evmAcc.name, "balances", 0) Utils.Print("\tAfter transfer table row:", row0) - assert(row0["balance"]["balance"] == "1.0200 {0}".format(CORE_SYMBOL)) # should have fee from both transfers + assert(row0["balance"]["balance"] == "1.0243 {0}".format(CORE_SYMBOL)) # should have fee from both transfers evmAccActualAmount=prodNode.getAccountEosBalanceStr(evmAcc.name) Utils.Print("\tEVM Account balance %s" % evmAccActualAmount) expectedAmount="60000107.5321 {0}".format(CORE_SYMBOL) @@ -527,7 +528,7 @@ def makeReservedEvmAddress(account): prodNode.transferFunds(testAcc, evmAcc, transferAmount, "0x9E126C57330FA71556628e0aabd6B6B6783d99fA", waitForTransBlock=False) row0=prodNode.getTableRow(evmAcc.name, evmAcc.name, "balances", 0) Utils.Print("\tAfter transfer table row:", row0) - assert(row0["balance"]["balance"] == "1.0300 {0}".format(CORE_SYMBOL)) # should have fee from all three transfers + assert(row0["balance"]["balance"] == "1.0343 {0}".format(CORE_SYMBOL)) # should have fee from all three transfers evmAccActualAmount=prodNode.getAccountEosBalanceStr(evmAcc.name) Utils.Print("\tEVM Account balance %s" % evmAccActualAmount) expectedAmount="60000149.9563 {0}".format(CORE_SYMBOL) From 9a17bc3f06244215813165d9b179e675e586173b Mon Sep 17 00:00:00 2001 From: kayan Date: Wed, 28 Feb 2024 21:41:43 +0800 Subject: [PATCH 12/13] fix nodeos_eos_evm_ws_test_fork.py --- tests/nodeos_eos_evm_ws_test_fork.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/nodeos_eos_evm_ws_test_fork.py b/tests/nodeos_eos_evm_ws_test_fork.py index 209cbc0..395a55f 100755 --- a/tests/nodeos_eos_evm_ws_test_fork.py +++ b/tests/nodeos_eos_evm_ws_test_fork.py @@ -317,7 +317,8 @@ def makeReservedEvmAddress(account): extraNodeosArgs="--contracts-console" Print("Stand up cluster") - if cluster.launch(prodCount=2, pnodes=2, topo="bridge", totalNodes=3, extraNodeosArgs=extraNodeosArgs, totalProducers=3, specificExtraNodeosArgs=specificExtraNodeosArgs) is False: + time.sleep(5.0) + if cluster.launch(prodCount=2, pnodes=2, topo="bridge", totalNodes=3, extraNodeosArgs=extraNodeosArgs, totalProducers=3, specificExtraNodeosArgs=specificExtraNodeosArgs,delay=5) is False: errorExit("Failed to stand up eos cluster.") Print ("Wait for Cluster stabilization") @@ -402,7 +403,7 @@ def makeReservedEvmAddress(account): prodNode.processCleosCmd(cmd, cmd, silentErrors=True, returnType=ReturnType.raw) time.sleep(1.0) - trans = prodNode.pushMessage(evmAcc.name, "init", '{{"chainid":15555, "fee_params": {{"gas_price": "10000000000", "miner_cut": 100000, "ingress_bridge_fee": "0.0000 {0}"}}}}'.format(CORE_SYMBOL), '-p eosio.evm') + trans = prodNode.pushMessage(evmAcc.name, "init", '{{"chainid":15555, "fee_params": {{"gas_price": "10000000000", "miner_cut": 10000, "ingress_bridge_fee": "0.0000 {0}"}}}}'.format(CORE_SYMBOL), '-p eosio.evm') time.sleep(1.0) Utils.Print("EVM init action pushed:" + str(trans)) @@ -613,7 +614,7 @@ def makeReservedEvmAddress(account): row0=prodNode.getTableRow(evmAcc.name, evmAcc.name, "balances", 0) Utils.Print("\tAfter transfer table row:", row0) - assert(row0["balance"]["balance"] == "1.0100 {0}".format(CORE_SYMBOL)) # should have fee at end of transaction + assert(row0["balance"]["balance"] == "1.0143 {0}".format(CORE_SYMBOL)) # should have fee at end of transaction testAccActualAmount=prodNode.getAccountEosBalanceStr(evmAcc.name) Utils.Print("\tEVM Account balance %s" % testAccActualAmount) expectedAmount="60000097.5321 {0}".format(CORE_SYMBOL) @@ -635,7 +636,7 @@ def makeReservedEvmAddress(account): time.sleep(1.0) row0=prodNode.getTableRow(evmAcc.name, evmAcc.name, "balances", 0) Utils.Print("\tAfter transfer table row:", row0) - assert(row0["balance"]["balance"] == "1.0200 {0}".format(CORE_SYMBOL)) # should have fee from both transfers + assert(row0["balance"]["balance"] == "1.0243 {0}".format(CORE_SYMBOL)) # should have fee from both transfers evmAccActualAmount=prodNode.getAccountEosBalanceStr(evmAcc.name) Utils.Print("\tEVM Account balance %s" % evmAccActualAmount) expectedAmount="60000107.5321 {0}".format(CORE_SYMBOL) @@ -657,7 +658,7 @@ def makeReservedEvmAddress(account): time.sleep(1.0) row0=prodNode.getTableRow(evmAcc.name, evmAcc.name, "balances", 0) Utils.Print("\tAfter transfer table row:", row0) - assert(row0["balance"]["balance"] == "1.0300 {0}".format(CORE_SYMBOL)) # should have fee from all three transfers + assert(row0["balance"]["balance"] == "1.0343 {0}".format(CORE_SYMBOL)) # should have fee from all three transfers evmAccActualAmount=prodNode.getAccountEosBalanceStr(evmAcc.name) Utils.Print("\tEVM Account balance %s" % evmAccActualAmount) expectedAmount="60000149.9563 {0}".format(CORE_SYMBOL) From 1a9cf8fb5e7d2d2c9202081b699d0cb408f95c04 Mon Sep 17 00:00:00 2001 From: kayan Date: Thu, 29 Feb 2024 11:01:33 +0800 Subject: [PATCH 13/13] remove sleep --- tests/nodeos_eos_evm_test.py | 1 - tests/nodeos_eos_evm_ws_test_basic.py | 1 - tests/nodeos_eos_evm_ws_test_fork.py | 1 - 3 files changed, 3 deletions(-) diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py index 267b41a..142ed06 100755 --- a/tests/nodeos_eos_evm_test.py +++ b/tests/nodeos_eos_evm_test.py @@ -251,7 +251,6 @@ def makeReservedEvmAddress(account): extraNodeosArgs="--contracts-console --resource-monitor-not-shutdown-on-threshold-exceeded" Print("Stand up cluster") - time.sleep(5.0) if cluster.launch(pnodes=pnodes, totalNodes=total_nodes, extraNodeosArgs=extraNodeosArgs, specificExtraNodeosArgs=specificExtraNodeosArgs,delay=5) is False: errorExit("Failed to stand up eos cluster.") diff --git a/tests/nodeos_eos_evm_ws_test_basic.py b/tests/nodeos_eos_evm_ws_test_basic.py index 6586949..103f161 100755 --- a/tests/nodeos_eos_evm_ws_test_basic.py +++ b/tests/nodeos_eos_evm_ws_test_basic.py @@ -222,7 +222,6 @@ def makeReservedEvmAddress(account): extraNodeosArgs="--contracts-console" Print("Stand up cluster") - time.sleep(5.0) if cluster.launch(pnodes=pnodes, totalNodes=total_nodes, extraNodeosArgs=extraNodeosArgs, specificExtraNodeosArgs=specificExtraNodeosArgs, delay=5) is False: errorExit("Failed to stand up eos cluster.") diff --git a/tests/nodeos_eos_evm_ws_test_fork.py b/tests/nodeos_eos_evm_ws_test_fork.py index 395a55f..3c74175 100755 --- a/tests/nodeos_eos_evm_ws_test_fork.py +++ b/tests/nodeos_eos_evm_ws_test_fork.py @@ -317,7 +317,6 @@ def makeReservedEvmAddress(account): extraNodeosArgs="--contracts-console" Print("Stand up cluster") - time.sleep(5.0) if cluster.launch(prodCount=2, pnodes=2, topo="bridge", totalNodes=3, extraNodeosArgs=extraNodeosArgs, totalProducers=3, specificExtraNodeosArgs=specificExtraNodeosArgs,delay=5) is False: errorExit("Failed to stand up eos cluster.")