From 547aacff08a2a5d786cb0fa6c7bae022ea651f8c Mon Sep 17 00:00:00 2001 From: Martin Zumsande Date: Fri, 23 Feb 2024 17:44:16 -0500 Subject: [PATCH 1/3] test: add -v1transport option and use it in test_runner This option beats the --v2transport option and is meant to be used in test_runner.py. It applies these to a few tests that are particulary interesting in terms of the transport type. This ensures that these tests arei always run with both v1 and v2, irrespective of whether the global --v2transport test_runner option is set or not. --- .../test_framework/test_framework.py | 4 +++ test/functional/test_runner.py | 28 +++++++++---------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index d8ae20981da..475a05eb156 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -191,6 +191,8 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): parser.add_argument("--timeout-factor", dest="timeout_factor", type=float, help="adjust test timeouts by a factor. Setting it to 0 disables all timeouts") parser.add_argument("--v2transport", dest="v2transport", default=False, action="store_true", help="use BIP324 v2 connections between all nodes by default") + parser.add_argument("--v1transport", dest="v1transport", default=False, action="store_true", + help="Explicitly use v1 transport (can be used to overwrite global --v2transport option)") self.add_options(parser) # Running TestShell in a Jupyter notebook causes an additional -f argument @@ -206,6 +208,8 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): config = configparser.ConfigParser() config.read_file(open(self.options.configfile)) self.config = config + if self.options.v1transport: + self.options.v2transport=False if "descriptors" not in self.options: # Wallet is not required by the test at all and the value of self.options.descriptors won't matter. diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index 9f69fd898dc..465b4fb0d86 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -120,7 +120,7 @@ BASE_SCRIPTS = [ 'wallet_backup.py --legacy-wallet', 'wallet_backup.py --descriptors', 'feature_segwit.py --legacy-wallet', - 'feature_segwit.py --descriptors', + 'feature_segwit.py --descriptors --v1transport', 'feature_segwit.py --descriptors --v2transport', 'p2p_tx_download.py', 'wallet_avoidreuse.py --legacy-wallet', @@ -156,7 +156,7 @@ BASE_SCRIPTS = [ # vv Tests less than 30s vv 'p2p_invalid_messages.py', 'rpc_createmultisig.py', - 'p2p_timeouts.py', + 'p2p_timeouts.py --v1transport', 'p2p_timeouts.py --v2transport', 'wallet_dump.py --legacy-wallet', 'rpc_signer.py', @@ -201,7 +201,7 @@ BASE_SCRIPTS = [ 'mempool_spend_coinbase.py', 'wallet_avoid_mixing_output_types.py --descriptors', 'mempool_reorg.py', - 'p2p_block_sync.py', + 'p2p_block_sync.py --v1transport', 'p2p_block_sync.py --v2transport', 'wallet_createwallet.py --legacy-wallet', 'wallet_createwallet.py --usecli', @@ -230,13 +230,13 @@ BASE_SCRIPTS = [ 'wallet_transactiontime_rescan.py --descriptors', 'wallet_transactiontime_rescan.py --legacy-wallet', 'p2p_addrv2_relay.py', - 'p2p_compactblocks_hb.py', + 'p2p_compactblocks_hb.py --v1transport', 'p2p_compactblocks_hb.py --v2transport', - 'p2p_disconnect_ban.py', + 'p2p_disconnect_ban.py --v1transport', 'p2p_disconnect_ban.py --v2transport', 'feature_posix_fs_permissions.py', 'rpc_decodescript.py', - 'rpc_blockchain.py', + 'rpc_blockchain.py --v1transport', 'rpc_blockchain.py --v2transport', 'rpc_deprecated.py', 'wallet_disable.py', @@ -246,21 +246,21 @@ BASE_SCRIPTS = [ 'p2p_getaddr_caching.py', 'p2p_getdata.py', 'p2p_addrfetch.py', - 'rpc_net.py', + 'rpc_net.py --v1transport', 'rpc_net.py --v2transport', 'wallet_keypool.py --legacy-wallet', 'wallet_keypool.py --descriptors', 'wallet_descriptor.py --descriptors', 'p2p_nobloomfilter_messages.py', 'p2p_filter.py', - 'rpc_setban.py', + 'rpc_setban.py --v1transport', 'rpc_setban.py --v2transport', 'p2p_blocksonly.py', 'mining_prioritisetransaction.py', 'p2p_invalid_locator.py', - 'p2p_invalid_block.py', + 'p2p_invalid_block.py --v1transport', 'p2p_invalid_block.py --v2transport', - 'p2p_invalid_tx.py', + 'p2p_invalid_tx.py --v1transport', 'p2p_invalid_tx.py --v2transport', 'p2p_v2_transport.py', 'p2p_v2_encrypted.py', @@ -286,12 +286,12 @@ BASE_SCRIPTS = [ 'rpc_preciousblock.py', 'wallet_importprunedfunds.py --legacy-wallet', 'wallet_importprunedfunds.py --descriptors', - 'p2p_leak_tx.py', + 'p2p_leak_tx.py --v1transport', 'p2p_leak_tx.py --v2transport', 'p2p_eviction.py', - 'p2p_ibd_stalling.py', + 'p2p_ibd_stalling.py --v1transport', 'p2p_ibd_stalling.py --v2transport', - 'p2p_net_deadlock.py', + 'p2p_net_deadlock.py --v1transport', 'p2p_net_deadlock.py --v2transport', 'wallet_signmessagewithaddress.py', 'rpc_signmessagewithprivkey.py', @@ -380,7 +380,7 @@ BASE_SCRIPTS = [ 'feature_coinstatsindex.py', 'wallet_orphanedreward.py', 'wallet_timelock.py', - 'p2p_node_network_limited.py', + 'p2p_node_network_limited.py --v1transport', 'p2p_node_network_limited.py --v2transport', 'p2p_permissions.py', 'feature_blocksdir.py', From 3a25a575f0c455b50abf95d85c0ba8de3cf53a87 Mon Sep 17 00:00:00 2001 From: Martin Zumsande Date: Thu, 29 Feb 2024 12:35:32 -0500 Subject: [PATCH 2/3] test: ignore --v2transport for older versions instead of asserting Otherwise, a run with test_runner.py --v2transport=1 --previous-releases --extended would hit the removed assert for wallet_backwards_compatibility.py --- test/functional/test_framework/test_node.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index 3baa78fd79f..ef6b9dd5eaf 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -136,9 +136,7 @@ class TestNode(): self.args.append("-v2transport=1") else: self.args.append("-v2transport=0") - else: - # v2transport requested but not supported for node - assert not v2transport + # if v2transport is requested via global flag but not supported for node version, ignore it self.cli = TestNodeCLI(bitcoin_cli, self.datadir_path) self.use_cli = use_cli From ecc036c5d63fb4bdff5caeede88baeb85bf62b05 Mon Sep 17 00:00:00 2001 From: Martin Zumsande Date: Mon, 26 Feb 2024 13:47:10 -0500 Subject: [PATCH 3/3] ci: add --v2transport to an existing CI job --- ci/test/00_setup_env_i686_multiprocess.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/test/00_setup_env_i686_multiprocess.sh b/ci/test/00_setup_env_i686_multiprocess.sh index 0d18e2f0290..a5f3682c36c 100755 --- a/ci/test/00_setup_env_i686_multiprocess.sh +++ b/ci/test/00_setup_env_i686_multiprocess.sh @@ -12,6 +12,7 @@ export CI_IMAGE_NAME_TAG="docker.io/amd64/ubuntu:22.04" export PACKAGES="llvm clang g++-multilib" export DEP_OPTS="DEBUG=1 MULTIPROCESS=1" export GOAL="install" +export TEST_RUNNER_EXTRA="--v2transport" export BITCOIN_CONFIG="--enable-debug CC='clang -m32' CXX='clang++ -m32' \ CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE'" export BITCOIND=bitcoin-node # Used in functional tests