aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_maxuploadtarget.py
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2024-02-27 09:25:11 +0000
committerfanquake <fanquake@gmail.com>2024-02-27 09:51:41 +0000
commit5c6d900a27076aee95b046c1a7352e832215e88d (patch)
treef310b61176f318dea6ab145fb6daff274f949747 /test/functional/feature_maxuploadtarget.py
parentee7e4b0e40acebc746f4c203f04706507e0b3656 (diff)
parentbf5662c678455fb47c402f8520215726ddfe7a94 (diff)
downloadbitcoin-5c6d900a27076aee95b046c1a7352e832215e88d.tar.xz
Merge bitcoin/bitcoin#29358: test: use v2 everywhere for P2PConnection if --v2transport is enabled
bf5662c678455fb47c402f8520215726ddfe7a94 test: enable v2 for python p2p depending on global --v2transport flag (Martin Zumsande) 6e9e39da434f8dafacee4cba068daf499bdb4cc2 test: Don't use v2transport when it's too slow. (Martin Zumsande) 87549c8f89fe8c9f404b74c5a40b5ee54c5a966d test: enable p2p_invalid_messages.py with v2transport (Martin Zumsande) 5fc9db504b9ac784019e7e8c215c31abfccb62b6 test: enable p2p_sendtxrcncl.py with v2transport (Martin Zumsande) Pull request description: #24748 added v2 transport to the python `P2PConnection`, but so far each test that wants to make use of it needs to enable it on an individual basis. This PR changes it so that if the test suite is run with `--v2transport` option, v2 is used in each test by default, not only for connections between two bitcoind instances as before, but also wherever `P2PConnection` is used. Individual tests can override this global option. To do that, a few tests need to be adjusted. In addition, I added a commit to always use v1 in a few select subtests that send a large number of large messages (e.g. large reorgs). These tests don't have a fundamental problem with v2 but become very slow due to the unoptimised python ChaCha20 implementation (~30 minutes on my computer, so probably not suitable to be run in the CI). As a result, `python3 test_runner.py --v2transport` should succeed and use `v2` everywhere (unless v1 is chosen explicitly). [Edit]: To make the "test each commit" CI pass, several test fixes were squashed into the last commit, which actually enables v2 p2p for `P2PConnection`. I have an unsquashed version at https://github.com/mzumsande/bitcoin/tree/202401_bip324_alltests_unsquashed, in case that helps with review. ACKs for top commit: fjahr: tACK bf5662c678455fb47c402f8520215726ddfe7a94 vasild: ACK bf5662c678455fb47c402f8520215726ddfe7a94 stratospher: reACK bf5662c6. theStack: Tested ACK bf5662c678455fb47c402f8520215726ddfe7a94 Tree-SHA512: 4f5a08248ba8a755f7d0f48deb2b79bef03292345cacb7deef01be955481093800e4e56ff218ea56734eef5de1fb3ab0f04657447ea27d393bb536539d7b289d
Diffstat (limited to 'test/functional/feature_maxuploadtarget.py')
-rwxr-xr-xtest/functional/feature_maxuploadtarget.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/functional/feature_maxuploadtarget.py b/test/functional/feature_maxuploadtarget.py
index 814eb21e6f..39cff7b738 100755
--- a/test/functional/feature_maxuploadtarget.py
+++ b/test/functional/feature_maxuploadtarget.py
@@ -81,7 +81,8 @@ class MaxUploadTest(BitcoinTestFramework):
p2p_conns = []
for _ in range(3):
- p2p_conns.append(self.nodes[0].add_p2p_connection(TestP2PConn()))
+ # Don't use v2transport in this test (too slow with the unoptimized python ChaCha20 implementation)
+ p2p_conns.append(self.nodes[0].add_p2p_connection(TestP2PConn(), supports_v2_p2p=False))
# Now mine a big block
mine_large_block(self, self.wallet, self.nodes[0])
@@ -173,7 +174,7 @@ class MaxUploadTest(BitcoinTestFramework):
self.assert_uploadtarget_state(target_reached=False, serve_historical_blocks=False)
# Reconnect to self.nodes[0]
- peer = self.nodes[0].add_p2p_connection(TestP2PConn())
+ peer = self.nodes[0].add_p2p_connection(TestP2PConn(), supports_v2_p2p=False)
# Sending mempool message shouldn't disconnect peer, as total limit isn't reached yet
peer.send_and_ping(msg_mempool())