diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 782a20324920a9..7c04fbcd60a91d 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -805,7 +805,7 @@ class CRegTestParams : public CChainParams { consensus.DIP0003EnforcementHeight = 500; consensus.DIP0003EnforcementHash = uint256(); consensus.DIP0008Height = 1; // Always active unless overridden - consensus.BRRHeight = 1000; // see block_reward_reallocation_tests + consensus.BRRHeight = 1; // Always active unless overridden consensus.DIP0020Height = 1; consensus.DIP0024Height = 900; consensus.DIP0024QuorumsHeight = 900; @@ -1054,6 +1054,8 @@ static void MaybeUpdateHeights(const ArgsManager& args, Consensus::Params& conse consensus.BIP65Height = int{height}; } else if (name == "csv") { consensus.CSVHeight = int{height}; + } else if (name == "brr") { + consensus.BRRHeight = int{height}; } else if (name == "dip0008") { consensus.DIP0008Height = int{height}; } else if (name == "dip0020") { diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index 0a68563266a207..c71cadb2279150 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -21,7 +21,7 @@ void SetupChainParamsBaseOptions(ArgsManager& argsman) argsman.AddArg("-devnet=", "Use devnet chain with provided name", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); argsman.AddArg("-dip3params=:", "Override DIP3 activation and enforcement heights (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS); argsman.AddArg("-dip8params=", "Override DIP8 activation height (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS); - argsman.AddArg("-testactivationheight=name@height.", "Set the activation height of 'name' (bip147, bip34, dersig, cltv, csv, dip0008, dip0020). (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); + argsman.AddArg("-testactivationheight=name@height.", "Set the activation height of 'name' (bip147, bip34, dersig, cltv, csv, brr, dip0008, dip0020). (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); argsman.AddArg("-highsubsidyblocks=", "The number of blocks with a higher than normal subsidy to mine at the start of a chain. Block after that height will have fixed subsidy base. (default: 0, devnet-only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); argsman.AddArg("-highsubsidyfactor=", "The factor to multiply the normal block subsidy by while in the highsubsidyblocks window of a chain (default: 1, devnet-only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); argsman.AddArg("-llmqchainlocks=", "Override the default LLMQ type used for ChainLocks. Allows using ChainLocks with smaller LLMQs. (default: llmq_devnet, devnet-only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); diff --git a/src/test/block_reward_reallocation_tests.cpp b/src/test/block_reward_reallocation_tests.cpp index c4affec2eec344..db5bf503609256 100644 --- a/src/test/block_reward_reallocation_tests.cpp +++ b/src/test/block_reward_reallocation_tests.cpp @@ -35,7 +35,7 @@ using SimpleUTXOMap = std::map>; struct TestChainBRRBeforeActivationSetup : public TestChainSetup { // Force fast DIP3 activation - TestChainBRRBeforeActivationSetup() : TestChainSetup(497, {"-dip3params=30:50", "-vbparams=mn_rr:0:999999999999:0:20:16:12:5:1"}) {} + TestChainBRRBeforeActivationSetup() : TestChainSetup(497, {"-dip3params=30:50", "-testactivationheight=brr@1000", "-vbparams=mn_rr:0:999999999999:0:20:16:12:5:1"}) {} }; static SimpleUTXOMap BuildSimpleUtxoMap(const std::vector& txs) diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py index c72314a9893c2b..a77f9d0033945d 100755 --- a/test/functional/rpc_blockchain.py +++ b/test/functional/rpc_blockchain.py @@ -152,7 +152,7 @@ def _test_getblockchaininfo(self): 'dip0008': { 'type': 'buried', 'active': True, 'height': 1}, 'dip0020': { 'type': 'buried', 'active': True, 'height': 1}, 'dip0024': { 'type': 'buried', 'active': False, 'height': 900}, - 'realloc': { 'type': 'buried', 'active': False, 'height': 1000}, + 'realloc': { 'type': 'buried', 'active': True, 'height': 1}, 'v19': { 'type': 'buried', 'active': False, 'height': 900}, 'v20': { 'type': 'bip9', diff --git a/test/functional/test_framework/blocktools.py b/test/functional/test_framework/blocktools.py index 388fd5b5b90bbc..3142217d1bc9ce 100644 --- a/test/functional/test_framework/blocktools.py +++ b/test/functional/test_framework/blocktools.py @@ -255,12 +255,13 @@ def filter_tip_keys(chaintips): return filtered_tips # Identical to GetMasternodePayment in C++ code +# TODO: remove it or make **proper** tests for various height def get_masternode_payment(nHeight, blockValue, fV20Active): ret = int(blockValue / 5) nMNPIBlock = 350 nMNPIPeriod = 10 - nReallocActivationHeight = 2500 + nReallocActivationHeight = 1 if nHeight > nMNPIBlock: ret += int(blockValue / 20) @@ -285,7 +286,7 @@ def get_masternode_payment(nHeight, blockValue, fV20Active): # Block Reward Realocation is not activated yet, nothing to do return ret - nSuperblockCycle = 10 + nSuperblockCycle = 20 # Actual realocation starts in the cycle next to one activation happens in nReallocStart = nReallocActivationHeight - nReallocActivationHeight % nSuperblockCycle + nSuperblockCycle