Skip to content

Commit e82f874

Browse files
committed
Merge #17121: test: speedup wallet_backup by whitelisting peers (immediate tx relay)
581c9be test: speedup wallet_backup by whitelisting peers (immediate tx relay) (Sebastian Falbesoner) Pull request description: approaches part of #16613 ("Functional test suite bottlenecks") The majority of the test time is spent in `sync_mempools()` after sending to addresses, i.e. the bottleneck is in relaying transactions. By whitelisting the peers via `-whitelist`, the inventory is transmissioned immediately rather than on average every 5 seconds, speeding up the test by at least a factor of two: before: ``` $ time ./wallet_backup.py real 2m2.523s user 0m6.093s sys 0m2.454s ``` with this PR: ``` $ time ./wallet_backup_with_whitelist.py real 0m36.570s user 0m5.365s sys 0m1.696s ``` Note that the test is not deterministic (the `sendtoaddress` RPC in function `one_send()` is executed with a probability of 50%), hence the times could vary between individual runs. ACKs for top commit: MarcoFalke: ACK 581c9be, this test is testing the backup behaviour, not the tx relay behaviour fanquake: ACK 581c9be Tree-SHA512: d016f39cdb85501e17a74a4c4db5a9f7404baa76fbcc3675a34d3cd7bf03d7a4cb4fd3e5f17cb0597248120bb5ac8b15d3db7663007b76b010902be72954bde0
2 parents 561a7d3 + 581c9be commit e82f874

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/functional/wallet_backup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ def set_test_params(self):
4848
self.num_nodes = 4
4949
self.setup_clean_chain = True
5050
# nodes 1, 2,3 are spenders, let's give them a keypool=100
51-
self.extra_args = [["-keypool=100"], ["-keypool=100"], ["-keypool=100"], []]
51+
# whitelist all peers to speed up tx relay / mempool sync
52+
self.extra_args = [
53+
["-keypool=100", "-whitelist=127.0.0.1"],
54+
["-keypool=100", "-whitelist=127.0.0.1"],
55+
["-keypool=100", "-whitelist=127.0.0.1"],
56+
["-whitelist=127.0.0.1"]
57+
]
5258
self.rpc_timeout = 120
5359

5460
def skip_test_if_missing_module(self):

0 commit comments

Comments
 (0)