From 4b4001bbe774a8ca045bf78fafe4ee5a3fd119af Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Thu, 15 Aug 2024 14:35:37 +0700 Subject: [PATCH] perf: activate v20 on the same block as v19 for Reg Test --- src/chainparams.cpp | 2 +- src/test/block_reward_reallocation_tests.cpp | 4 +++- test/functional/feature_asset_locks.py | 7 +++---- test/functional/feature_block.py | 4 ++-- test/functional/feature_blockfilterindex_prune.py | 2 +- test/functional/feature_dip3_v19.py | 5 ++++- test/functional/feature_llmq_chainlocks.py | 2 +- test/functional/feature_llmq_rotation.py | 4 ++-- test/functional/p2p_ibd_stalling.py | 2 +- test/functional/rpc_blockchain.py | 2 +- 10 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index fdd96c01e0..9b48ea2527 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -789,7 +789,7 @@ public: consensus.DIP0024Height = 900; consensus.DIP0024QuorumsHeight = 900; consensus.V19Height = 900; - consensus.V20Height = 1200; + consensus.V20Height = 900; consensus.MinBIP9WarningHeight = 0; consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 1 consensus.nPowTargetTimespan = 24 * 60 * 60; // Dash: 1 day diff --git a/src/test/block_reward_reallocation_tests.cpp b/src/test/block_reward_reallocation_tests.cpp index bd87cf7f06..bdca763641 100644 --- a/src/test/block_reward_reallocation_tests.cpp +++ b/src/test/block_reward_reallocation_tests.cpp @@ -36,7 +36,9 @@ struct TestChainBRRBeforeActivationSetup : public TestChainSetup { // Force fast DIP3 activation TestChainBRRBeforeActivationSetup() : - TestChainSetup(497, {"-dip3params=30:50", "-testactivationheight=brr@1000", + TestChainSetup(497, {"-dip3params=30:50", + "-testactivationheight=brr@1000", + "-testactivationheight=v20@1200", "-vbparams=mn_rr:0:999999999999:0:20:16:12:5:1"}) { } diff --git a/test/functional/feature_asset_locks.py b/test/functional/feature_asset_locks.py index de207dbb94..5f0f03e77a 100755 --- a/test/functional/feature_asset_locks.py +++ b/test/functional/feature_asset_locks.py @@ -242,8 +242,8 @@ class AssetLocksTest(DashTestFramework): self.set_sporks() - self.activate_v19(expected_activation_height=900) - self.log.info("Activated v19 at height:" + str(node.getblockcount())) + self.activate_v20(expected_activation_height=900) + self.log.info("Activated v20 at height:" + str(node.getblockcount())) self.nodes[0].sporkupdate("SPORK_2_INSTANTSEND_ENABLED", 0) self.wait_for_sporks_same() @@ -256,7 +256,6 @@ class AssetLocksTest(DashTestFramework): self.sync_blocks() self.set_sporks() - self.activate_v20() node.generate(1) self.sync_all() self.mempool_size = 0 @@ -640,7 +639,7 @@ class AssetLocksTest(DashTestFramework): all_mn_rewards = platform_reward + owner_reward + operator_reward assert_equal(all_mn_rewards, bt['coinbasevalue'] * 3 // 4) # 75/25 mn/miner reward split assert_equal(platform_reward, all_mn_rewards * 375 // 1000) # 0.375 platform share - assert_equal(platform_reward, 31916328) + assert_equal(platform_reward, 37015386) assert_equal(locked, self.get_credit_pool_balance()) node.generate(1) self.sync_all() diff --git a/test/functional/feature_block.py b/test/functional/feature_block.py index 50140901ea..460cf4571d 100755 --- a/test/functional/feature_block.py +++ b/test/functional/feature_block.py @@ -85,12 +85,12 @@ class FullBlockTest(BitcoinTestFramework): # Very large reorgs cause cs_main to be held for a very long time in ActivateBestChainStep, # which causes RPC to hang, so we need to increase RPC timeouts self.rpc_timeout = 180 - # Must set '-dip3params=2000:2000' to create pre-dip3 blocks only self.extra_args = [[ - '-dip3params=2000:2000', + '-dip3params=2000:2000', # Must set '-dip3params=2000:2000' to create pre-dip3 blocks only '-acceptnonstdtxn=1', # This is a consensus block test, we don't care about tx policy '-testactivationheight=bip34@2', '-testactivationheight=dip0001@2000', + '-testactivationheight=v20@2000', ]] def setup_nodes(self): diff --git a/test/functional/feature_blockfilterindex_prune.py b/test/functional/feature_blockfilterindex_prune.py index 9cc2d16d91..2f60d21456 100755 --- a/test/functional/feature_blockfilterindex_prune.py +++ b/test/functional/feature_blockfilterindex_prune.py @@ -43,7 +43,7 @@ class FeatureBlockfilterindexPruneTest(BitcoinTestFramework): assert_greater_than(len(self.nodes[0].getblockfilter(self.nodes[0].getblockhash(2))['filter']), 0) self.log.info("start node without blockfilterindex") - self.restart_node(0, extra_args=["-fastprune", "-prune=1"], expected_stderr=EXPECTED_STDERR_NO_GOV_PRUNE) + self.restart_node(0, extra_args=["-fastprune", "-prune=1", '-testactivationheight=v20@2000'], expected_stderr=EXPECTED_STDERR_NO_GOV_PRUNE) self.log.info("make sure accessing the blockfilters throws an error") assert_raises_rpc_error(-1, "Index is not enabled for filtertype basic", self.nodes[0].getblockfilter, self.nodes[0].getblockhash(2)) diff --git a/test/functional/feature_dip3_v19.py b/test/functional/feature_dip3_v19.py index fd987c7be2..065fea1509 100755 --- a/test/functional/feature_dip3_v19.py +++ b/test/functional/feature_dip3_v19.py @@ -43,7 +43,10 @@ class TestP2PConn(P2PInterface): class DIP3V19Test(DashTestFramework): def set_test_params(self): - self.set_dash_test_params(6, 5, fast_dip3_enforcement=True, evo_count=2) + self.extra_args = [[ + '-testactivationheight=v20@1200', # required otherwise mine_quorum("llmq_test [100]") fails + ]] * 6 + self.set_dash_test_params(6, 5, fast_dip3_enforcement=True, evo_count=2, extra_args=self.extra_args) def run_test(self): # Connect all nodes to node1 so that we always have the whole network connected diff --git a/test/functional/feature_llmq_chainlocks.py b/test/functional/feature_llmq_chainlocks.py index 72f2cd6f93..db23d2419e 100755 --- a/test/functional/feature_llmq_chainlocks.py +++ b/test/functional/feature_llmq_chainlocks.py @@ -33,7 +33,7 @@ class LLMQChainLocksTest(DashTestFramework): self.test_coinbase_best_cl(self.nodes[0], expected_cl_in_cb=False) - self.activate_v20(expected_activation_height=1200) + self.activate_v20(expected_activation_height=900) self.log.info("Activated v20 at height:" + str(self.nodes[0].getblockcount())) # v20 is active for the next block, not for the tip diff --git a/test/functional/feature_llmq_rotation.py b/test/functional/feature_llmq_rotation.py index 8bfcbbd6a6..7a93731269 100755 --- a/test/functional/feature_llmq_rotation.py +++ b/test/functional/feature_llmq_rotation.py @@ -113,9 +113,9 @@ class LLMQQuorumRotationTest(DashTestFramework): expectedNew = [h_100_0, h_106_0, h_104_0, h_100_1, h_106_1, h_104_1] quorumList = self.test_getmnlistdiff_quorums(b_h_0, b_h_1, {}, expectedDeleted, expectedNew, testQuorumsCLSigs=False) - projected_activation_height = 1200 + projected_activation_height = 900 - self.activate_v20(expected_activation_height=1200) + self.activate_v20(expected_activation_height=900) self.log.info("Activated v20 at height:" + str(self.nodes[0].getblockcount())) softfork_info = self.nodes[0].getblockchaininfo()['softforks']['v20'] diff --git a/test/functional/p2p_ibd_stalling.py b/test/functional/p2p_ibd_stalling.py index e74c18827b..11380abd62 100755 --- a/test/functional/p2p_ibd_stalling.py +++ b/test/functional/p2p_ibd_stalling.py @@ -48,7 +48,7 @@ class P2PStaller(P2PDataStore): class P2PIBDStallingTest(BitcoinTestFramework): def set_test_params(self): self.disable_mocktime = True - self.extra_args = [["-dip3params=2000:2000"]] + self.extra_args = [["-dip3params=2000:2000", "-testactivationheight=v20@2000"]] self.setup_clean_chain = True self.num_nodes = 1 diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py index 28deda6908..c5720db513 100755 --- a/test/functional/rpc_blockchain.py +++ b/test/functional/rpc_blockchain.py @@ -155,7 +155,7 @@ class BlockchainTest(BitcoinTestFramework): 'dip0024': { 'type': 'buried', 'active': False, 'height': 900}, 'realloc': { 'type': 'buried', 'active': True, 'height': 1}, 'v19': { 'type': 'buried', 'active': False, 'height': 900}, - 'v20': { 'type': 'buried', 'active': False, 'height': 1200}, + 'v20': { 'type': 'buried', 'active': False, 'height': 900}, 'mn_rr': { 'type': 'bip9', 'bip9': {