mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Merge #6176: test: reduce BRRHeight in regtest
38ecd6f951
test: reduce BRRHeight on regtest (Odysseas Gabrielides)
Pull request description:
## Issue being fixed or feature implemented
In regtest, Block Reward Reallocation is buried at height 2500, which happens after v20 activation.
## What was done?
Reduced BRRHeight in regtest from 2500 to 1000.
The purpose of this change is to simplify regtests of Platform as well.
Note: This change affects only regtest.
## How Has This Been Tested?
tests
## Breaking Changes
no, this only affects Regtest (where we make no guarantees about breaking stuff)
## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [x] I have added or updated relevant unit/integration/functional/e2e tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_
Top commit has no ACKs.
Tree-SHA512: b5a1c2b2c2b70682f266d9d0af9e048a03417c0cb2480eb5ab5838965342b6465acd10d8dac5a0d3c5c5f59f4e36ac5b909a838bc3805c2265a83776e92b4827
This commit is contained in:
commit
5c3f1043fc
@ -805,7 +805,7 @@ public:
|
||||
consensus.DIP0003EnforcementHeight = 500;
|
||||
consensus.DIP0003EnforcementHash = uint256();
|
||||
consensus.DIP0008Height = 432;
|
||||
consensus.BRRHeight = 2500; // see block_reward_reallocation_tests
|
||||
consensus.BRRHeight = 1000; // see block_reward_reallocation_tests
|
||||
consensus.DIP0020Height = 300;
|
||||
consensus.DIP0024Height = 900;
|
||||
consensus.DIP0024QuorumsHeight = 900;
|
||||
|
@ -178,7 +178,7 @@ BOOST_FIXTURE_TEST_CASE(block_reward_reallocation, TestChainBRRBeforeActivationS
|
||||
// Creating blocks by different ways
|
||||
const auto pblocktemplate = BlockAssembler(m_node.chainman->ActiveChainstate(), m_node, *m_node.mempool, Params()).CreateNewBlock(coinbasePubKey);
|
||||
}
|
||||
for ([[maybe_unused]] auto _ : irange::range(1999)) {
|
||||
for ([[maybe_unused]] auto _ : irange::range(499)) {
|
||||
CreateAndProcessBlock({}, coinbaseKey);
|
||||
LOCK(cs_main);
|
||||
dmnman.UpdatedBlockTip(m_node.chainman->ActiveChain().Tip());
|
||||
@ -221,9 +221,9 @@ BOOST_FIXTURE_TEST_CASE(block_reward_reallocation, TestChainBRRBeforeActivationS
|
||||
const CAmount block_subsidy = GetBlockSubsidyInner(tip->nBits, tip->nHeight, consensus_params, isV20Active);
|
||||
const CAmount masternode_payment = GetMasternodePayment(tip->nHeight, block_subsidy, isV20Active);
|
||||
const auto pblocktemplate = BlockAssembler(m_node.chainman->ActiveChainstate(), m_node, *m_node.mempool, Params()).CreateNewBlock(coinbasePubKey);
|
||||
BOOST_CHECK_EQUAL(pblocktemplate->block.vtx[0]->GetValueOut(), 122209530);
|
||||
BOOST_CHECK_EQUAL(pblocktemplate->block.vtx[0]->GetValueOut(), 28847249686);
|
||||
BOOST_CHECK_EQUAL(pblocktemplate->voutMasternodePayments[0].nValue, masternode_payment);
|
||||
BOOST_CHECK_EQUAL(pblocktemplate->voutMasternodePayments[0].nValue, 61104762); // 0.4999999755
|
||||
BOOST_CHECK_EQUAL(pblocktemplate->voutMasternodePayments[0].nValue, 14423624841); // 0.4999999999
|
||||
}
|
||||
|
||||
// Reallocation should kick-in with the superblock mined at height = 2010,
|
||||
@ -252,15 +252,15 @@ BOOST_FIXTURE_TEST_CASE(block_reward_reallocation, TestChainBRRBeforeActivationS
|
||||
const CAmount block_subsidy = GetBlockSubsidyInner(tip->nBits, tip->nHeight, consensus_params, isV20Active);
|
||||
const CAmount block_subsidy_sb = GetSuperblockSubsidyInner(tip->nBits, tip->nHeight, consensus_params, isV20Active);
|
||||
CAmount block_subsidy_potential = block_subsidy + block_subsidy_sb;
|
||||
BOOST_CHECK_EQUAL(block_subsidy_potential, 84437941);
|
||||
BOOST_CHECK_EQUAL(block_subsidy_potential, 177167660);
|
||||
CAmount expected_block_reward = block_subsidy_potential - block_subsidy_potential / 5;
|
||||
|
||||
const CAmount masternode_payment = GetMasternodePayment(tip->nHeight, block_subsidy, isV20Active);
|
||||
const auto pblocktemplate = BlockAssembler(m_node.chainman->ActiveChainstate(), m_node, *m_node.mempool, Params()).CreateNewBlock(coinbasePubKey);
|
||||
BOOST_CHECK_EQUAL(pblocktemplate->block.vtx[0]->GetValueOut(), expected_block_reward);
|
||||
BOOST_CHECK_EQUAL(pblocktemplate->block.vtx[0]->GetValueOut(), 67550353);
|
||||
BOOST_CHECK_EQUAL(pblocktemplate->block.vtx[0]->GetValueOut(), 141734128);
|
||||
BOOST_CHECK_EQUAL(pblocktemplate->voutMasternodePayments[0].nValue, masternode_payment);
|
||||
BOOST_CHECK_EQUAL(pblocktemplate->voutMasternodePayments[0].nValue, 50662764); // 0.75
|
||||
BOOST_CHECK_EQUAL(pblocktemplate->voutMasternodePayments[0].nValue, 106300596); // 0.75
|
||||
}
|
||||
BOOST_CHECK(!DeploymentActiveAfter(m_node.chainman->ActiveChain().Tip(), consensus_params, Consensus::DEPLOYMENT_MN_RR));
|
||||
|
||||
@ -307,8 +307,8 @@ BOOST_FIXTURE_TEST_CASE(block_reward_reallocation, TestChainBRRBeforeActivationS
|
||||
const auto pblocktemplate = BlockAssembler(m_node.chainman->ActiveChainstate(), m_node, *m_node.mempool, Params()).CreateNewBlock(coinbasePubKey);
|
||||
|
||||
CAmount block_subsidy_potential = block_subsidy + block_subsidy_sb;
|
||||
BOOST_CHECK_EQUAL(tip->nHeight, 3858);
|
||||
BOOST_CHECK_EQUAL(block_subsidy_potential, 78406660);
|
||||
BOOST_CHECK_EQUAL(tip->nHeight, 2358);
|
||||
BOOST_CHECK_EQUAL(block_subsidy_potential, 164512828);
|
||||
// Treasury is 20% since MNRewardReallocation
|
||||
CAmount expected_block_reward = block_subsidy_potential - block_subsidy_potential / 5;
|
||||
// Since MNRewardReallocation, MN reward share is 75% of the block reward
|
||||
|
@ -152,7 +152,7 @@ class BlockchainTest(BitcoinTestFramework):
|
||||
'dip0008': { 'type': 'buried', 'active': False, 'height': 432},
|
||||
'dip0020': { 'type': 'buried', 'active': False, 'height': 300},
|
||||
'dip0024': { 'type': 'buried', 'active': False, 'height': 900},
|
||||
'realloc': { 'type': 'buried', 'active': False, 'height': 2500},
|
||||
'realloc': { 'type': 'buried', 'active': False, 'height': 1000},
|
||||
'v19': { 'type': 'buried', 'active': False, 'height': 900},
|
||||
'v20': {
|
||||
'type': 'bip9',
|
||||
|
Loading…
Reference in New Issue
Block a user