From bf64a9474d515ee28ad6e770a39232f7a7b357fc Mon Sep 17 00:00:00 2001 From: GiacomoPirinoli Date: Mon, 9 Oct 2023 15:08:56 +0200 Subject: [PATCH 1/5] Higher degree of parallelization for Travis CI --- .travis.yml | 88 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 69 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8279ddcd61..e66230e96c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,7 +69,7 @@ os: linux - DOCKER_IS_DEB=true - MAKEFLAGS="--enable-lcov" - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-split=5:1 --coverage" + - TEST_ARGS="rpc --rpc-extended --rpc-split=6:1 --coverage" - &docker_amd64_linux_ubuntu_jammy_rpc-tests_2 env: - DOCKER_ARCH=amd64 @@ -78,7 +78,7 @@ os: linux - DOCKER_IS_DEB=true - MAKEFLAGS="--enable-lcov" - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-split=5:2 --coverage" + - TEST_ARGS="rpc --rpc-extended --rpc-split=6:2 --coverage" - &docker_amd64_linux_ubuntu_jammy_rpc-tests_3 env: - DOCKER_ARCH=amd64 @@ -87,7 +87,7 @@ os: linux - DOCKER_IS_DEB=true - MAKEFLAGS="--enable-lcov" - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-split=5:3 --coverage" + - TEST_ARGS="rpc --rpc-extended --rpc-split=6:3 --coverage" - &docker_amd64_linux_ubuntu_jammy_rpc-tests_4 env: - DOCKER_ARCH=amd64 @@ -96,7 +96,7 @@ os: linux - DOCKER_IS_DEB=true - MAKEFLAGS="--enable-lcov" - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-split=5:4 --coverage" + - TEST_ARGS="rpc --rpc-extended --rpc-split=6:4 --coverage" - &docker_amd64_linux_ubuntu_jammy_rpc-tests_5 env: - DOCKER_ARCH=amd64 @@ -105,7 +105,16 @@ os: linux - DOCKER_IS_DEB=true - MAKEFLAGS="--enable-lcov" - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-split=5:5 --coverage" + - TEST_ARGS="rpc --rpc-extended --rpc-split=6:5 --coverage" + - &docker_amd64_linux_ubuntu_jammy_rpc-tests_6 + env: + - DOCKER_ARCH=amd64 + - DOCKER_TARGET_OS=linux + - DOCKER_FROM=ubuntu_jammy + - DOCKER_IS_DEB=true + - MAKEFLAGS="--enable-lcov" + - TEST_CMD="./qa/zcash/full_test_suite.py" + - TEST_ARGS="rpc --rpc-extended --rpc-split=6:6 --coverage" - &docker_amd64_linux_ubuntu_jammy_test-fetch-params env: - DOCKER_ARCH=amd64 @@ -129,7 +138,7 @@ os: linux - DOCKER_FROM=ubuntu_focal - DOCKER_IS_DEB=true - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-split=4:1" + - TEST_ARGS="rpc --rpc-extended --rpc-split=6:1" - &docker_amd64_linux_ubuntu_focal_rpc-tests_2 env: - DOCKER_ARCH=amd64 @@ -137,7 +146,7 @@ os: linux - DOCKER_FROM=ubuntu_focal - DOCKER_IS_DEB=true - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-split=4:2" + - TEST_ARGS="rpc --rpc-extended --rpc-split=6:2" - &docker_amd64_linux_ubuntu_focal_rpc-tests_3 env: - DOCKER_ARCH=amd64 @@ -145,7 +154,7 @@ os: linux - DOCKER_FROM=ubuntu_focal - DOCKER_IS_DEB=true - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-split=4:3" + - TEST_ARGS="rpc --rpc-extended --rpc-split=6:3" - &docker_amd64_linux_ubuntu_focal_rpc-tests_4 env: - DOCKER_ARCH=amd64 @@ -153,7 +162,23 @@ os: linux - DOCKER_FROM=ubuntu_focal - DOCKER_IS_DEB=true - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-split=4:4" + - TEST_ARGS="rpc --rpc-extended --rpc-split=6:4" + - &docker_amd64_linux_ubuntu_focal_rpc-tests_5 + env: + - DOCKER_ARCH=amd64 + - DOCKER_TARGET_OS=linux + - DOCKER_FROM=ubuntu_focal + - DOCKER_IS_DEB=true + - TEST_CMD="./qa/zcash/full_test_suite.py" + - TEST_ARGS="rpc --rpc-extended --rpc-split=6:5" + - &docker_amd64_linux_ubuntu_focal_rpc-tests_6 + env: + - DOCKER_ARCH=amd64 + - DOCKER_TARGET_OS=linux + - DOCKER_FROM=ubuntu_focal + - DOCKER_IS_DEB=true + - TEST_CMD="./qa/zcash/full_test_suite.py" + - TEST_ARGS="rpc --rpc-extended --rpc-split=6:6" - &docker_amd64_linux_ubuntu_focal_test-fetch-params env: - DOCKER_ARCH=amd64 @@ -172,54 +197,64 @@ os: linux - &amd64_osx_xcode14_2_rpc-tests_1 env: - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=10:1 --rpc-macrebalance" + - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=12:1 --rpc-macrebalance" - MAKEFLAGS="--disable-libs --legacy-cpu" - &amd64_osx_xcode14_2_rpc-tests_2 env: - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=10:2 --rpc-macrebalance" + - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=12:2 --rpc-macrebalance" - MAKEFLAGS="--disable-libs --legacy-cpu" - &amd64_osx_xcode14_2_rpc-tests_3 env: - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=10:3 --rpc-macrebalance" + - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=12:3 --rpc-macrebalance" - MAKEFLAGS="--disable-libs --legacy-cpu" - &amd64_osx_xcode14_2_rpc-tests_4 env: - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=10:4 --rpc-macrebalance" + - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=12:4 --rpc-macrebalance" - MAKEFLAGS="--disable-libs --legacy-cpu" - &amd64_osx_xcode14_2_rpc-tests_5 env: - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=10:5 --rpc-macrebalance" + - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=12:5 --rpc-macrebalance" - MAKEFLAGS="--disable-libs --legacy-cpu" - &amd64_osx_xcode14_2_rpc-tests_6 env: - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=10:6 --rpc-macrebalance" + - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=12:6 --rpc-macrebalance" - MAKEFLAGS="--disable-libs --legacy-cpu" - &amd64_osx_xcode14_2_rpc-tests_7 env: - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=10:7 --rpc-macrebalance" + - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=12:7 --rpc-macrebalance" - MAKEFLAGS="--disable-libs --legacy-cpu" - &amd64_osx_xcode14_2_rpc-tests_8 env: - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=10:8 --rpc-macrebalance" + - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=12:8 --rpc-macrebalance" - MAKEFLAGS="--disable-libs --legacy-cpu" - &amd64_osx_xcode14_2_rpc-tests_9 env: - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=10:9 --rpc-macrebalance" + - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=12:9 --rpc-macrebalance" - MAKEFLAGS="--disable-libs --legacy-cpu" - &amd64_osx_xcode14_2_rpc-tests_10 env: - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=10:10 --rpc-macrebalance" + - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=12:10 --rpc-macrebalance" - MAKEFLAGS="--disable-libs --legacy-cpu" - &amd64_osx_xcode14_2_rpc-tests_11 + env: + - TEST_CMD="./qa/zcash/full_test_suite.py" + - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=12:11 --rpc-macrebalance" + - MAKEFLAGS="--disable-libs --legacy-cpu" + - &amd64_osx_xcode14_2_rpc-tests_12 + env: + - TEST_CMD="./qa/zcash/full_test_suite.py" + - TEST_ARGS="rpc --rpc-extended --rpc-exclude=rpcbind_test.py,invalidblockrequest.py,invalidblockposthalving.py,p2p-acceptblock.py,wallet_mergetoaddress_2.py --rpc-split=12:12 --rpc-macrebalance" + - MAKEFLAGS="--disable-libs --legacy-cpu" + - &amd64_osx_xcode14_2_rpc-tests_13 env: - TEST_CMD="./qa/zcash/full_test_suite.py" - TEST_ARGS="rpc --rpc-runonly=wallet_mergetoaddress_2.py" @@ -376,6 +411,9 @@ jobs: - stage: Test <<: *test_docker_amd64_x-large <<: *docker_amd64_linux_ubuntu_jammy_rpc-tests_5 + - stage: Test + <<: *test_docker_amd64_x-large + <<: *docker_amd64_linux_ubuntu_jammy_rpc-tests_6 - stage: Test <<: *test_docker_amd64_x-large <<: *docker_amd64_linux_ubuntu_jammy_clang-tidy @@ -397,6 +435,12 @@ jobs: - stage: Test <<: *test_docker_amd64_x-large <<: *docker_amd64_linux_ubuntu_focal_rpc-tests_4 + - stage: Test + <<: *test_docker_amd64_x-large + <<: *docker_amd64_linux_ubuntu_focal_rpc-tests_5 + - stage: Test + <<: *test_docker_amd64_x-large + <<: *docker_amd64_linux_ubuntu_focal_rpc-tests_6 - stage: Test <<: *test_docker_amd64 <<: *docker_amd64_linux_ubuntu_focal_test-fetch-params @@ -437,6 +481,12 @@ jobs: - stage: Test <<: *test_osx_xcode14_2 <<: *amd64_osx_xcode14_2_rpc-tests_11 + - stage: Test + <<: *test_osx_xcode14_2 + <<: *amd64_osx_xcode14_2_rpc-tests_12 + - stage: Test + <<: *test_osx_xcode14_2 + <<: *amd64_osx_xcode14_2_rpc-tests_13 - stage: Finalize_coverage <<: *finalize_docker_amd64_x-large <<: *docker_amd64_linux_ubuntu_jammy From 6c4ab12cd4de745f1a08385621ef6a9ebee3fb4f Mon Sep 17 00:00:00 2001 From: GiacomoPirinoli Date: Mon, 9 Oct 2023 11:55:34 +0200 Subject: [PATCH 2/5] Minor improvements for sync functions sync_blocks and sync_mempools --- qa/rpc-tests/test_framework/util.py | 59 +++++++++++++++++++---------- 1 file changed, 40 insertions(+), 19 deletions(-) diff --git a/qa/rpc-tests/test_framework/util.py b/qa/rpc-tests/test_framework/util.py index 8c7807573e..3c2ffcdef1 100644 --- a/qa/rpc-tests/test_framework/util.py +++ b/qa/rpc-tests/test_framework/util.py @@ -86,47 +86,68 @@ def str_to_b64str(string): def swap_bytes(input_buf): return codecs.encode(codecs.decode(input_buf, 'hex')[::-1], 'hex').decode() -def sync_blocks(rpc_connections, wait=1, p=False, limit_loop=0): +def sync_blocks(rpc_connections, wait=0.1, p=False, limit_loop=0): """ Wait until everybody has the same block count or a limit has been exceeded """ + length = len(rpc_connections) + if (length == 0 or + (length == 1 and not p)): + return loop_num = 0 + blockcounts = [0] * length + while True: if limit_loop > 0: loop_num += 1 if loop_num > limit_loop: - break - counts = [ x.getblockcount() for x in rpc_connections ] - if p : - print(counts) - if counts == [ counts[0] ]*len(counts): - break + return + + blockcounts[0] = rpc_connections[0].getblockcount() + getblockcount_synced = True + for index in range(1, length): + blockcounts[index] = rpc_connections[index].getblockcount() + if (blockcounts[index] != blockcounts[0]): + getblockcount_synced = False + if (not p): # if printing, all nodes have to be queried + break + + if (p): + print(blockcounts) + if (getblockcount_synced): + return time.sleep(wait) -def sync_mempools(rpc_connections, wait=1): +def sync_mempools(rpc_connections, wait=0.1): """ Wait until everybody has the same transactions in their memory pools, and has notified all internal listeners of them """ - while True: + length = len(rpc_connections) + getrawmempool_synced = False if length > 1 else True + + while not getrawmempool_synced: pool = set(rpc_connections[0].getrawmempool()) - num_match = 1 - for i in range(1, len(rpc_connections)): - if set(rpc_connections[i].getrawmempool()) == pool: - num_match = num_match+1 - if num_match == len(rpc_connections): + for index in range(1, length): + if set(rpc_connections[index].getrawmempool()) != pool: + break + if (index == length - 1): + getrawmempool_synced = True + if (getrawmempool_synced): break time.sleep(wait) # Now that the mempools are in sync, wait for the internal # notifications to finish - while True: - notified = [ x.getmempoolinfo()['fullyNotified'] for x in rpc_connections ] - if notified == [ True ] * len(notified): - break + getmempoolinfo_synced = False if length > 0 else True + while not getmempoolinfo_synced: + for index in range(0, length): + if (rpc_connections[index].getmempoolinfo()['fullyNotified'] == False): + break + if (index == length - 1): + return time.sleep(wait) - bitcoind_processes = {} ''' From 9d10ded976586c37b6c224fb6e713c9e8877d433 Mon Sep 17 00:00:00 2001 From: GiacomoPirinoli Date: Mon, 9 Oct 2023 12:31:45 +0200 Subject: [PATCH 3/5] Changed PoW parameters for Regtest --- .../scripts/common/setup_environment.sh | 2 +- qa/rpc-tests/addressindex.py | 2 +- qa/rpc-tests/invalidblockposthalving.py | 2 +- qa/rpc-tests/invalidblockrequest.py | 2 +- qa/rpc-tests/mempool_size_limit.py | 2 +- qa/rpc-tests/mempool_size_limit_even_more.py | 2 +- qa/rpc-tests/mempool_size_limit_more.py | 2 +- qa/rpc-tests/nulldata.py | 2 +- qa/rpc-tests/p2p-acceptblock.py | 8 +++-- qa/rpc-tests/pruning.py | 2 +- qa/rpc-tests/smartfees.py | 2 +- qa/rpc-tests/spentindex.py | 2 +- qa/rpc-tests/subsidyhalving.py | 24 +++++++++----- qa/rpc-tests/test_framework/blocktools.py | 12 +++---- qa/rpc-tests/wallet_mergetoaddress_2.py | 33 +++++++++---------- src/chainparams.cpp | 15 +++++---- 16 files changed, 60 insertions(+), 54 deletions(-) diff --git a/contrib/ci-horizen/scripts/common/setup_environment.sh b/contrib/ci-horizen/scripts/common/setup_environment.sh index b430b756f0..6f0799b7a3 100755 --- a/contrib/ci-horizen/scripts/common/setup_environment.sh +++ b/contrib/ci-horizen/scripts/common/setup_environment.sh @@ -77,7 +77,7 @@ if [ "${TRAVIS_OS_NAME}" = "osx" ]; then NEED_B2_CREDS="true" fi if [ "${TRAVIS_BUILD_STAGE_NAME}" = "Test" ]; then - export PIP3_INSTALL="${PIP3_INSTALL} pycryptodome pyzmq websocket-client requests b2sdk" + export PIP3_INSTALL="${PIP3_INSTALL} pycryptodome pyzmq websocket-client b2sdk" export B2_DL_DECOMPRESS_FOLDER="${TRAVIS_BUILD_DIR}" # shellcheck disable=SC2001,SC2155 export B2_DL_FILENAME="${TRAVIS_CPU_ARCH}-${TRAVIS_OS_NAME}-${TRAVIS_OSX_IMAGE}-${TRAVIS_BUILD_ID}-${TRAVIS_COMMIT}$(sed 's/ //g' <<< "${MAKEFLAGS:-}").tar.gz" diff --git a/qa/rpc-tests/addressindex.py b/qa/rpc-tests/addressindex.py index 877fd84e32..37f865f6a6 100755 --- a/qa/rpc-tests/addressindex.py +++ b/qa/rpc-tests/addressindex.py @@ -120,7 +120,7 @@ def run_test(self): op_push_20_bytes_onto_the_stack = "14" addressHash = "6349a418fc4578d10a372b54b45c280cc8c4382f" op_equal = "87" - genesisCbah = "20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b4" + genesisCbah = "20" + "4375b0a6cdc392199294e82e1acba9d67d99abd55cf3fd497fe0e6bd19b6c266" + "00b4" scriptPubKey = binascii.unhexlify(op_hash160 + op_push_20_bytes_onto_the_stack + addressHash + op_equal + genesisCbah) unspent = self.nodes[0].listunspent() unspent.sort(key=lambda x: x["amount"], reverse=True) diff --git a/qa/rpc-tests/invalidblockposthalving.py b/qa/rpc-tests/invalidblockposthalving.py index a9613be0ef..b1b2a77896 100755 --- a/qa/rpc-tests/invalidblockposthalving.py +++ b/qa/rpc-tests/invalidblockposthalving.py @@ -70,7 +70,7 @@ def get_chaintip_subsidy_amount(): print("---> Create a new block with an anyone-can-spend coinbase") - block = create_block(self.tip, create_coinbase_h(chainHeight+1), self.block_time) + block = create_block(self.tip, create_coinbase_h(chainHeight+1), self.block_time, get_nBits(chainHeight)) chainHeight += 1 self.block_time += 1 block.solve() diff --git a/qa/rpc-tests/invalidblockrequest.py b/qa/rpc-tests/invalidblockrequest.py index 71796c230c..238393a1c4 100755 --- a/qa/rpc-tests/invalidblockrequest.py +++ b/qa/rpc-tests/invalidblockrequest.py @@ -59,7 +59,7 @@ def get_tests(self): ''' Create a new block with an anyone-can-spend coinbase ''' - block = create_block(self.tip, create_coinbase_h(chainHeight+1), self.block_time) + block = create_block(self.tip, create_coinbase_h(chainHeight+1), self.block_time, get_nBits(chainHeight)) chainHeight += 1 self.block_time += 1 block.solve() diff --git a/qa/rpc-tests/mempool_size_limit.py b/qa/rpc-tests/mempool_size_limit.py index 49294720c7..331dcbcce1 100755 --- a/qa/rpc-tests/mempool_size_limit.py +++ b/qa/rpc-tests/mempool_size_limit.py @@ -337,7 +337,7 @@ class mempool_size_limit(BitcoinTestFramework): def import_data_to_data_dir(self): # importing datadir resource # Tests checkpoint creation (during startup rescan) and usage, checks everything ok with old wallet - snapshot_filename = 'mempool_size_limit_snapshot.zip' + snapshot_filename = 'mempool_size_limit_NP_snapshot.zip' resource_file = download_snapshot(snapshot_filename, self.options.tmpdir) with zipfile.ZipFile(resource_file, 'r') as zip_ref: zip_ref.extractall(self.options.tmpdir) diff --git a/qa/rpc-tests/mempool_size_limit_even_more.py b/qa/rpc-tests/mempool_size_limit_even_more.py index df70a90aa9..b7ee9fb3f8 100755 --- a/qa/rpc-tests/mempool_size_limit_even_more.py +++ b/qa/rpc-tests/mempool_size_limit_even_more.py @@ -63,7 +63,7 @@ class mempool_size_limit_even_more(BitcoinTestFramework): def import_data_to_data_dir(self): # importing datadir resource # Tests checkpoint creation (during startup rescan) and usage, checks everything ok with old wallet - snapshot_filename = 'mempool_size_limit_even_more_snapshot.zip' + snapshot_filename = 'mempool_size_limit_even_more_NP_snapshot.zip' resource_file = download_snapshot(snapshot_filename, self.options.tmpdir) with zipfile.ZipFile(resource_file, 'r') as zip_ref: zip_ref.extractall(self.options.tmpdir) diff --git a/qa/rpc-tests/mempool_size_limit_more.py b/qa/rpc-tests/mempool_size_limit_more.py index 3cc5566492..17e031dc7b 100755 --- a/qa/rpc-tests/mempool_size_limit_more.py +++ b/qa/rpc-tests/mempool_size_limit_more.py @@ -62,7 +62,7 @@ class mempool_size_limit_more(BitcoinTestFramework): def import_data_to_data_dir(self): # importing datadir resource # Tests checkpoint creation (during startup rescan) and usage, checks everything ok with old wallet - snapshot_filename = 'mempool_size_limit_snapshot.zip' + snapshot_filename = 'mempool_size_limit_NP_snapshot.zip' resource_file = download_snapshot(snapshot_filename, self.options.tmpdir) with zipfile.ZipFile(resource_file, 'r') as zip_ref: zip_ref.extractall(self.options.tmpdir) diff --git a/qa/rpc-tests/nulldata.py b/qa/rpc-tests/nulldata.py index a4b34ceba9..df83b76b33 100755 --- a/qa/rpc-tests/nulldata.py +++ b/qa/rpc-tests/nulldata.py @@ -78,7 +78,7 @@ def create_null_tx_with_custom_data(node_from, node_to, data): newScriptPubKey = newScriptPubKey + str_to_hex_str(chr(len(data)))\ + str_to_hex_str(data)\ - +"20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d"\ + +"20" + "4375b0a6cdc392199294e82e1acba9d67d99abd55cf3fd497fe0e6bd19b6c266"\ +"00b4" # Genesis Block hash + ParamHeight=0 + OP_CHECKBLOCKHEIGHT # prepend script size diff --git a/qa/rpc-tests/p2p-acceptblock.py b/qa/rpc-tests/p2p-acceptblock.py index 6a5b3b9e68..2f1ecd900e 100755 --- a/qa/rpc-tests/p2p-acceptblock.py +++ b/qa/rpc-tests/p2p-acceptblock.py @@ -157,8 +157,9 @@ def run_test(self): # This should be accepted. blocks_h2 = [] # the height 2 blocks on each node's chain block_time = int(time.time()) + 1 + chainHeight = 1 for i in range(2): - blocks_h2.append(create_block(tips[i], create_coinbase_h(2), block_time)) + blocks_h2.append(create_block(tips[i], create_coinbase_h(chainHeight+1), block_time, get_nBits(chainHeight))) blocks_h2[i].solve() block_time += 1 test_node.send_message(msg_block(blocks_h2[0])) @@ -172,7 +173,7 @@ def run_test(self): # 3. Send another block that builds on the original tip. blocks_h2f = [] # Blocks at height 2 that fork off the main chain for i in range(2): - blocks_h2f.append(create_block(tips[i], create_coinbase_h(2), blocks_h2[i].nTime+1)) + blocks_h2f.append(create_block(tips[i], create_coinbase_h(chainHeight+1), blocks_h2[i].nTime+1, get_nBits(chainHeight))) blocks_h2f[i].solve() test_node.send_message(msg_block(blocks_h2f[0])) white_node.send_message(msg_block(blocks_h2f[1])) @@ -190,8 +191,9 @@ def run_test(self): # 4. Now send another block that builds on the forking chain. blocks_h3 = [] + chainHeight = 2 for i in range(2): - blocks_h3.append(create_block(blocks_h2f[i].sha256, create_coinbase_h(3), blocks_h2f[i].nTime+1)) + blocks_h3.append(create_block(blocks_h2f[i].sha256, create_coinbase_h(chainHeight+1), blocks_h2f[i].nTime+1, get_nBits(chainHeight))) blocks_h3[i].solve() test_node.send_message(msg_block(blocks_h3[0])) white_node.send_message(msg_block(blocks_h3[1])) diff --git a/qa/rpc-tests/pruning.py b/qa/rpc-tests/pruning.py index b708f47e3d..e543420beb 100755 --- a/qa/rpc-tests/pruning.py +++ b/qa/rpc-tests/pruning.py @@ -39,7 +39,7 @@ def __init__(self): # each output should be protected with OP_CHECKBLOCKATHEIGHT, # let it be anchored to the genesis block because its hash is a constant # HASH_SIZE + GENESIS_BLOCK_HASH + GENESIS_BLOCK_HEIGHT + OP_CHECKBLOCKATHEIGHT - script_pubkey += "20" + "bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d" + "00" + "b4" + script_pubkey += "20" + "4375b0a6cdc392199294e82e1acba9d67d99abd55cf3fd497fe0e6bd19b6c266" + "00" + "b4" # concatenate 690 txouts of above script_pubkey which we'll insert before the txout for change self.txouts = "fdb302" diff --git a/qa/rpc-tests/smartfees.py b/qa/rpc-tests/smartfees.py index 281f2ccc28..702ade9703 100755 --- a/qa/rpc-tests/smartfees.py +++ b/qa/rpc-tests/smartfees.py @@ -17,7 +17,7 @@ # time signing. redeem_script_1 = CScript([OP_1, OP_DROP]) redeem_script_2 = CScript([OP_2, OP_DROP]) -genesis_block_hash = hex_str_to_bytes("bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d") +genesis_block_hash = hex_str_to_bytes("4375b0a6cdc392199294e82e1acba9d67d99abd55cf3fd497fe0e6bd19b6c266") P2SH_1 = CScript([OP_HASH160, hash160(redeem_script_1), OP_EQUAL,CScript(genesis_block_hash),0,OP_CHECKBLOCKATHEIGHT]) P2SH_2 = CScript([OP_HASH160, hash160(redeem_script_2), OP_EQUAL,CScript(genesis_block_hash),0,OP_CHECKBLOCKATHEIGHT]) diff --git a/qa/rpc-tests/spentindex.py b/qa/rpc-tests/spentindex.py index da524e9ef6..6ca543d9c2 100755 --- a/qa/rpc-tests/spentindex.py +++ b/qa/rpc-tests/spentindex.py @@ -54,7 +54,7 @@ def run_test(self): addressHash = "0b2f0a0c31bfe0406b0ccc1381fdbe311946dadc" op_equalverify = "88" op_checksig = "ac" - genesisCbah = "20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b4" + genesisCbah = "20" + "4375b0a6cdc392199294e82e1acba9d67d99abd55cf3fd497fe0e6bd19b6c266" + "00b4" scriptPubKey = binascii.unhexlify(op_dup + op_hash160 + op_push_20_bytes_onto_the_stack + addressHash + op_equalverify + op_checksig + genesisCbah) unspent = self.nodes[0].listunspent() tx = CTransaction() diff --git a/qa/rpc-tests/subsidyhalving.py b/qa/rpc-tests/subsidyhalving.py index 306ef2f340..e8ed1eac6a 100755 --- a/qa/rpc-tests/subsidyhalving.py +++ b/qa/rpc-tests/subsidyhalving.py @@ -5,8 +5,8 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, initialize_chain_clean, \ - start_nodes, stop_nodes, wait_bitcoinds, sync_blocks, sync_mempools, connect_nodes_bi, \ - connect_nodes, wait_and_assert_operationid_status + start_nodes, stop_nodes, wait_bitcoinds, sync_blocks, sync_mempools, \ + connect_nodes, wait_until import os import pprint from decimal import * @@ -145,18 +145,13 @@ def check_coinbase(node, block, reward_amount, coinbase_amount): def mine_and_check_fork_reward(node, numb_of_blocks, reward_amount, coinbase_amount = COINBASE_AMOUNT): block = node.generate(1)[0] - #self.sync_all() - sync_blocks(self.nodes, 1, False, 5) # check starting block check_coinbase(node, block, reward_amount, coinbase_amount) - for i in range(1, numb_of_blocks-1): - node.generate(1) + node.generate(numb_of_blocks-2) block = node.generate(1)[0] - #self.sync_all() - sync_blocks(self.nodes, 1, False, 5) # check ending block check_coinbase(node, block, reward_amount, coinbase_amount) @@ -168,6 +163,7 @@ def mine_and_check_fork_reward(node, numb_of_blocks, reward_amount, coinbase_amo mine_and_check_fork_reward(self.nodes[1], 4, MINER_REWARD_101) mine_and_check_fork_reward(self.nodes[1], 95, MINER_REWARD_105) mine_and_check_fork_reward(self.nodes[1], (HALVING_INTERVAL-200), MINER_REWARD_200) + sync_blocks(self.nodes[0:3]) peer_info_0_pre = self.nodes[0].getpeerinfo() peer_info_1_pre = self.nodes[1].getpeerinfo() @@ -191,7 +187,7 @@ def mine_and_check_fork_reward(node, numb_of_blocks, reward_amount, coinbase_amo check_coinbase(self.nodes[0], bad_block, MINER_REWARD_200, COINBASE_AMOUNT) # upon sync, the other nodes will reject this block and Node0 will be banned by both Node1 and Node2 - sync_blocks(self.nodes, 1, False, 5) + wait_until(lambda: len(self.nodes[0].getpeerinfo()) == 0, timeout=60) # the waiting condition is on node disconnection self.mark_logs("Checking we reject blocks with pre-halving coinbase amount and ban the sender Node...") @@ -204,9 +200,18 @@ def mine_and_check_fork_reward(node, numb_of_blocks, reward_amount, coinbase_amo assert_equal(len(peer_info_1_post), 1) assert_equal(len(peer_info_1_post), len(peer_info_2_post)) + block_count_0_post = self.nodes[0].getblockcount() + block_count_1_post = self.nodes[1].getblockcount() + block_count_2_post = self.nodes[2].getblockcount() + + # checking node 0 tip has not been accepted by node 1 and node 2 + assert_equal(block_count_1_post, block_count_0_post - 1) + assert_equal(block_count_2_post, block_count_0_post - 1) + self.mark_logs("Cross the halving height and check that blocks have expected halved coinbase amounts...") mine_and_check_fork_reward(self.nodes[1], 5, MINER_REWARD_2000, COINBASE_AMOUNT*Decimal("0.5")) + sync_blocks(self.nodes[1:3]) # verify that Node0, being disconneceted, has just its own chain ct0 = self.nodes[0].getchaintips() @@ -232,6 +237,7 @@ def mine_and_check_fork_reward(node, numb_of_blocks, reward_amount, coinbase_amo # enhance active chain after halving mine_and_check_fork_reward(self.nodes[2], 20, MINER_REWARD_2000, COINBASE_AMOUNT*Decimal("0.5")) + sync_blocks(self.nodes[0:3]) # Node0 had its bad chain reverted and now all Nodes share the same blockchain with halved coinbase assert_equal(self.nodes[0].getbestblockhash(), self.nodes[1].getbestblockhash()) diff --git a/qa/rpc-tests/test_framework/blocktools.py b/qa/rpc-tests/test_framework/blocktools.py index 54ad76b76d..d794dace51 100644 --- a/qa/rpc-tests/test_framework/blocktools.py +++ b/qa/rpc-tests/test_framework/blocktools.py @@ -21,7 +21,7 @@ def create_block(hashprev, coinbase, nTime=None, nBits=None): block.nTime = nTime block.hashPrevBlock = hashprev if nBits is None: - block.nBits = 0x200f0f0f # Will break after a difficulty adjustment... + block.nBits = 0x207f0f0f # Will break after a difficulty adjustment... else: block.nBits = nBits block.vtx.append(coinbase) @@ -49,11 +49,11 @@ def get_nBits(chainHeight): # Hard-coding max target would not work due to rounding behaviour of arith_uint256 type in division in the # pow.cpp src code. This is an approximation for regtest. #--- - # consensus.nPowAveragingWindow = 17 - # genesis.nBits = 0x200f0f0f - # nBits stabilizes after 0x2d windows - nBits = 0x200f0f0f - r = min(chainHeight // 17, 45) + # consensus.nPowAveragingWindow = 2 + # genesis.nBits = 0x207f0f0f + # nBits stabilizes after 0x34 windows (based on experiments/observations) + nBits = 0x207f0f0f + r = min(chainHeight // 2, 52) nBits -= r #print "--- called with {} --> nBits = {}".format(chainHeight, nBits) return nBits diff --git a/qa/rpc-tests/wallet_mergetoaddress_2.py b/qa/rpc-tests/wallet_mergetoaddress_2.py index ff012fb4eb..05f4135b73 100755 --- a/qa/rpc-tests/wallet_mergetoaddress_2.py +++ b/qa/rpc-tests/wallet_mergetoaddress_2.py @@ -5,10 +5,9 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, initialize_chain_clean, \ - start_node, connect_nodes_bi, wait_and_assert_operationid_status + start_node, connect_nodes_bi, wait_and_assert_operationid_status, download_snapshot import zipfile -import requests -import io +from decimal import Decimal class WalletMergeToAddress2Test (BitcoinTestFramework): @@ -27,21 +26,19 @@ def import_data_to_data_dir(self): # 100 blocks generated on node0 + 100 blocks generated on node1 + (1 "shielding" on node0 + 1 block generated on node1) * 100 # # node0: - # +] ztpTDK62DWALH9GWJu4rPgqihEGxoWAHFUq -> 0.00000000 - # +] ztZwyCWWmUvHsP1Ho1rB8sjHTC81y93n4rF -> 0.00000000 - # +] ztTw9aP9jeWRNsR3uMHEB3Z3VUqdFsmJaUVWLgJZDRXQM3MydY56JVr8mXC21kUBgJ51YGKK8QuYSVx2kSM7YXf9gZm1Rb4 -> 1143.75000000 {100 notes} + # +] ztmVazvU5wC6cbizPinHMU5GjJYj1iKxhTH -> 0.00000000 + # +] zthRUUZDq5yiToeHpi2R5qAAhs19SSw6pSs -> 0.00000000 + # +] ztmPTt93ugMaijAghGncX8ir6hPLvwQThz8N2K5uBcjU8E58qXQmne5Rcp4taxRTFpWDZPyv673p7e6aHLkjza4ywe88AkW -> 1143.74000000 {100 notes} # # node1: - # +] ztpvEirKWj1mzvoMCn718KkM2DA1nXohuew -> 0.00000000 - # +] ztiFyseKx9q7h4D9eXMjygQqbHvLA4FTZfT -> 882.75000000 (+750.75000000 immature) {100 utxos (+100 immature)} + # +] ztbQADKRubhMhrrpxA2JQR6VLzssWZntQju -> 0.00000000 + # +] ztmSek66GPEPc6z2HyumX6ypmqYAaiSCuvD -> 882.75000000 (+750.01000000 immature) {100 utxos (+100 immature)} # - - r = requests.get("https://downloads.horizen.io/file/depends-sources/test_setup_wallet_mergetoaddress_2.zip", stream=True) - if r.ok: - z = zipfile.ZipFile(io.BytesIO(r.content)) - z.extractall(self.options.tmpdir) - else: - raise Exception("Failed to download zip archive for data dir setup (" + str(r.status_code) + " - " + r.reason + ")") + + snapshot_filename = 'wallet_mergetoaddress_2_NP_snapshot.zip' + resource_file = download_snapshot(snapshot_filename, self.options.tmpdir) + with zipfile.ZipFile(resource_file, 'r') as zip_ref: + zip_ref.extractall(self.options.tmpdir) def get_merged_transaction(self, unspent_transactions_before_merge, unspent_transactions_after_merge): unspent_txid_before = [x["txid"] for x in unspent_transactions_before_merge] @@ -96,9 +93,9 @@ def run_test (self): assert_equal(result[self.op_result_k][self.mergingUTXOs_k], 0) assert_equal(result[self.op_result_k][self.mergingNotes_k], 58) assert_equal(result[self.op_result_k][self.mergingTransparentValue_k], 0) - # 663.375 is the sum of the amount of the first 58 notes - assert_equal(result[self.op_result_k][self.mergingShieldedValue_k], 663.375) - assert_equal(result[self.balance_delta_k], 663.375) + # 663.3692 is the sum of the amount of the first 58 notes + assert_equal(result[self.op_result_k][self.mergingShieldedValue_k], Decimal("663.36920000")) + assert_equal(result[self.balance_delta_k], Decimal("663.36920000")) # 57 joinsplits are required because first two shielded inputs are merged in a shielded output, which is then set as shielded input (change) which is # then set as shielded input (change) in the subsequent joinsplit and paired with another shielded input until the final shielded output is obtained # note0 _____ diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 917075b944..9af4f240d4 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -78,7 +78,7 @@ class CMainParams : public CChainParams { CMutableTransaction txNew; txNew.nVersion = 1; txNew.vin.resize(1); - txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << vector(reinterpret_cast(pszTimestamp), reinterpret_cast(pszTimestamp) + strlen(pszTimestamp)); + txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << vector((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp)); txNew.addOut(CTxOut()); txNew.getOut(0).nValue = 0; txNew.getOut(0).scriptPubKey = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG; @@ -299,7 +299,8 @@ class CRegTestParams : public CTestNetParams { consensus.nMajorityEnforceBlockUpgrade = 750; consensus.nMajorityRejectBlockOutdated = 950; consensus.nMajorityWindow = 1000; - consensus.powLimit = uint256S("0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f"); + consensus.nPowAveragingWindow = 2; + consensus.powLimit = uint256S("7f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f"); assert(maxUint/UintToArith256(consensus.powLimit) >= consensus.nPowAveragingWindow); consensus.nPowMaxAdjustDown = 0; // Turn off adjustment down consensus.nPowMaxAdjustUp = 0; // Turn off adjustment up @@ -316,13 +317,13 @@ class CRegTestParams : public CTestNetParams { nEquihashK = K; genesis.hashPrevBlock.SetNull(); genesis.nTime = 1494548150; - genesis.nBits = 0x200f0f0f; + genesis.nBits = 0x207f0f0f; genesis.nVersion = 4; - genesis.nNonce = uint256S("0x000000000000000000000000000000000000000000000000000000000000003d"); - genesis.nSolution = ParseHex("00CBA7185285F4FF37432E1F3AA7A569FBC81B5A0876F23DA8D38840B0130C74E68297B5"); + genesis.nNonce = uint256S("0x0000000000000000000000000000000000000000000000000000000000000001"); + genesis.nSolution = ParseHex("015354ce93552675bb0ad652dffae7dee3eb11e84c15759b31b566196f285ac2a7b91db2"); consensus.hashGenesisBlock = genesis.GetHash(); nDefaultPort = 19133; - assert(consensus.hashGenesisBlock == uint256S("0x0da5ee723b7923feb580518541c6f098206330dbc711a6678922c11f2ccf1abb")); + assert(consensus.hashGenesisBlock == uint256S("0x66c2b619bde6e07f49fdf35cd5ab997dd6a9cb1a2ee894921992c3cda6b07543")); nPruneAfterHeight = 1000; @@ -346,7 +347,7 @@ class CRegTestParams : public CTestNetParams { checkpointData = (Checkpoints::CCheckpointData){ boost::assign::map_list_of - ( 0, uint256S("0x0da5ee723b7923feb580518541c6f098206330dbc711a6678922c11f2ccf1abb")), + ( 0, uint256S("0x66c2b619bde6e07f49fdf35cd5ab997dd6a9cb1a2ee894921992c3cda6b07543")), 0, 0, 0 From 262b0394c87c40110e3bf23363cb4ab30e812628 Mon Sep 17 00:00:00 2001 From: GiacomoPirinoli Date: Tue, 10 Oct 2023 09:50:29 +0200 Subject: [PATCH 4/5] Bug fixes --- qa/rpc-tests/checkblockatheight.py | 7 +++---- qa/rpc-tests/mempool_size_limit_even_more.py | 1 - qa/rpc-tests/sc_cert_nonceasing.py | 4 +++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/qa/rpc-tests/checkblockatheight.py b/qa/rpc-tests/checkblockatheight.py index 6c572bc045..796963daed 100755 --- a/qa/rpc-tests/checkblockatheight.py +++ b/qa/rpc-tests/checkblockatheight.py @@ -254,11 +254,11 @@ def run_test(self): self.mark_logs(" Node0 generating 1 honest block") blocks.extend(self.nodes[0].generate(1)) - sync_blocks(self.nodes, 1, False, 5) + sync_blocks(self.nodes[0:3]) h_current = self.nodes[1].getblockcount() - # we will perform on attack aimed at reverting from this block (latest generated) upward + # we will perform an attack aimed at reverting from this block (latest generated) upward h_attacked = h_current hash_attacked = blocks[-1] assert hash_attacked == blocks[h_attacked] @@ -331,7 +331,7 @@ def run_test(self): print(" Node0 generating 1 honest block") blocks.extend(self.nodes[0].generate(1)) - sync_blocks(self.nodes[0:2]) + sync_blocks(self.nodes[0:3]) # check tx is no more in mempool assert_equal(self.is_in_mempool(tx_1000, 1), False) @@ -348,7 +348,6 @@ def run_test(self): print(" Node3 generating 3 malicious blocks thus reverting the honest chain once the ntw is joined!") blocks.extend(self.nodes[3].generate(3)) - sync_blocks(self.nodes, limit_loop=5) self.mark_logs("Joining network") self.join_network() diff --git a/qa/rpc-tests/mempool_size_limit_even_more.py b/qa/rpc-tests/mempool_size_limit_even_more.py index b7ee9fb3f8..41723bc36c 100755 --- a/qa/rpc-tests/mempool_size_limit_even_more.py +++ b/qa/rpc-tests/mempool_size_limit_even_more.py @@ -72,7 +72,6 @@ def setup_chain(self, split=False): if (USE_SNAPSHOT): self.import_data_to_data_dir() os.remove(self.options.tmpdir+'/node0/regtest/debug.log') # make sure that we have only logs from this test - os.remove(self.options.tmpdir+'/node1/regtest/debug.log') print("Initializing test directory " + self.options.tmpdir) initialize_chain_clean(self.options.tmpdir, NUMB_OF_NODES) diff --git a/qa/rpc-tests/sc_cert_nonceasing.py b/qa/rpc-tests/sc_cert_nonceasing.py index 68cede85a8..6be3ca248d 100755 --- a/qa/rpc-tests/sc_cert_nonceasing.py +++ b/qa/rpc-tests/sc_cert_nonceasing.py @@ -263,7 +263,9 @@ def run_test(self): fwt_amount = Decimal(0.5) fwd_tx = self.nodes[0].sc_send( [{'toaddress': "abcd", 'amount': fwt_amount, "scid": scid, "mcReturnAddress": self.nodes[0].getnewaddress()}], - {'minconf': 1} # this minconf is used to make sure that fwd_tx does not depend on cert_2 + {'minconf': 102} # this minconf is used to make sure that fwd_tx does not depend on cert_2 ('minconf': 1) + # in addition, since later in the test c0_block is invalidated and fwd_tx is checked for inclusion in the + # mempool, we want to make sure coins mature before c0_block are used (here we are at c0_block+1 height) ) assert(fwd_tx in self.nodes[0].getrawmempool()) From 8db6fb741d409155883a458524fc009afc2a9f4a Mon Sep 17 00:00:00 2001 From: GiacomoPirinoli Date: Wed, 11 Oct 2023 09:21:05 +0200 Subject: [PATCH 5/5] Added script for updating Python tests estimated execution times Actual update of estimated execution times available --- contrib/devtools/README.md | 22 +- .../devtools/tests-execution-times-update.py | 238 ++++++++++++++ qa/pull-tester/rpc-tests.sh | 292 +++++++++--------- 3 files changed, 404 insertions(+), 148 deletions(-) create mode 100755 contrib/devtools/tests-execution-times-update.py diff --git a/contrib/devtools/README.md b/contrib/devtools/README.md index e04abb6beb..628da9bc4f 100644 --- a/contrib/devtools/README.md +++ b/contrib/devtools/README.md @@ -2,6 +2,7 @@ Contents =========== This directory contains tools for developers working on this repository. + github-merge.sh ================== @@ -36,6 +37,7 @@ Configuring the github-merge tool for the bitcoin repository is done in the foll git config githubmerge.testcmd "make -j4 check" (adapt to whatever you want to use for testing) git config --global user.signingkey mykeyid (if you want to GPG sign) + fix-copyright-headers.py =========================== @@ -49,6 +51,7 @@ For example a file changed in 2014 (with 2014 being the current year): would be changed to: ```// Copyright (c) 2009-2014 The Bitcoin Core developers``` + symbol-check.py ================== @@ -69,6 +72,7 @@ If there are 'unsupported' symbols, the return value will be 1 a list like this .../64/test_bitcoin: symbol std::out_of_range::~out_of_range() from unsupported version GLIBCXX_3.4.15 .../64/test_bitcoin: symbol _ZNSt8__detail15_List_nod from unsupported version GLIBCXX_3.4.15 + update-translations.py ======================= @@ -81,12 +85,14 @@ It will do the following automatically: See doc/translation-process.md for more information. + gen-manpages.sh =============== A small script to automatically create manpages in ../../doc/man by running the release binaries with the -help option. This requires help2man which can be found at: https://www.gnu.org/software/help2man/ + git-subtree-check.sh ==================== @@ -101,7 +107,8 @@ maintained: Usage: git-subtree-check.sh DIR COMMIT COMMIT may be omitted, in which case HEAD is used. -release_management/release_preparation + +release_management/(release_preparation) ================== Inside this folder the following are provided: @@ -128,7 +135,8 @@ After script completion the user is required to: - open a PR merging release preparation into release branch and wait for approval - once the release preparation branch is merged into the release branch, create annotated tag (vX.Y.Z) -release_management/release_backport + +release_management/(release_backport) ================== Inside this folder the following are provided: @@ -153,3 +161,13 @@ After script completion the user is required to: - check no error code is returned by the script - push from release backport local branch to remote - open a PR merging release backport into `main` branch and wait for approval + + +tests-execution-times-update.py +================== + +A script interacting with Travis CI API, its purpose is to update estimated execution times for Python regression tests +based on measured execution times of recent Travis CI runs. The script accepts `travis_token`, `builds_quantity` and +`rpc_tests_sh_file_path` parameters representing respectively the token for authenticating to Travis CI API, the quantity +of builds to consider when computing average estimated execution times and the path to the `rpc-tests.sh` file to update. +The script prints average estimated execution times and consequently updates the file `rpc-tests.sh`. diff --git a/contrib/devtools/tests-execution-times-update.py b/contrib/devtools/tests-execution-times-update.py new file mode 100755 index 0000000000..ab42a5c821 --- /dev/null +++ b/contrib/devtools/tests-execution-times-update.py @@ -0,0 +1,238 @@ + +import requests +import sys +import time + +k_python_os_linux = "python_linux" +k_python_os_macos = "python_macos" + +k_start_job_id_ubuntu_jammy = 13 +k_end_job_id_ubuntu_jammy = 18 +k_start_job_id_ubuntu_focal = 22 +k_end_job_id_ubuntu_focal = 27 +k_start_job_id_macos = 30 +k_end_job_id_macos = 42 +k_total_jobs = 43 + +# ---------- Travis API functions ---------- + +def get_build_history(repo_owner, repo_name, token, pages = 4): + build_history = [] + + base_url = 'https://api.travis-ci.com' + endpoint = f'/repo/{repo_owner}%2F{repo_name}/builds' + headers = {'Travis-API-Version': '3', 'Authorization': f'token {token}'} + url = base_url + endpoint + + for page in range(pages): + params = {'limit': 25, 'offset': 25 * page} + maxretry = 2 + for retry in range(maxretry): + response = requests.get(url, headers=headers, params=params) + try: + if response.status_code == 200: + build_history.extend(response.json()['builds']) + break + except: + if retry == maxretry - 1: + sys.exit(f"Error retrieving build history: {response.text}") + + return build_history + +def get_jobs_details(build_id, token): + base_url = f"https://api.travis-ci.com" + endpoint = f"/build/{build_id}/jobs" + headers = {"Travis-API-Version": "3", "Authorization": f"token {token}"} + url = base_url + endpoint + + maxretry = 2 + for retry in range(maxretry): + response = requests.get(url, headers=headers) + if response.status_code == 200: + return response.json() + else: + if retry == maxretry - 1: + sys.exit(f"Error retrieving jobs details: {response.text}") + +def get_job_logs(job_id, token): + base_url = f"https://api.travis-ci.com" + endpoint = f"/job/{job_id}/log.txt" + headers = {"Travis-API-Version": "3", "Authorization": f"token {token}"} + url = base_url + endpoint + + maxretry = 2 + for retry in range(maxretry): + response = requests.get(url, headers=headers) + if response.status_code == 200: + return response.text + else: + if retry == maxretry - 1: + sys.exit(f"Error retrieving job logs: {response.text}") + +# ---------- Travis API functions ---------- + +# ---------- Travis python tests per stage ---------- + +def get_python_stage_type(job_number, total_jobs): + if (k_start_job_id_ubuntu_jammy <= job_number <= k_end_job_id_ubuntu_jammy or + k_start_job_id_ubuntu_focal <= job_number <= k_end_job_id_ubuntu_focal): + return k_python_os_linux + elif (k_start_job_id_macos <= job_number <= k_end_job_id_macos): + return k_python_os_macos + else: + return "" + +# ---------- Travis python tests per stage ---------- + +# ---------- Auxiliaries ---------- + +def extract_tests_times(tests_times, os, log): + while (True): + start_pos_name = log.find("--- Success: ") + if (start_pos_name == -1): + break + start_pos_name += len("--- Success: ") + end_pos_name = log.find(" - elapsed time: ", start_pos_name, start_pos_name + 100) + test_name = log[start_pos_name:end_pos_name] + test_name = test_name.replace("**", "rt") + start_pos_time = end_pos_name + len(" - elapsed time: ") + end_pos_time = log.find(" ---", start_pos_time, start_pos_time + 10) + test_time = int(log[start_pos_time:end_pos_time]) + if (not test_name in tests_times): + tests_times[test_name] = {} + if (not os in tests_times[test_name]): + tests_times[test_name][os] = [] + tests_times[test_name][os].append(test_time) + log = log[end_pos_time:-1] + +def compute_average_tests_times(tests_times): + for test_name in tests_times: + for os in tests_times[test_name]: + times_list = tests_times[test_name][os] + tests_times[test_name][os] = int(sum(times_list) / len(times_list)) + +def update_rpc_tests_sh_file(file_path, tests_times): + with open(file_path, "r") as file: + file_data_in = file.read() + file_data_in = file_data_in.split('\n') + + file_data_out = "" + + line_start_opt_1 = " '" + line_start_opt_2 = " testScripts+=('" + line_end_opt_1 = "" + line_end_opt_2 = ")" + for index in range(len(file_data_in)): + line_start = "" + just_copy = False + if (".py" in file_data_in[index] and "'," in file_data_in[index]): + if (file_data_in[index].startswith(line_start_opt_1)): + line_start = line_start_opt_1 + line_end = line_end_opt_1 + elif (file_data_in[index].startswith(line_start_opt_2)): + line_start = line_start_opt_2 + line_end = line_end_opt_2 + else: + just_copy = True + if (not just_copy): + start_pos_name = file_data_in[index].find(line_start) + if (start_pos_name == -1): + continue + start_pos_name += len(line_start) + end_pos_name = file_data_in[index].find("',") # not using ".py" because of cases like 'txn_doublespend.py --mineblock',23,62 + if (end_pos_name == -1): + continue + test_name = file_data_in[index][start_pos_name:end_pos_name] + if (test_name in tests_times): + linux_time = tests_times[test_name][k_python_os_linux] if k_python_os_linux in tests_times[test_name] else 0 + macos_time = tests_times[test_name][k_python_os_macos] if k_python_os_macos in tests_times[test_name] else 0 + file_data_out += f"{line_start}{test_name}',{linux_time},{macos_time}{line_end}\n" + else: + just_copy = True + else: + just_copy = True + + if (just_copy): + file_data_out += file_data_in[index] + if (index < len(file_data_in) - 1): + file_data_out += "\n" + + with open(file_path, "w") as file: + file.write(file_data_out) + +def print_tests_times(tests_times): + for test_name in tests_times: + linux_time = tests_times[test_name][k_python_os_linux] if k_python_os_linux in tests_times[test_name] else 0 + macos_time = tests_times[test_name][k_python_os_macos] if k_python_os_macos in tests_times[test_name] else 0 + print(f"'{test_name}',{linux_time},{macos_time}") + +def check_missing(tests_times): + for test_name in tests_times: + for os in [k_python_os_linux, k_python_os_macos]: + if (not os in tests_times[test_name]): + print(f"Missing {os} for {test_name}") + +# ---------- Auxiliaries ---------- + +# Script main + +start_time = time.time() + +repository_owner = 'HorizenOfficial' +repository_name = 'zen' +travis_token = 'SetHereProperTokenValue' +builds_quantity = 10 +rpc_tests_sh_file_path = "./qa/pull-tester/rpc-tests.sh" + +for arg in sys.argv: + if (arg.startswith("travis_token=")): + travis_token = arg.replace("travis_token=", "") + if (arg.startswith("builds_quantity=")): + builds_quantity = int(arg.replace("builds_quantity=", "")) + if (arg.startswith("rpc_tests_sh_file_path=")): + rpc_tests_sh_file_path = arg.replace("rpc_tests_sh_file_path=", "") + +print("Running with following params:") +print(f"repository_owner (constant): {repository_owner}") +print(f"repository_name (constant): {repository_name}") +print(f"travis_token (configurable): {travis_token}") +print(f"builds_quantity (configurable): {builds_quantity}") +print(f"rpc_tests_sh_file_path (configurable): {rpc_tests_sh_file_path}") + +assert(travis_token != 'SetHereProperTokenValue') + +tests_times = {} + +print("Getting build history") +builds = get_build_history(repository_owner, repository_name, travis_token, int(builds_quantity / 25 + 1)) # retrieving last (builds_quantity / 25 + 1) * 25 builds +builds_accounted = 0 +for build in builds: + if (builds_accounted >= builds_quantity): + break + build_id = build['id'] + build_number = build['number'] + build_state = build['state'] + if (build_state == "passed"): + print(f"Processing a passed build ({build_number})") + builds_accounted += 1 + jobs = build['jobs'] + if (len(jobs) == k_total_jobs): + print("Getting jobs details") + jobs_details = get_jobs_details(build_id, travis_token) + for job_details in jobs_details["jobs"]: + job_number = (int)(job_details['number'].split(".")[-1]) + python_stage_type = get_python_stage_type(job_number, len(jobs)) + if (python_stage_type in [k_python_os_linux, k_python_os_macos]): + print(f"Getting job logs ({job_number})") + job_logs = get_job_logs(job_details["id"], travis_token) + extract_tests_times(tests_times, python_stage_type, job_logs) + else: + sys.exit("Unsupported .travis.yml file (os cannot be identified)") + +print(f"Averaging over {builds_accounted} accounted builds") +compute_average_tests_times(tests_times) +print_tests_times(tests_times) +check_missing(tests_times) +update_rpc_tests_sh_file(rpc_tests_sh_file_path, tests_times) +print(f"Script execution time: {time.time() - start_time}") +temp = 0 diff --git a/qa/pull-tester/rpc-tests.sh b/qa/pull-tester/rpc-tests.sh index 02b7ca7426..b8f0254b73 100755 --- a/qa/pull-tester/rpc-tests.sh +++ b/qa/pull-tester/rpc-tests.sh @@ -47,163 +47,163 @@ done # Also, note that comma ',' is used as delimiter. Please modify loadbalancer.py if in the future we # need to use this character in the filename field. testScripts=( - 'paymentdisclosure.py',99,332 - 'prioritisetransaction.py',47,145 - 'wallet_treestate.py',136,345 - 'wallet_protectcoinbase.py',294,1368 - 'wallet_shieldcoinbase.py',214,970 - 'wallet_mergetoaddress.py',491,1740 - 'wallet_mergetoaddress_2.py',975,2539 - 'wallet.py',131,692 - 'wallet_nullifiers.py',109,372 - 'wallet_1941.py',53,170 - 'wallet_grothtx.py',91,262 - 'listtransactions.py',129,241 - 'mempool_resurrect_test.py',6,16 - 'txn_doublespend.py',22,139 - 'txn_doublespend.py --mineblock',23,62 - 'getchaintips.py',66,269 - 'rawtransactions.py',141,397 - 'rest.py',26,59 - 'mempool_spendcoinbase.py',6,96 - 'mempool_coinbase_spends.py',14,34 - 'mempool_tx_input_limit.py',91,308 - 'httpbasics.py',21,63 - 'zapwallettxes.py',35,86 - 'proxy_test.py',22,142 - 'merkle_blocks.py',69,163 - 'fundrawtransaction.py',60,128 + 'paymentdisclosure.py',93,294 + 'prioritisetransaction.py',69,121 + 'wallet_treestate.py',126,315 + 'wallet_protectcoinbase.py',378,1496 + 'wallet_shieldcoinbase.py',197,881 + 'wallet_mergetoaddress.py',473,1508 + 'wallet_mergetoaddress_2.py',1010,2865 + 'wallet.py',109,615 + 'wallet_nullifiers.py',127,325 + 'wallet_1941.py',49,152 + 'wallet_grothtx.py',82,234 + 'listtransactions.py',56,189 + 'mempool_resurrect_test.py',6,83 + 'txn_doublespend.py',22,62 + 'txn_doublespend.py --mineblock',49,129 + 'getchaintips.py',67,185 + 'rawtransactions.py',111,340 + 'rest.py',20,53 + 'mempool_spendcoinbase.py',6,17 + 'mempool_coinbase_spends.py',16,103 + 'mempool_tx_input_limit.py',86,279 + 'httpbasics.py',22,62 + 'zapwallettxes.py',30,74 + 'proxy_test.py',22,129 + 'merkle_blocks.py',55,149 + 'fundrawtransaction.py',43,109 'signrawtransactions.py',6,15 - 'walletbackup.py',432,1478 - 'key_import_export.py',41,86 - 'nodehandling.py',428,666 - 'reindex.py',13,33 - 'decodescript.py',6,16 - 'disablewallet.py',6,16 - 'zcjoinsplit.py',45,215 - 'zcjoinsplitdoublespend.py',199,733 - 'zkey_import_export.py',381,1588 - 'getblocktemplate.py',12,35 - 'bip65-cltv-p2p.py',6,18 - 'bipdersig-p2p.py',7,17 - 'nulldata.py',38,69 - 'blockdelay.py',46,101 - 'blockdelay_2.py',51,84 - 'z_sendmany.py',71,196 - 'sc_create.py',185,707 - 'sc_split.py',38,84 - 'sc_invalidate.py',41,99 - 'sc_cert_base.py',104,289 - 'sc_cert_nonceasing.py',97,304 - 'sc_cert_fee.py',53,144 - 'sc_cert_epoch.py',87,224 - 'sc_cert_invalidate.py',58,131 - 'sc_fwd_maturity.py',54,129 - 'sc_rawcertificate.py',74,186 - 'getunconfirmedtxdata.py',46,108 - 'sc_cr_and_fw_in_mempool.py',57,137 - 'sc_cert_change.py',55,145 - 'sc_cert_orphans.py',59,145 - 'sc_cert_maturity.py',56,144 - 'sbh_rpc_cmds.py',41,101 - 'sc_cert_ceasing.py',67,179 - 'sc_cert_customfields.py',106,317 - 'sc_cert_getraw.py',48,114 - 'sc_quality_mempool.py',109,334 - 'sc_ft_and_mbtr_fees.py',47,91 - 'sc_ft_and_mbtr_fees_update.py',305,1131 - 'sc_bwt_request.py',70,165 - 'sc_cert_quality_wallet.py',101,250 - 'ws_messages.py',71,173 - 'ws_getsidechainversions.py',47,138 - 'sc_cert_ceasing_split.py',66,161 - 'sc_async_proof_verifier.py',97,227 - 'sc_quality_blockchain.py',86,254 - 'sc_quality_voiding.py',57,144 - 'sc_csw_actcertdata.py',104,315 - 'sc_csw_actcertdata_null.py',54,136 - 'sc_cert_ceasing_sg.py',54,138 - 'sc_csw_nullifier.py',120,319 - 'sc_getscinfo.py',121,592 - 'sc_quality_nodes.py',51,126 - 'sc_cert_memcleanup_split.py',69,173 - 'sc_csw_fundrawtransaction.py',93,260 - 'sc_proof_verifier_low_priority_threads.py',49,82 - 'subsidyhalving.py',195,361 - 'cbh_rpfix.py',45,113 - 'cbh_rpcheck.py',26,61 - 'tlsprotocols.py',12,34 - 'mempool_double_spend.py',21,60 - 'getblockmerkleroots.py',67,156 - 'sc_block_partitions.py',60,153 - 'sc_cert_bwt_amount_rounding.py',30,73 - 'sc_csw_eviction_from_mempool.py',124,377 - 'sc_csw_memcleanup_split.py',70,188 - 'sc_csw_balance_exceeding.py',57,162 - 'sc_stale_ft_and_mbtr.py',121,293 - 'sc_cert_getblocktemplate.py',253,993 - 'sc_cert_bt_immature_balances.py',40,94 - 'sc_rpc_cmds_fee_handling.py',137,254 - 'sc_cert_listsinceblock.py',70,158 - 'sc_cert_dust.py',98,236 - 'sc_keyrot.py',47,149 - 'txindex.py',28,72 - 'addressindex.py',34,95 - 'spentindex.py',18,74 - 'timestampindex.py',21,75 - 'sc_cert_addressindex.py',128,508 - 'sc_cert_addrmempool.py',46,168 - 'getblockexpanded.py',191,478 - 'sc_rpc_cmds_json_output.py',68,187 - 'sc_version.py',104,371 - 'sc_getscgenesisinfo.py',86,286 - 'fundaddresses.py',12,25 - 'sc_getcertmaturityinfo.py',68,231 - 'sc_big_commitment_tree.py',63,110 - 'sc_big_commitment_tree_getblockmerkleroot.py',11,25 - 'p2p_ignore_spent_tx.py',215,455 - 'shieldedpooldeprecation_rpc.py',558,1794 - 'mempool_size_limit.py',121,203 - 'mempool_size_limit_more.py',103,160 - 'mempool_size_limit_even_more.py',87,210 - 'mempool_hard_fork_cleaning.py',34,60 + 'walletbackup.py',397,1387 + 'key_import_export.py',29,66 + 'nodehandling.py',353,514 + 'reindex.py',12,30 + 'decodescript.py',6,15 + 'disablewallet.py',6,15 + 'zcjoinsplit.py',96,235 + 'zcjoinsplitdoublespend.py',189,819 + 'zkey_import_export.py',365,1433 + 'getblocktemplate.py',11,31 + 'bip65-cltv-p2p.py',6,16 + 'bipdersig-p2p.py',6,16 + 'nulldata.py',24,57 + 'blockdelay.py',36,88 + 'blockdelay_2.py',42,75 + 'z_sendmany.py',62,171 + 'sc_create.py',145,624 + 'sc_split.py',28,70 + 'sc_invalidate.py',32,87 + 'sc_cert_base.py',76,265 + 'sc_cert_nonceasing.py',81,270 + 'sc_cert_fee.py',42,119 + 'sc_cert_epoch.py',72,184 + 'sc_cert_invalidate.py',41,99 + 'sc_fwd_maturity.py',41,116 + 'sc_rawcertificate.py',56,174 + 'getunconfirmedtxdata.py',40,97 + 'sc_cr_and_fw_in_mempool.py',47,117 + 'sc_cert_change.py',44,128 + 'sc_cert_orphans.py',47,123 + 'sc_cert_maturity.py',43,124 + 'sbh_rpc_cmds.py',31,87 + 'sc_cert_ceasing.py',62,249 + 'sc_cert_customfields.py',85,268 + 'sc_cert_getraw.py',33,97 + 'sc_quality_mempool.py',85,283 + 'sc_ft_and_mbtr_fees.py',35,72 + 'sc_ft_and_mbtr_fees_update.py',230,1006 + 'sc_bwt_request.py',51,143 + 'sc_cert_quality_wallet.py',82,224 + 'ws_messages.py',51,147 + 'ws_getsidechainversions.py',36,123 + 'sc_cert_ceasing_split.py',51,144 + 'sc_async_proof_verifier.py',77,201 + 'sc_quality_blockchain.py',67,223 + 'sc_quality_voiding.py',44,123 + 'sc_csw_actcertdata.py',86,283 + 'sc_csw_actcertdata_null.py',41,122 + 'sc_cert_ceasing_sg.py',41,121 + 'sc_csw_nullifier.py',96,293 + 'sc_getscinfo.py',105,580 + 'sc_quality_nodes.py',35,103 + 'sc_cert_memcleanup_split.py',52,150 + 'sc_csw_fundrawtransaction.py',73,220 + 'sc_proof_verifier_low_priority_threads.py',45,75 + 'subsidyhalving.py',92,177 + 'cbh_rpfix.py',38,99 + 'cbh_rpcheck.py',20,53 + 'tlsprotocols.py',12,32 + 'mempool_double_spend.py',20,52 + 'getblockmerkleroots.py',58,200 + 'sc_block_partitions.py',44,136 + 'sc_cert_bwt_amount_rounding.py',23,63 + 'sc_csw_eviction_from_mempool.py',95,420 + 'sc_csw_memcleanup_split.py',55,167 + 'sc_csw_balance_exceeding.py',44,142 + 'sc_stale_ft_and_mbtr.py',93,263 + 'sc_cert_getblocktemplate.py',150,859 + 'sc_cert_bt_immature_balances.py',27,81 + 'sc_rpc_cmds_fee_handling.py',114,223 + 'sc_cert_listsinceblock.py',54,143 + 'sc_cert_dust.py',82,214 + 'sc_keyrot.py',37,142 + 'txindex.py',24,65 + 'addressindex.py',41,89 + 'spentindex.py',25,63 + 'timestampindex.py',28,69 + 'sc_cert_addressindex.py',138,713 + 'sc_cert_addrmempool.py',50,135 + 'getblockexpanded.py',141,430 + 'sc_rpc_cmds_json_output.py',51,162 + 'sc_version.py',85,367 + 'sc_getscgenesisinfo.py',70,248 + 'fundaddresses.py',11,20 + 'sc_getcertmaturityinfo.py',55,205 + 'sc_big_commitment_tree.py',52,96 + 'sc_big_commitment_tree_getblockmerkleroot.py',9,19 + 'p2p_ignore_spent_tx.py',211,480 + 'shieldedpooldeprecation_rpc.py',526,1682 + 'mempool_size_limit.py',111,172 + 'mempool_size_limit_more.py',39,53 + 'mempool_size_limit_even_more.py',103,220 + 'mempool_hard_fork_cleaning.py',44,112 ); testScriptsExt=( - 'getblocktemplate_longpoll.py',120,207 - 'getblocktemplate_proposals.py',57,129 - 'getblocktemplate_blockmaxcomplexity.py',55,136 - 'getblocktemplate_priority.py',39,84 + 'getblocktemplate_longpoll.py',113,126 + 'getblocktemplate_proposals.py',49,121 + 'getblocktemplate_blockmaxcomplexity.py',51,130 + 'getblocktemplate_priority.py',35,75 # 'pruning.py' # disabled for Zen. Failed because of the issue #1302 in zcash - 'forknotify.py',27,60 + 'forknotify.py',22,48 # 'hardforkdetection.py' # disabled for Zen. Failed because of the issue #1302 in zcash # 'invalidateblock.py' # disabled for Zen. Failed because of the issue #1302 in zcash - 'keypool.py',12,34 - 'receivedby.py',30,68 - 'rpcbind_test.py',60,140 + 'keypool.py',12,29 + 'receivedby.py',25,66 + 'rpcbind_test.py',60,0 # 'script_test.py' - 'smartfees.py',158,480 - 'maxblocksinflight.py',14,25 - 'invalidblockrequest.py',40,100 - 'invalidblockposthalving.py',113,250 - 'p2p-acceptblock.py',202,450 - 'replay_protection.py',22,56 - 'headers_01.py',14,34 - 'headers_02.py',22,52 - 'headers_03.py',22,54 - 'headers_04.py',26,57 - 'headers_05.py',48,82 - 'headers_06.py',44,87 - 'headers_07.py',107,228 - 'headers_08.py',25,59 - 'headers_09.py',44,81 - 'headers_10.py',36,72 - 'checkblockatheight.py',103,236 - 'sc_big_block.py',92,247 + 'smartfees.py',198,322 + 'maxblocksinflight.py',14,23 + 'invalidblockrequest.py',13,0 + 'invalidblockposthalving.py',27,0 + 'p2p-acceptblock.py',45,0 + 'replay_protection.py',19,49 + 'headers_01.py',11,31 + 'headers_02.py',17,46 + 'headers_03.py',17,48 + 'headers_04.py',22,52 + 'headers_05.py',41,72 + 'headers_06.py',42,82 + 'headers_07.py',39,80 + 'headers_08.py',21,53 + 'headers_09.py',38,69 + 'headers_10.py',22,53 + 'checkblockatheight.py',76,201 + 'sc_big_block.py',71,222 ); if [ "x$ENABLE_ZMQ" = "x1" ]; then - testScripts+=('zmq_test.py',25,73) + testScripts+=('zmq_test.py',23,65) fi if [ "x$ENABLE_PROTON" = "x1" ]; then