Skip to content

Commit 78bb23a

Browse files
committed
fix: enforce mn_rr to be activated after v20 so far as it has no meaning without CreditPool
1 parent fd32e57 commit 78bb23a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/chainparams.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ class CRegTestParams : public CChainParams {
796796
consensus.DIP0024QuorumsHeight = 1; // Always have dip0024 quorums unless overridden
797797
consensus.V19Height = 1; // Always active unless overriden
798798
consensus.V20Height = consensus.DIP0003Height; // Active not earlier than dip0003. Functional tests (DashTestFramework) uses height 100 (same as coinbase maturity)
799-
consensus.MN_RRHeight = 1;
799+
consensus.MN_RRHeight = consensus.V20Height; // MN_RR does not really have effect before v20 activation
800800
consensus.MinBIP9WarningHeight = 0;
801801
consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 1
802802
consensus.nPowTargetTimespan = 24 * 60 * 60; // Dash: 1 day
@@ -922,6 +922,7 @@ class CRegTestParams : public CChainParams {
922922
UpdateLLMQTestParametersFromArgs(args, Consensus::LLMQType::LLMQ_TEST_PLATFORM);
923923
UpdateLLMQInstantSendDIP0024FromArgs(args);
924924
assert(consensus.V20Height >= consensus.DIP0003Height);
925+
assert(consensus.MN_RRHeight >= consensus.V20Height);
925926
}
926927

927928
/**
@@ -1032,8 +1033,10 @@ static void MaybeUpdateHeights(const ArgsManager& args, Consensus::Params& conse
10321033
consensus.V19Height = int{height};
10331034
} else if (name == "v20") {
10341035
consensus.V20Height = int{height};
1036+
consensus.MN_RRHeight = std::max(consensus.MN_RRHeight, int{height});
10351037
} else if (name == "mn_rr") {
10361038
consensus.MN_RRHeight = int{height};
1039+
consensus.MN_RRHeight = std::max(consensus.V20Height, int{height});
10371040
} else {
10381041
throw std::runtime_error(strprintf("Invalid name (%s) for -testactivationheight=name@height.", arg));
10391042
}

test/functional/rpc_blockchain.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def _test_getblockchaininfo(self):
186186
'-testactivationheight=brr@14',
187187
'-testactivationheight=v19@15',
188188
'-testactivationheight=v20@412', # no earlier than DIP0003
189-
'-testactivationheight=mn_rr@16',
189+
'-testactivationheight=mn_rr@413',
190190
])
191191

192192
res = self.nodes[0].getblockchaininfo()
@@ -213,7 +213,7 @@ def _test_getblockchaininfo(self):
213213
'realloc': { 'type': 'buried', 'active': True, 'height': 14},
214214
'v19': { 'type': 'buried', 'active': True, 'height': 15},
215215
'v20': { 'type': 'buried', 'active': False, 'height': 412},
216-
'mn_rr': { 'type': 'buried', 'active': True, 'height': 16},
216+
'mn_rr': { 'type': 'buried', 'active': False, 'height': 413},
217217
'withdrawals': {
218218
'type': 'bip9',
219219
'bip9': {

0 commit comments

Comments
 (0)