Skip to content

Commit c15b3d9

Browse files
committed
feat: activate v20 on the same block as v19
That helps to run functional tests on regtest faster: no need to wait extra 300 blocks for activation v20 when there is no intentional tests of state between v19 and v20
1 parent 4ade970 commit c15b3d9

9 files changed

+18
-14
lines changed

src/chainparams.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ class CRegTestParams : public CChainParams {
789789
consensus.DIP0024Height = 900;
790790
consensus.DIP0024QuorumsHeight = 900;
791791
consensus.V19Height = 900;
792-
consensus.V20Height = 1200;
792+
consensus.V20Height = 900;
793793
consensus.MinBIP9WarningHeight = 0;
794794
consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 1
795795
consensus.nPowTargetTimespan = 24 * 60 * 60; // Dash: 1 day

src/test/block_reward_reallocation_tests.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ struct TestChainBRRBeforeActivationSetup : public TestChainSetup
3636
{
3737
// Force fast DIP3 activation
3838
TestChainBRRBeforeActivationSetup() :
39-
TestChainSetup(497, {"-dip3params=30:50", "-testactivationheight=brr@1000",
39+
TestChainSetup(497, {"-dip3params=30:50",
40+
"-testactivationheight=brr@1000",
41+
"-testactivationheight=v20@1200",
4042
"-vbparams=mn_rr:0:999999999999:0:20:16:12:5:1"})
4143
{
4244
}

test/functional/feature_asset_locks.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ def run_test(self):
239239

240240
self.set_sporks()
241241

242-
self.activate_v19(expected_activation_height=900)
243-
self.log.info("Activated v19 at height:" + str(node.getblockcount()))
242+
self.activate_v20(expected_activation_height=900)
243+
self.log.info("Activated v20 at height:" + str(node.getblockcount()))
244244

245245
self.nodes[0].sporkupdate("SPORK_2_INSTANTSEND_ENABLED", 0)
246246
self.wait_for_sporks_same()
@@ -253,7 +253,6 @@ def run_test(self):
253253
self.sync_blocks()
254254

255255
self.set_sporks()
256-
self.activate_v20()
257256
node.generate(1)
258257
self.sync_all()
259258
self.mempool_size = 0
@@ -633,7 +632,7 @@ def test_mn_rr(self, node_wallet, node, pubkey):
633632
all_mn_rewards = platform_reward + owner_reward + operator_reward
634633
assert_equal(all_mn_rewards, bt['coinbasevalue'] * 3 // 4) # 75/25 mn/miner reward split
635634
assert_equal(platform_reward, all_mn_rewards * 375 // 1000) # 0.375 platform share
636-
assert_equal(platform_reward, 31916328)
635+
assert_equal(platform_reward, 37015386)
637636
assert_equal(locked, self.get_credit_pool_balance())
638637
node.generate(1)
639638
self.sync_all()

test/functional/feature_block.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ def set_test_params(self):
8585
# Very large reorgs cause cs_main to be held for a very long time in ActivateBestChainStep,
8686
# which causes RPC to hang, so we need to increase RPC timeouts
8787
self.rpc_timeout = 180
88-
# Must set '-dip3params=2000:2000' to create pre-dip3 blocks only
8988
self.extra_args = [[
90-
'-dip3params=2000:2000',
89+
'-dip3params=2000:2000', # Must set '-dip3params=2000:2000' to create pre-dip3 blocks only
9190
'-acceptnonstdtxn=1', # This is a consensus block test, we don't care about tx policy
9291
'-testactivationheight=bip34@2',
9392
'-testactivationheight=dip0001@2000',
93+
'-testactivationheight=v20@2000',
9494
]]
9595

9696
def setup_nodes(self):

test/functional/feature_blockfilterindex_prune.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def run_test(self):
4242
assert_greater_than(len(self.nodes[0].getblockfilter(self.nodes[0].getblockhash(2))['filter']), 0)
4343

4444
self.log.info("start node without blockfilterindex")
45-
self.restart_node(0, extra_args=["-fastprune", "-prune=1"], expected_stderr='Warning: You are starting with governance validation disabled. This is expected because you are running a pruned node.')
45+
self.restart_node(0, extra_args=["-fastprune", "-prune=1", '-testactivationheight=v20@2000'], expected_stderr='Warning: You are starting with governance validation disabled. This is expected because you are running a pruned node.')
4646

4747
self.log.info("make sure accessing the blockfilters throws an error")
4848
assert_raises_rpc_error(-1, "Index is not enabled for filtertype basic", self.nodes[0].getblockfilter, self.nodes[0].getblockhash(2))

test/functional/feature_dip3_v19.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ def getmnlistdiff(self, base_block_hash, block_hash):
4343

4444
class DIP3V19Test(DashTestFramework):
4545
def set_test_params(self):
46-
self.set_dash_test_params(6, 5, fast_dip3_enforcement=True, evo_count=2)
46+
extra_args = [[
47+
'-testactivationheight=v20@1200', # required otherwise mine_quorum("llmq_test [100]") fails
48+
]] * 6
49+
self.set_dash_test_params(6, 5, fast_dip3_enforcement=True, extra_args=extra_args, evo_count=2)
4750

4851
def run_test(self):
4952
# Connect all nodes to node1 so that we always have the whole network connected

test/functional/feature_llmq_chainlocks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def run_test(self):
3333

3434
self.test_coinbase_best_cl(self.nodes[0], expected_cl_in_cb=False)
3535

36-
self.activate_v20(expected_activation_height=1200)
36+
self.activate_v20(expected_activation_height=900)
3737
self.log.info("Activated v20 at height:" + str(self.nodes[0].getblockcount()))
3838

3939
# v20 is active for the next block, not for the tip

test/functional/feature_llmq_rotation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ def run_test(self):
113113
expectedNew = [h_100_0, h_106_0, h_104_0, h_100_1, h_106_1, h_104_1]
114114
quorumList = self.test_getmnlistdiff_quorums(b_h_0, b_h_1, {}, expectedDeleted, expectedNew, testQuorumsCLSigs=False)
115115

116-
projected_activation_height = 1200
116+
projected_activation_height = 900
117117

118-
self.activate_v20(expected_activation_height=1200)
118+
self.activate_v20(expected_activation_height=900)
119119
self.log.info("Activated v20 at height:" + str(self.nodes[0].getblockcount()))
120120

121121
softfork_info = self.nodes[0].getblockchaininfo()['softforks']['v20']

test/functional/rpc_blockchain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def _test_getblockchaininfo(self):
154154
'dip0024': { 'type': 'buried', 'active': False, 'height': 900},
155155
'realloc': { 'type': 'buried', 'active': True, 'height': 1},
156156
'v19': { 'type': 'buried', 'active': False, 'height': 900},
157-
'v20': { 'type': 'buried', 'active': False, 'height': 1200},
157+
'v20': { 'type': 'buried', 'active': False, 'height': 900},
158158
'mn_rr': {
159159
'type': 'bip9',
160160
'bip9': {

0 commit comments

Comments
 (0)