Skip to content

Commit 7fc9a7b

Browse files
Merge #6584: backport: Merge bitcoin#23474: test: scripted-diff cleanups after generate* changes
0b1d83a Bump copyright headers (Konstantin Akimov) 98c50c9 fix: recovery missing syncs for Dash Specific tests (Konstantin Akimov) 31718c7 scripted-diff: Remove redundant sync_all and sync_blocks (Konstantin Akimov) 7e90bd1 fix: remove sync-no-op for generate blocks in Dash functional tests (Konstantin Akimov) ac269a0 test: Properly set sync_fun in NodeNetworkLimitedTest (MarcoFalke) 356cb44 test: Use 4 spaces for indentation (MarcoFalke) Pull request description: ## What was done? The majority of changes in this backport are scripted, better to keep commits as they are rather than squash together. Original description: > Some cleanups after #6288 (see bitcoin#23300) ## How Has This Been Tested? Run unit functional tests. ## Breaking Changes N/A ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACK 0b1d83a Tree-SHA512: 48285d82c79004c5f39bd7610729f0ba8539df3cf5063905354c7dc9bcff0e05502049b97068813cec685e3227f7abec22a16435021b81c24d3706dc25df4de7
2 parents 5e68b5b + 0b1d83a commit 7fc9a7b

32 files changed

+14
-62
lines changed

test/functional/feature_backwards_compatibility.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ def setup_nodes(self):
6565
def run_test(self):
6666
self.generatetoaddress(self.nodes[0], 101, self.nodes[0].getnewaddress())
6767

68-
self.sync_blocks()
69-
7068
# Sanity check the test framework:
7169
res = self.nodes[self.num_nodes - 1].getblockchaininfo()
7270
assert_equal(res['blocks'], 101)
@@ -93,7 +91,6 @@ def run_test(self):
9391
self.nodes[0].sendtoaddress(address, 1)
9492
self.sync_mempools()
9593
self.generate(self.nodes[0], 1)
96-
self.sync_blocks()
9794

9895
# w1_v19: regular wallet, created with v0.19
9996
node_v19.rpc.createwallet(wallet_name="w1_v19")

test/functional/feature_coinstatsindex.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ def _test_coin_stats_index(self):
8686
self.wallet.send_self_transfer(from_node=node)
8787
self.generate(node, 1)
8888

89-
self.sync_blocks(timeout=120)
90-
9189
self.log.info("Test that gettxoutsetinfo() output is consistent with or without coinstatsindex option")
9290
res0 = node.gettxoutsetinfo('none')
9391

test/functional/feature_dip4_coinbasemerkleroots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
# Copyright (c) 2015-2024 The Dash Core developers
2+
# Copyright (c) 2015-2025 The Dash Core developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

test/functional/feature_fee_estimation.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ def transact_and_mine(self, numblocks, mining_node):
205205
self.fees_per_kb.append(float(fee) / tx_kbytes)
206206
self.sync_mempools(wait=.1)
207207
mined = mining_node.getblock(self.generate(mining_node, 1)[0], True)["tx"]
208-
self.sync_blocks(wait=.1)
209208
# update which txouts are confirmed
210209
newmem = []
211210
for utx in self.memutxo:
@@ -277,8 +276,6 @@ def run_test(self):
277276
# Finish by mining a normal-sized block:
278277
while len(self.nodes[1].getrawmempool()) > 0:
279278
self.generate(self.nodes[1], 1)
280-
281-
self.sync_blocks(self.nodes[0:3], wait=.1)
282279
self.log.info("Final estimates after emptying mempools")
283280
check_estimates(self.nodes[1], self.fees_per_kb)
284281

test/functional/feature_index_prune.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def mine_batches(self, blocks):
4848
for _ in range(n):
4949
self.generate(self.nodes[0], 250)
5050
self.generate(self.nodes[0], blocks % 250)
51-
self.sync_blocks()
5251

5352
def restart_without_indices(self):
5453
for i in range(3):
@@ -152,7 +151,6 @@ def run_test(self):
152151
with self.nodes[0].assert_debug_log(['basic block filter index prune lock moved back to 2480']):
153152
self.nodes[3].invalidateblock(self.nodes[0].getblockhash(2480))
154153
self.generate(self.nodes[3], 30)
155-
self.sync_blocks()
156154

157155
for idx in range(self.num_nodes):
158156
self.nodes[idx].stop_node(expected_stderr=EXPECTED_STDERR_NO_GOV_PRUNE if idx != 3 else "")

test/functional/feature_llmq_dkgerrors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
# Copyright (c) 2015-2024 The Dash Core developers
2+
# Copyright (c) 2015-2025 The Dash Core developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

test/functional/feature_llmq_rotation.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
# Copyright (c) 2015-2024 The Dash Core developers
2+
# Copyright (c) 2015-2025 The Dash Core developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

@@ -84,7 +84,7 @@ def run_test(self):
8484
h_100_1 = QuorumId(100, int(h_1, 16))
8585

8686
self.log.info("Mine single block, wait for chainlock")
87-
self.generate(self.nodes[0], 1, sync_fun=self.no_op)
87+
self.generate(self.nodes[0], 1)
8888
self.wait_for_chainlocked_block_all_nodes(self.nodes[0].getbestblockhash())
8989

9090
b_h_1 = self.nodes[0].getbestblockhash()
@@ -115,7 +115,7 @@ def run_test(self):
115115
assert_equal(projected_activation_height, softfork_info['height'])
116116

117117
# v20 is active for the next block, not for the tip
118-
self.generate(self.nodes[0], 1, sync_fun=self.no_op)
118+
self.generate(self.nodes[0], 1)
119119

120120
self.log.info("Wait for chainlock")
121121
self.wait_for_chainlocked_block_all_nodes(self.nodes[0].getbestblockhash())
@@ -196,7 +196,7 @@ def run_test(self):
196196
self.sync_blocks(nodes)
197197
quorum_list = self.nodes[0].quorum("list", llmq_type)
198198
quorum_blockhash = self.nodes[0].getbestblockhash()
199-
fallback_blockhash = self.generate(self.nodes[0], 1, sync_fun=self.no_op)[0]
199+
fallback_blockhash = self.generate(self.nodes[0], 1)[0]
200200
self.log.info("h("+str(self.nodes[0].getblockcount())+") quorum_list:"+str(quorum_list))
201201

202202
assert_greater_than_or_equal(len(intersection(quorum_members_0_0, quorum_members_1_0)), 3)
@@ -388,8 +388,7 @@ def move_to_next_cycle(self):
388388
skip_count = cycle_length - (cur_block % cycle_length)
389389
if skip_count != 0:
390390
self.bump_mocktime(1)
391-
self.generate(self.nodes[0], skip_count, sync_fun=self.no_op)
392-
self.sync_blocks(nodes)
391+
self.generate(self.nodes[0], skip_count, sync_fun=lambda: self.sync_blocks(nodes))
393392
self.log.info('Moved from block %d to %d' % (cur_block, self.nodes[0].getblockcount()))
394393

395394

test/functional/feature_llmq_simplepose.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
# Copyright (c) 2015-2024 The Dash Core developers
2+
# Copyright (c) 2015-2025 The Dash Core developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

@@ -109,8 +109,7 @@ def mine_quorum_less_checks(self, expected_good_nodes, mninfos_online):
109109
skip_count = 24 - (self.nodes[0].getblockcount() % 24)
110110
if skip_count != 0:
111111
self.bump_mocktime(skip_count, nodes=nodes)
112-
self.generate(self.nodes[0], skip_count, sync_fun=self.no_op)
113-
self.sync_blocks(nodes)
112+
self.generate(self.nodes[0], skip_count, sync_fun=lambda: self.sync_blocks(nodes))
114113

115114
q = self.nodes[0].getbestblockhash()
116115
self.log.info("Expected quorum_hash: "+str(q))

test/functional/mempool_packages.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ def run_test(self):
183183
# Check that prioritising a tx before it's added to the mempool works
184184
# First clear the mempool by mining a block.
185185
self.generate(self.nodes[0], 1)
186-
self.sync_blocks()
187186
assert_equal(len(self.nodes[0].getrawmempool()), 0)
188187
# Prioritise a transaction that has been mined, then add it back to the
189188
# mempool by using invalidateblock.
@@ -276,7 +275,6 @@ def run_test(self):
276275
# Test reorg handling
277276
# First, the basics:
278277
self.generate(self.nodes[0], 1)
279-
self.sync_blocks()
280278
self.nodes[1].invalidateblock(self.nodes[0].getbestblockhash())
281279
self.nodes[1].reconsiderblock(self.nodes[0].getbestblockhash())
282280

test/functional/mining_getblocktemplate_longpoll.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ def run_test(self):
6363

6464
# Add enough mature utxos to the wallets, so that all txs spend confirmed coins
6565
self.generate(self.nodes[0], 100)
66-
self.sync_blocks()
6766

6867
self.log.info("Test that introducing a new transaction into the mempool will terminate the longpoll")
6968
thr = LongpollThread(self.nodes[0])

0 commit comments

Comments
 (0)