From 1367115f7bf2f3862a79e023dc16417b9c25020f Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Tue, 1 Oct 2024 19:22:56 +0000 Subject: [PATCH] test: opt-out of post-`generate*` syncing in some Dash tests Co-authored-by: UdjinM6 --- test/functional/feature_addressindex.py | 14 ++++---- test/functional/feature_asset_locks.py | 4 +-- test/functional/feature_dip0020_activation.py | 8 ++--- .../feature_dip3_deterministicmns.py | 14 ++++---- test/functional/feature_dip3_v19.py | 2 +- .../feature_dip4_coinbasemerkleroots.py | 6 ++-- test/functional/feature_governance.py | 32 ++++++++--------- test/functional/feature_governance_cl.py | 4 +-- test/functional/feature_llmq_chainlocks.py | 34 +++++++++---------- test/functional/feature_llmq_connections.py | 2 +- test/functional/feature_llmq_data_recovery.py | 6 ++-- test/functional/feature_llmq_dkgerrors.py | 2 +- test/functional/feature_llmq_evo.py | 2 +- .../feature_llmq_is_cl_conflicts.py | 2 +- .../functional/feature_llmq_is_retroactive.py | 12 +++---- test/functional/feature_llmq_rotation.py | 6 ++-- test/functional/feature_llmq_simplepose.py | 2 +- .../feature_new_quorum_type_activation.py | 6 ++-- test/functional/feature_sporks.py | 2 +- test/functional/interface_zmq_dash.py | 6 ++-- test/functional/p2p_instantsend.py | 4 +-- test/functional/p2p_sendheaders_compressed.py | 4 +-- test/functional/rpc_masternode.py | 8 ++--- test/functional/rpc_verifychainlock.py | 8 ++--- test/functional/rpc_verifyislock.py | 2 +- .../test_framework/test_framework.py | 8 ++--- 26 files changed, 100 insertions(+), 100 deletions(-) diff --git a/test/functional/feature_addressindex.py b/test/functional/feature_addressindex.py index c64f2b61cf..0a281cbb80 100755 --- a/test/functional/feature_addressindex.py +++ b/test/functional/feature_addressindex.py @@ -72,19 +72,19 @@ class AddressIndexTest(BitcoinTestFramework): self.log.info("Testing p2pkh and p2sh address index...") txid0 = self.nodes[0].sendtoaddress("yMNJePdcKvXtWWQnFYHNeJ5u8TF2v1dfK4", 10) - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) txidb0 = self.nodes[0].sendtoaddress("93bVhahvUKmQu8gu9g3QnPPa2cxFK98pMB", 10) - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) txid1 = self.nodes[0].sendtoaddress("yMNJePdcKvXtWWQnFYHNeJ5u8TF2v1dfK4", 15) - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) txidb1 = self.nodes[0].sendtoaddress("93bVhahvUKmQu8gu9g3QnPPa2cxFK98pMB", 15) - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) txid2 = self.nodes[0].sendtoaddress("yMNJePdcKvXtWWQnFYHNeJ5u8TF2v1dfK4", 20) - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) txidb2 = self.nodes[0].sendtoaddress("93bVhahvUKmQu8gu9g3QnPPa2cxFK98pMB", 20) self.generate(self.nodes[0], 1) @@ -233,10 +233,10 @@ class AddressIndexTest(BitcoinTestFramework): assert_equal(utxos2[0]["satoshis"], amount) # Check sorting of utxos - self.generate(self.nodes[2], 150) + self.generate(self.nodes[2], 150, sync_fun=self.no_op) self.nodes[2].sendtoaddress(address2, 50) - self.generate(self.nodes[2], 1) + self.generate(self.nodes[2], 1, sync_fun=self.no_op) self.nodes[2].sendtoaddress(address2, 50) self.generate(self.nodes[2], 1) self.sync_all() diff --git a/test/functional/feature_asset_locks.py b/test/functional/feature_asset_locks.py index 8070b151dc..89680fb254 100755 --- a/test/functional/feature_asset_locks.py +++ b/test/functional/feature_asset_locks.py @@ -294,7 +294,7 @@ class AssetLocksTest(DashTestFramework): assert_equal(rpc_tx["assetLockTx"]["creditOutputs"][0]["scriptPubKey"]["hex"], key_to_p2pkh_script(pubkey).hex()) assert_equal(rpc_tx["assetLockTx"]["creditOutputs"][1]["scriptPubKey"]["hex"], key_to_p2pkh_script(pubkey).hex()) self.validate_credit_pool_balance(0) - self.generate(node, 1) + self.generate(node, 1, sync_fun=self.no_op) assert_equal(self.get_credit_pool_balance(node=node), locked_1) self.log.info("Generate a number of blocks to ensure this is the longest chain for later in the test when we reconsiderblock") self.generate(node, 12) @@ -507,7 +507,7 @@ class AssetLocksTest(DashTestFramework): self.check_mempool_result(tx=spend_withdrawal, result_expected={'allowed': True, 'fees': {'base': Decimal(str(tiny_amount / COIN))}}) spend_txid_in_block = self.send_tx(spend_withdrawal) - self.generate(node, 1) + self.generate(node, 1, sync_fun=self.no_op) block = node.getblock(node.getbestblockhash()) assert spend_txid_in_block in block['tx'] diff --git a/test/functional/feature_dip0020_activation.py b/test/functional/feature_dip0020_activation.py index 6f375f0649..b091a30ddb 100755 --- a/test/functional/feature_dip0020_activation.py +++ b/test/functional/feature_dip0020_activation.py @@ -58,7 +58,7 @@ class DIP0020ActivationTest(BitcoinTestFramework): # This tx should be completely valid, should be included in mempool and mined in the next block assert txid in set(node.getrawmempool()) - self.generate(node, 1) + self.generate(node, 1, sync_fun=self.no_op) assert txid not in set(node.getrawmempool()) # Create spending tx @@ -83,9 +83,9 @@ class DIP0020ActivationTest(BitcoinTestFramework): helper_peer.send_blocks_and_test([test_block], node, success=False, reject_reason='block-validation-failed', expect_disconnect=True) self.log.info("Generate enough blocks to activate DIP0020 opcodes") - self.generate(node, 97) + self.generate(node, 97, sync_fun=self.no_op) assert not softfork_active(node, 'dip0020') - self.generate(node, 1) + self.generate(node, 1, sync_fun=self.no_op) assert softfork_active(node, 'dip0020') # flush state to disk before potential crashes below @@ -103,7 +103,7 @@ class DIP0020ActivationTest(BitcoinTestFramework): # txes spending new opcodes still won't be accepted into mempool if we roll back to the previous tip node.invalidateblock(node.getbestblockhash()) assert tx0id not in set(node.getrawmempool()) - self.generate(node, 1) + self.generate(node, 1, sync_fun=self.no_op) self.log.info("Transactions spending coins with new opcodes are accepted one block after DIP0020 activation block") node.sendrawtransaction(tx0_hex) diff --git a/test/functional/feature_dip3_deterministicmns.py b/test/functional/feature_dip3_deterministicmns.py index b5e24d6b16..4a88f8170b 100755 --- a/test/functional/feature_dip3_deterministicmns.py +++ b/test/functional/feature_dip3_deterministicmns.py @@ -49,7 +49,7 @@ class DIP3Test(BitcoinTestFramework): def run_test(self): self.log.info("funding controller node") while self.nodes[0].getbalance() < (self.num_initial_mn + 3) * 1000: - self.generate(self.nodes[0], 10) # generate enough for collaterals + self.generate(self.nodes[0], 10, sync_fun=self.no_op) # generate enough for collaterals self.log.info("controller node has {} dash".format(self.nodes[0].getbalance())) # Make sure we're below block 135 (which activates dip3) @@ -65,11 +65,11 @@ class DIP3Test(BitcoinTestFramework): mns.append(before_dip3_mn) # block 150 starts enforcing DIP3 MN payments - self.generate(self.nodes[0], 150 - self.nodes[0].getblockcount()) + self.generate(self.nodes[0], 150 - self.nodes[0].getblockcount(), sync_fun=self.no_op) assert self.nodes[0].getblockcount() == 150 self.log.info("mining final block for DIP3 activation") - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) # We have hundreds of blocks to sync here, give it more time self.log.info("syncing blocks for all nodes") @@ -101,7 +101,7 @@ class DIP3Test(BitcoinTestFramework): self.log.info("register %s" % mn.alias) self.register_mn(self.nodes[0], mn) - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) if not start: self.start_mn(mn) @@ -245,7 +245,7 @@ class DIP3Test(BitcoinTestFramework): mn.collateral_address = node.getnewaddress() mn.collateral_txid = node.sendtoaddress(mn.collateral_address, 1000) mn.collateral_vout = None - self.generate(node, 1) + self.generate(node, 1, sync_fun=self.no_op) rawtx = node.getrawtransaction(mn.collateral_txid, 1) for txout in rawtx['vout']: @@ -277,7 +277,7 @@ class DIP3Test(BitcoinTestFramework): mn.rewards_address = node.getnewaddress() mn.protx_hash = node.protx('register', mn.collateral_txid, mn.collateral_vout, '127.0.0.1:%d' % mn.p2p_port, mn.ownerAddr, mn.operatorAddr, mn.votingAddr, mn.operator_reward, mn.rewards_address, mn.fundsAddr) - self.generate(node, 1) + self.generate(node, 1, sync_fun=self.no_op) def start_mn(self, mn): if len(self.nodes) <= mn.idx: @@ -313,7 +313,7 @@ class DIP3Test(BitcoinTestFramework): # undo self.nodes[0].protx('update_service', mn.protx_hash, '127.0.0.1:%d' % mn.p2p_port, mn.blsMnkey, "", mn.fundsAddr) - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) def assert_mnlists(self, mns): for node in self.nodes: diff --git a/test/functional/feature_dip3_v19.py b/test/functional/feature_dip3_v19.py index 56d663013b..7da604aedc 100755 --- a/test/functional/feature_dip3_v19.py +++ b/test/functional/feature_dip3_v19.py @@ -130,7 +130,7 @@ class DIP3V19Test(DashTestFramework): protx_result = self.nodes[0].protx('revoke', revoke_protx, revoke_keyoperator, 1, funds_address) self.wait_for_instantlock(protx_result, self.nodes[0]) - tip = self.generate(self.nodes[0], 1)[0] + tip = self.generate(self.nodes[0], 1, sync_fun=self.no_op)[0] assert_equal(self.nodes[0].getrawtransaction(protx_result, 1, tip)['confirmations'], 1) # Revoking a MN results in disconnects. Wait for disconnects to actually happen # and then reconnect the corresponding node back to let sync_blocks finish correctly. diff --git a/test/functional/feature_dip4_coinbasemerkleroots.py b/test/functional/feature_dip4_coinbasemerkleroots.py index 28d01b445c..844e26ea61 100755 --- a/test/functional/feature_dip4_coinbasemerkleroots.py +++ b/test/functional/feature_dip4_coinbasemerkleroots.py @@ -91,7 +91,7 @@ class LLMQCoinbaseCommitmentsTest(DashTestFramework): ############################# # Now start testing quorum commitment merkle roots - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) oldhash = self.nodes[0].getbestblockhash() # Test DIP8 activation once with a pre-existing quorum and once without (we don't know in which order it will activate on mainnet) @@ -248,7 +248,7 @@ class LLMQCoinbaseCommitmentsTest(DashTestFramework): self.log.info("Wait for dip0008 activation") while self.nodes[0].getblockcount() < DIP0008_HEIGHT: self.bump_mocktime(10) - self.generate(self.nodes[0], 10) + self.generate(self.nodes[0], 10, sync_fun=self.no_op) if slow_mode: self.sync_blocks() self.sync_blocks() @@ -301,7 +301,7 @@ class LLMQCoinbaseCommitmentsTest(DashTestFramework): break if not found_unconfirmed: break - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) self.sync_blocks() if __name__ == '__main__': diff --git a/test/functional/feature_governance.py b/test/functional/feature_governance.py index 9d4497e73d..c53c6210d9 100755 --- a/test/functional/feature_governance.py +++ b/test/functional/feature_governance.py @@ -89,7 +89,7 @@ class DashGovernanceTest (DashTestFramework): assert_equal(len(self.nodes[0].gobject("list-prepared")), 0) self.log.info("Check 1st superblock before v20") - self.generate(self.nodes[0], 3) + self.generate(self.nodes[0], 3, sync_fun=self.no_op) self.bump_mocktime(3) self.sync_blocks() assert_equal(self.nodes[0].getblockcount(), 130) @@ -97,7 +97,7 @@ class DashGovernanceTest (DashTestFramework): self.check_superblockbudget(False) self.log.info("Check 2nd superblock before v20") - self.generate(self.nodes[0], 10) + self.generate(self.nodes[0], 10, sync_fun=self.no_op) self.bump_mocktime(10) self.sync_blocks() assert_equal(self.nodes[0].getblockcount(), 140) @@ -117,7 +117,7 @@ class DashGovernanceTest (DashTestFramework): p1_collateral_prepare = prepare_object(self.nodes[0], 1, uint256_to_string(0), proposal_time, 1, "Proposal_1", self.p1_amount, self.p1_payout_address) p2_collateral_prepare = prepare_object(self.nodes[0], 1, uint256_to_string(0), proposal_time, 1, "Proposal_2", self.p2_amount, self.p2_payout_address) - self.generate(self.nodes[0], 6) + self.generate(self.nodes[0], 6, sync_fun=self.no_op) self.bump_mocktime(6) self.sync_blocks() @@ -165,7 +165,7 @@ class DashGovernanceTest (DashTestFramework): self.log.info("v20 is expected to be activate since block 160") assert block_count + n < 160 for _ in range(n - 1): - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) self.bump_mocktime(1) self.sync_blocks() self.check_superblockbudget(False) @@ -193,8 +193,8 @@ class DashGovernanceTest (DashTestFramework): isolated = self.nodes[payee_idx] self.log.info("Move 1 block inside the Superblock maturity window on the isolated node") - self.generate(isolated, 1) self.bump_mocktime(1) + self.generate(isolated, 1, sync_fun=self.no_op) self.log.info("The isolated 'winner' should submit new trigger and vote for it") self.wait_until(lambda: len(isolated.gobject("list", "valid", "triggers")) == 1, timeout=5) isolated_trigger_hash = list(isolated.gobject("list", "valid", "triggers").keys())[0] @@ -203,8 +203,8 @@ class DashGovernanceTest (DashTestFramework): assert_equal(more_votes, False) self.log.info("Move 1 block enabling the Superblock maturity window on non-isolated nodes") - self.generate(self.nodes[0], 1) self.bump_mocktime(1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) assert_equal(self.nodes[0].getblockcount(), 150) assert_equal(self.nodes[0].getblockchaininfo()["softforks"]["v20"]["active"], False) self.check_superblockbudget(False) @@ -214,8 +214,8 @@ class DashGovernanceTest (DashTestFramework): assert_equal(has_trigger, False) self.log.info("Move 1 block inside the Superblock maturity window on non-isolated nodes") - self.generate(self.nodes[0], 1) self.bump_mocktime(1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) self.log.info("There is now new 'winner' who should submit new trigger and vote for it") self.wait_until(lambda: len(self.nodes[0].gobject("list", "valid", "triggers")) == 1, timeout=5) @@ -232,8 +232,8 @@ class DashGovernanceTest (DashTestFramework): assert(amount_str in payment_amounts_expected) self.log.info("Move another block inside the Superblock maturity window on non-isolated nodes") - self.generate(self.nodes[0], 1) self.bump_mocktime(1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) self.log.info("Every non-isolated MN should vote for the same trigger now, no new triggers should be created") self.wait_until(lambda: list(self.nodes[0].gobject("list", "valid", "triggers").values())[0]['YesCount'] == self.mn_count - 1, timeout=5) @@ -268,7 +268,7 @@ class DashGovernanceTest (DashTestFramework): assert_equal(more_triggers, False) self.log.info("Move another block inside the Superblock maturity window") - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) self.bump_mocktime(1) self.sync_blocks() @@ -284,7 +284,7 @@ class DashGovernanceTest (DashTestFramework): self.log.info("Move another block inside the Superblock maturity window") with self.nodes[1].assert_debug_log(["CGovernanceManager::VoteGovernanceTriggers"]): - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) self.bump_mocktime(1) self.sync_blocks() @@ -298,7 +298,7 @@ class DashGovernanceTest (DashTestFramework): self.log.info("Move remaining n blocks until actual Superblock") for i in range(n): - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) self.bump_mocktime(1) self.sync_blocks() # comparing to 159 because bip9 forks are active when the tip is one block behind the activation height @@ -310,7 +310,7 @@ class DashGovernanceTest (DashTestFramework): self.log.info("Move a few block past the recent superblock height and make sure we have no new votes") for _ in range(5): with self.nodes[1].assert_debug_log("", [f"Voting NO-FUNDING for trigger:{winning_trigger_hash} success"]): - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) self.bump_mocktime(1) self.sync_blocks() # Votes on both triggers should NOT change @@ -322,13 +322,13 @@ class DashGovernanceTest (DashTestFramework): self.log.info("Move remaining n blocks until the next Superblock") for _ in range(n - 1): - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) self.bump_mocktime(1) self.sync_blocks() self.log.info("Wait for new trigger and votes") self.wait_until(lambda: have_trigger_for_height(self.nodes, 180)) self.log.info("Mine superblock") - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) self.bump_mocktime(1) self.sync_blocks() assert_equal(self.nodes[0].getblockcount(), 180) @@ -337,14 +337,14 @@ class DashGovernanceTest (DashTestFramework): self.log.info("Mine and check a couple more superblocks") for i in range(2): for _ in range(sb_cycle - 1): - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) self.bump_mocktime(1) self.sync_blocks() # Wait for new trigger and votes sb_block_height = 180 + (i + 1) * sb_cycle self.wait_until(lambda: have_trigger_for_height(self.nodes, sb_block_height)) # Mine superblock - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) self.bump_mocktime(1) self.sync_blocks() assert_equal(self.nodes[0].getblockcount(), sb_block_height) diff --git a/test/functional/feature_governance_cl.py b/test/functional/feature_governance_cl.py index fb7bee08f6..bf5e6530bd 100755 --- a/test/functional/feature_governance_cl.py +++ b/test/functional/feature_governance_cl.py @@ -83,7 +83,7 @@ class DashGovernanceTest (DashTestFramework): p1_collateral_prepare = self.prepare_object(1, uint256_to_string(0), proposal_time, 1, "Proposal_1", self.p1_amount, self.p1_payout_address) self.bump_mocktime(60 * 10 + 1) - self.generate(self.nodes[0], 6) + self.generate(self.nodes[0], 6, sync_fun=self.no_op) self.bump_mocktime(6 * 156) self.sync_blocks() @@ -158,7 +158,7 @@ class DashGovernanceTest (DashTestFramework): self.log.info("Reconnect isolated node and confirm the next ChainLock will let it sync") self.reconnect_isolated_node(5, 0) assert_equal(self.nodes[5].mnsync("status")["IsSynced"], False) - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) # NOTE: bumping mocktime too much after recent reconnect can result in "timeout downloading block" self.bump_mocktime(1) self.sync_blocks() diff --git a/test/functional/feature_llmq_chainlocks.py b/test/functional/feature_llmq_chainlocks.py index 10bb909390..03807ddd2b 100755 --- a/test/functional/feature_llmq_chainlocks.py +++ b/test/functional/feature_llmq_chainlocks.py @@ -38,7 +38,7 @@ class LLMQChainLocksTest(DashTestFramework): self.test_coinbase_best_cl(self.nodes[0], expected_cl_in_cb=False) # v20 is active, no quorums, no CLs - null CL in CbTx - nocl_block_hash = self.generate(self.nodes[0], 1)[0] + nocl_block_hash = self.generate(self.nodes[0], 1, sync_fun=self.no_op)[0] self.test_coinbase_best_cl(self.nodes[0], expected_cl_in_cb=True, expected_null_cl=True) cbtx = self.nodes[0].getspecialtxes(nocl_block_hash, 5, 1, 0, 2)[0] assert_equal(cbtx["instantlock"], False) @@ -59,7 +59,7 @@ class LLMQChainLocksTest(DashTestFramework): self.log.info("Mine single block, wait for chainlock") - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) self.wait_for_chainlocked_block_all_nodes(self.nodes[0].getbestblockhash()) self.test_coinbase_best_cl(self.nodes[0]) @@ -70,7 +70,7 @@ class LLMQChainLocksTest(DashTestFramework): assert_equal(cbtx["chainlock"], True) self.log.info("Mine many blocks, wait for chainlock") - self.generate(self.nodes[0], 20) + self.generate(self.nodes[0], 20, sync_fun=self.no_op) # We need more time here due to 20 blocks being generated at once self.wait_for_chainlocked_block_all_nodes(self.nodes[0].getbestblockhash(), timeout=30) self.test_coinbase_best_cl(self.nodes[0]) @@ -90,7 +90,7 @@ class LLMQChainLocksTest(DashTestFramework): self.log.info("Generate new blocks and verify that they are not chainlocked") previous_block_hash = self.nodes[0].getbestblockhash() for _ in range(2): - block_hash = self.generate(self.nodes[0], 1)[0] + block_hash = self.generate(self.nodes[0], 1, sync_fun=self.no_op)[0] self.wait_for_chainlocked_block_all_nodes(block_hash, expected=False) assert self.nodes[0].getblock(previous_block_hash)["chainlock"] @@ -101,18 +101,18 @@ class LLMQChainLocksTest(DashTestFramework): self.isolate_node(0) node0_mining_addr = self.nodes[0].getnewaddress() node0_tip = self.nodes[0].getbestblockhash() - self.generatetoaddress(self.nodes[1], 5, node0_mining_addr) + self.generatetoaddress(self.nodes[1], 5, node0_mining_addr, sync_fun=self.no_op) self.wait_for_chainlocked_block(self.nodes[1], self.nodes[1].getbestblockhash()) self.test_coinbase_best_cl(self.nodes[0]) assert self.nodes[0].getbestblockhash() == node0_tip self.reconnect_isolated_node(0, 1) - self.generatetoaddress(self.nodes[1], 1, node0_mining_addr) + self.generatetoaddress(self.nodes[1], 1, node0_mining_addr, sync_fun=self.no_op) self.wait_for_chainlocked_block_all_nodes(self.nodes[1].getbestblockhash()) self.test_coinbase_best_cl(self.nodes[0]) self.log.info("Isolate node, mine on another, reconnect and submit CL via RPC") self.isolate_node(0) - self.generate(self.nodes[1], 1) + self.generate(self.nodes[1], 1, sync_fun=self.no_op) self.wait_for_chainlocked_block(self.nodes[1], self.nodes[1].getbestblockhash()) best_0 = self.nodes[0].getbestchainlock() best_1 = self.nodes[1].getbestchainlock() @@ -134,13 +134,13 @@ class LLMQChainLocksTest(DashTestFramework): self.log.info("Isolate node, mine on both parts of the network, and reconnect") self.isolate_node(0) - bad_tip = self.generate(self.nodes[0], 5)[-1] - self.generatetoaddress(self.nodes[1], 1, node0_mining_addr) + bad_tip = self.generate(self.nodes[0], 5, sync_fun=self.no_op)[-1] + self.generatetoaddress(self.nodes[1], 1, node0_mining_addr, sync_fun=self.no_op) good_tip = self.nodes[1].getbestblockhash() self.wait_for_chainlocked_block(self.nodes[1], good_tip) assert not self.nodes[0].getblock(self.nodes[0].getbestblockhash())["chainlock"] self.reconnect_isolated_node(0, 1) - self.generatetoaddress(self.nodes[1], 1, node0_mining_addr) + self.generatetoaddress(self.nodes[1], 1, node0_mining_addr, sync_fun=self.no_op) self.wait_for_chainlocked_block_all_nodes(self.nodes[1].getbestblockhash()) self.test_coinbase_best_cl(self.nodes[0]) assert self.nodes[0].getblock(self.nodes[0].getbestblockhash())["previousblockhash"] == good_tip @@ -163,10 +163,10 @@ class LLMQChainLocksTest(DashTestFramework): assert self.nodes[0].getbestblockhash() == good_tip self.nodes[0].invalidateblock(good_tip) self.log.info("Now try to reorg the chain") - self.generate(self.nodes[0], 2) + self.generate(self.nodes[0], 2, sync_fun=self.no_op) time.sleep(6) assert self.nodes[1].getbestblockhash() == good_tip - bad_tip = self.generate(self.nodes[0], 2)[-1] + bad_tip = self.generate(self.nodes[0], 2, sync_fun=self.no_op)[-1] time.sleep(6) assert self.nodes[0].getbestblockhash() == bad_tip assert self.nodes[1].getbestblockhash() == good_tip @@ -175,7 +175,7 @@ class LLMQChainLocksTest(DashTestFramework): self.nodes[0].reconsiderblock(good_tip) assert self.nodes[0].getbestblockhash() != good_tip good_fork = good_tip - good_tip = self.generatetoaddress(self.nodes[1], 1, node0_mining_addr)[-1] # this should mark bad_tip as conflicting + good_tip = self.generatetoaddress(self.nodes[1], 1, node0_mining_addr, sync_fun=self.no_op)[-1] # this should mark bad_tip as conflicting self.wait_for_chainlocked_block_all_nodes(good_tip) self.test_coinbase_best_cl(self.nodes[0]) assert self.nodes[0].getbestblockhash() == good_tip @@ -203,7 +203,7 @@ class LLMQChainLocksTest(DashTestFramework): txs.append(self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1)) txs += self.create_chained_txs(self.nodes[0], 1) self.log.info("Assert that after block generation these TXs are NOT included (as they are \"unsafe\")") - node0_tip = self.generate(self.nodes[0], 1)[-1] + node0_tip = self.generate(self.nodes[0], 1, sync_fun=self.no_op)[-1] for txid in txs: tx = self.nodes[0].getrawtransaction(txid, 1) assert "confirmations" not in tx @@ -214,7 +214,7 @@ class LLMQChainLocksTest(DashTestFramework): self.log.info("Disable LLMQ based InstantSend for a very short time (this never gets propagated to other nodes)") self.nodes[0].sporkupdate("SPORK_2_INSTANTSEND_ENABLED", 4070908800) self.log.info("Now the TXs should be included") - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) self.nodes[0].sporkupdate("SPORK_2_INSTANTSEND_ENABLED", 0) self.log.info("Assert that TXs got included now") for txid in txs: @@ -296,12 +296,12 @@ class LLMQChainLocksTest(DashTestFramework): def test_bestCLHeightDiff(self, mn_rr_active): # We need 2 blocks we can grab clsigs from for _ in range(2): - self.wait_for_chainlocked_block_all_nodes(self.generate(self.nodes[0], 1)[0]) + self.wait_for_chainlocked_block_all_nodes(self.generate(self.nodes[0], 1, sync_fun=self.no_op)[0]) assert_equal(softfork_active(self.nodes[1], "mn_rr"), mn_rr_active) tip1_hash = self.nodes[1].getbestblockhash() self.isolate_node(1) - tip0_hash = self.generate(self.nodes[0], 1)[0] + tip0_hash = self.generate(self.nodes[0], 1, sync_fun=self.no_op)[0] block_hex = self.nodes[0].getblock(tip0_hash, 0) mal_block = CBlock() mal_block.deserialize(BytesIO(bytes.fromhex(block_hex))) diff --git a/test/functional/feature_llmq_connections.py b/test/functional/feature_llmq_connections.py index 10aab3789d..29a335378a 100755 --- a/test/functional/feature_llmq_connections.py +++ b/test/functional/feature_llmq_connections.py @@ -44,7 +44,7 @@ class LLMQConnections(DashTestFramework): self.wait_for_sporks_same() self.log.info("mining one block and waiting for all members to connect to each other") - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) for mn in self.get_quorum_masternodes(q): self.wait_for_mnauth(mn.node, 4) diff --git a/test/functional/feature_llmq_data_recovery.py b/test/functional/feature_llmq_data_recovery.py index e7f2bed482..4dd6cf7c83 100755 --- a/test/functional/feature_llmq_data_recovery.py +++ b/test/functional/feature_llmq_data_recovery.py @@ -46,7 +46,7 @@ class QuorumDataRecoveryTest(DashTestFramework): self.connect_nodes(mn.node.index, 0) if qdata_recovery_enabled: # trigger recovery threads and wait for them to start - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) self.bump_mocktime(self.quorum_data_thread_request_timeout_seconds + 1) time.sleep(1) @@ -177,14 +177,14 @@ class QuorumDataRecoveryTest(DashTestFramework): self.test_mns(llmq_test_v17, quorum_hash_recover, valid_mns=[last_resort_v17], all_mns=member_mns_recover_v17) # If recovery would be enabled it would trigger after the mocktime bump / mined block self.bump_mocktime(self.quorum_data_request_expiration_timeout + 1) - self.generate(node, 1) + self.generate(node, 1, sync_fun=self.no_op) time.sleep(10) # Make sure they are still invalid self.test_mns(llmq_test, quorum_hash_recover, valid_mns=[last_resort_test], all_mns=member_mns_recover_test) self.test_mns(llmq_test_v17, quorum_hash_recover, valid_mns=[last_resort_v17], all_mns=member_mns_recover_v17) # Mining a block should not result in a chainlock now because the responsible quorum shouldn't have enough # valid members. - self.wait_for_chainlocked_block(node, self.generate(node, 1)[0], False, 5) + self.wait_for_chainlocked_block(node, self.generate(node, 1, sync_fun=self.no_op)[0], False, 5) # Now restart with recovery enabled self.restart_mns(mns=recover_members, exclude=exclude_members, reindex=True, qdata_recovery_enabled=True) # Validate that all invalid members recover. Note: recover=True leads to mocktime bumps and mining while waiting diff --git a/test/functional/feature_llmq_dkgerrors.py b/test/functional/feature_llmq_dkgerrors.py index f3151ef02f..380474544e 100755 --- a/test/functional/feature_llmq_dkgerrors.py +++ b/test/functional/feature_llmq_dkgerrors.py @@ -85,7 +85,7 @@ class LLMQDKGErrors(DashTestFramework): self.wait_for_sporks_same() for _ in range(blockCount): self.bump_mocktime(1) - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) self.sync_all() self.nodes[0].sporkupdate("SPORK_17_QUORUM_DKG_ENABLED", 0) self.wait_for_sporks_same() diff --git a/test/functional/feature_llmq_evo.py b/test/functional/feature_llmq_evo.py index b2b60bdb29..81f7549312 100755 --- a/test/functional/feature_llmq_evo.py +++ b/test/functional/feature_llmq_evo.py @@ -165,7 +165,7 @@ class LLMQEvoNodesTest(DashTestFramework): current_evo = None consecutive_payments = 0 - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) if i % 8 == 0: self.sync_blocks() diff --git a/test/functional/feature_llmq_is_cl_conflicts.py b/test/functional/feature_llmq_is_cl_conflicts.py index 2369c59fa4..db1188cfcc 100755 --- a/test/functional/feature_llmq_is_cl_conflicts.py +++ b/test/functional/feature_llmq_is_cl_conflicts.py @@ -71,7 +71,7 @@ class LLMQ_IS_CL_Conflicts(DashTestFramework): self.mine_cycle_quorum(llmq_type_name='llmq_test_dip0024', llmq_type=103) # mine single block, wait for chainlock - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) self.wait_for_chainlocked_block_all_nodes(self.nodes[0].getbestblockhash()) self.test_chainlock_overrides_islock(False) diff --git a/test/functional/feature_llmq_is_retroactive.py b/test/functional/feature_llmq_is_retroactive.py index 68e1aadcce..78ca8737c3 100755 --- a/test/functional/feature_llmq_is_retroactive.py +++ b/test/functional/feature_llmq_is_retroactive.py @@ -54,7 +54,7 @@ class LLMQ_IS_RetroactiveSigning(DashTestFramework): self.wait_for_sporks_same() # We have to wait in order to include tx in block self.bump_mocktime(10 * 60 + 1) - block = self.generate(self.nodes[0], 1)[0] + block = self.generate(self.nodes[0], 1, sync_fun=self.no_op)[0] self.wait_for_instantlock(txid, self.nodes[0]) self.nodes[0].sporkupdate("SPORK_19_CHAINLOCKS_ENABLED", 0) self.wait_for_sporks_same() @@ -70,7 +70,7 @@ class LLMQ_IS_RetroactiveSigning(DashTestFramework): # are the only "neighbours" in intra-quorum connections for one of them. self.wait_for_instantlock(txid, self.nodes[0]) self.bump_mocktime(1) - block = self.generate(self.nodes[0], 1)[0] + block = self.generate(self.nodes[0], 1, sync_fun=self.no_op)[0] self.wait_for_chainlocked_block_all_nodes(block) self.log.info("testing normal signing with partially known TX") @@ -100,7 +100,7 @@ class LLMQ_IS_RetroactiveSigning(DashTestFramework): txid = self.nodes[3].sendrawtransaction(rawtx) # Make node 3 consider the TX as safe self.bump_mocktime(10 * 60 + 1) - block = self.generatetoaddress(self.nodes[3], 1, self.nodes[0].getnewaddress())[0] + block = self.generatetoaddress(self.nodes[3], 1, self.nodes[0].getnewaddress(), sync_fun=self.no_op)[0] self.reconnect_isolated_node(3, 0) self.wait_for_chainlocked_block_all_nodes(block) self.nodes[0].setmocktime(self.mocktime) @@ -120,7 +120,7 @@ class LLMQ_IS_RetroactiveSigning(DashTestFramework): self.wait_for_instantlock(txid, self.nodes[0], False, 5) # Make node0 consider the TX as safe self.bump_mocktime(10 * 60 + 1) - block = self.generate(self.nodes[0], 1)[0] + block = self.generate(self.nodes[0], 1, sync_fun=self.no_op)[0] assert txid in self.nodes[0].getblock(block, 1)['tx'] self.wait_for_chainlocked_block_all_nodes(block) @@ -166,7 +166,7 @@ class LLMQ_IS_RetroactiveSigning(DashTestFramework): self.wait_for_instantlock(txid, self.nodes[0], False, 5) # Make node 0 consider the TX as safe self.bump_mocktime(10 * 60 + 1) - block = self.generate(self.nodes[0], 1)[0] + block = self.generate(self.nodes[0], 1, sync_fun=self.no_op)[0] assert txid in self.nodes[0].getblock(block, 1)['tx'] self.wait_for_chainlocked_block_all_nodes(block) @@ -198,7 +198,7 @@ class LLMQ_IS_RetroactiveSigning(DashTestFramework): self.wait_for_instantlock(txid, self.nodes[0], False, 5) # Make node 0 consider the TX as safe self.bump_mocktime(10 * 60 + 1) - block = self.generate(self.nodes[0], 1)[0] + block = self.generate(self.nodes[0], 1, sync_fun=self.no_op)[0] assert txid in self.nodes[0].getblock(block, 1)['tx'] self.wait_for_chainlocked_block_all_nodes(block) diff --git a/test/functional/feature_llmq_rotation.py b/test/functional/feature_llmq_rotation.py index 8dd187f7ae..31e637686b 100755 --- a/test/functional/feature_llmq_rotation.py +++ b/test/functional/feature_llmq_rotation.py @@ -88,7 +88,7 @@ class LLMQQuorumRotationTest(DashTestFramework): h_104_1 = QuorumId(104, int(h_1, 16)) self.log.info("Mine single block, wait for chainlock") - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) self.wait_for_chainlocked_block_all_nodes(self.nodes[0].getbestblockhash()) b_h_1 = self.nodes[0].getbestblockhash() @@ -119,7 +119,7 @@ class LLMQQuorumRotationTest(DashTestFramework): assert_equal(projected_activation_height, softfork_info['height']) # v20 is active for the next block, not for the tip - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) self.log.info("Wait for chainlock") self.wait_for_chainlocked_block_all_nodes(self.nodes[0].getbestblockhash()) @@ -200,7 +200,7 @@ class LLMQQuorumRotationTest(DashTestFramework): self.sync_blocks(nodes) quorum_list = self.nodes[0].quorum("list", llmq_type) quorum_blockhash = self.nodes[0].getbestblockhash() - fallback_blockhash = self.generate(self.nodes[0], 1)[0] + fallback_blockhash = self.generate(self.nodes[0], 1, sync_fun=self.no_op)[0] self.log.info("h("+str(self.nodes[0].getblockcount())+") quorum_list:"+str(quorum_list)) assert_greater_than_or_equal(len(intersection(quorum_members_0_0, quorum_members_1_0)), 3) diff --git a/test/functional/feature_llmq_simplepose.py b/test/functional/feature_llmq_simplepose.py index b984b89bc4..4c8a6c92d8 100755 --- a/test/functional/feature_llmq_simplepose.py +++ b/test/functional/feature_llmq_simplepose.py @@ -107,7 +107,7 @@ class LLMQSimplePoSeTest(DashTestFramework): skip_count = 24 - (self.nodes[0].getblockcount() % 24) if skip_count != 0: self.bump_mocktime(skip_count, nodes=nodes) - self.generate(self.nodes[0], skip_count) + self.generate(self.nodes[0], skip_count, sync_fun=self.no_op) self.sync_blocks(nodes) q = self.nodes[0].getbestblockhash() diff --git a/test/functional/feature_new_quorum_type_activation.py b/test/functional/feature_new_quorum_type_activation.py index 85fa97a5f9..9e7dc08b8c 100755 --- a/test/functional/feature_new_quorum_type_activation.py +++ b/test/functional/feature_new_quorum_type_activation.py @@ -22,17 +22,17 @@ class NewQuorumTypeActivationTest(BitcoinTestFramework): def run_test(self): self.log.info(get_bip9_details(self.nodes[0], 'testdummy')) assert_equal(get_bip9_details(self.nodes[0], 'testdummy')['status'], 'defined') - self.generate(self.nodes[0], 9) + self.generate(self.nodes[0], 9, sync_fun=self.no_op) assert_equal(get_bip9_details(self.nodes[0], 'testdummy')['status'], 'started') ql = self.nodes[0].quorum("list") assert_equal(len(ql), 3) assert "llmq_test_v17" not in ql - self.generate(self.nodes[0], 10) + self.generate(self.nodes[0], 10, sync_fun=self.no_op) assert_equal(get_bip9_details(self.nodes[0], 'testdummy')['status'], 'locked_in') ql = self.nodes[0].quorum("list") assert_equal(len(ql), 3) assert "llmq_test_v17" not in ql - self.generate(self.nodes[0], 10) + self.generate(self.nodes[0], 10, sync_fun=self.no_op) assert_equal(get_bip9_details(self.nodes[0], 'testdummy')['status'], 'active') ql = self.nodes[0].quorum("list") assert_equal(len(ql), 4) diff --git a/test/functional/feature_sporks.py b/test/functional/feature_sporks.py index a958721567..4843c2d750 100755 --- a/test/functional/feature_sporks.py +++ b/test/functional/feature_sporks.py @@ -53,7 +53,7 @@ class SporkTest(BitcoinTestFramework): assert self.get_test_spork_state(self.nodes[1]) == spork_new_state # Generate one block to kick off masternode sync, which also starts sporks syncing for node2 - self.generate(self.nodes[1], 1) + self.generate(self.nodes[1], 1, sync_fun=self.no_op) # connect new node and check spork propagation after restoring from cache self.connect_nodes(1, 2) diff --git a/test/functional/interface_zmq_dash.py b/test/functional/interface_zmq_dash.py index 6483b12460..fdec9a4744 100755 --- a/test/functional/interface_zmq_dash.py +++ b/test/functional/interface_zmq_dash.py @@ -213,7 +213,7 @@ class DashZMQTest (DashTestFramework): # Subscribe to recovered signature messages self.subscribe(recovered_sig_publishers) # Generate a ChainLock and make sure this leads to valid recovered sig ZMQ messages - rpc_last_block_hash = self.generate(self.nodes[0], 1)[0] + rpc_last_block_hash = self.generate(self.nodes[0], 1, sync_fun=self.no_op)[0] self.wait_for_chainlocked_block_all_nodes(rpc_last_block_hash) height = self.nodes[0].getblockcount() rpc_request_id = hash256(ser_string(b"clsig") + struct.pack(" 0: - self.generate(self.nodes[0], 1) + self.generate(self.nodes[0], 1, sync_fun=self.no_op) operatorPayoutAddress = self.nodes[0].getnewaddress() self.nodes[0].protx('update_service', proTxHash, ipAndPort, bls['secret'], operatorPayoutAddress, address)