feat: bury dash deployments: dip0003, dip0020, dip0024, brr, bip147 (#5356)

## Issue being fixed or feature implemented
This changes are follow up for backport bitcoin/bitcoin#16060 

## What was done?
Buried all hardened dash deployments

## How Has This Been Tested?
Run unit/functional tests.
Run dash with option `-reindex` for both mainnet/testnet - both succeed.

## Breaking Changes
No breaking changes, it should be fully compatible.

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] 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
This commit is contained in:
Konstantin Akimov 2023-05-19 00:15:08 +07:00 committed by GitHub
parent f6f2d6ba3a
commit e3a97b0156
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 41 additions and 347 deletions

View File

@ -156,6 +156,7 @@ public:
consensus.BIP34Hash = uint256S("0x000001f35e70f7c5705f64c6c5cc3dea9449e74d5b5c7cf74dad1bcca14a8012");
consensus.BIP65Height = 619382; // 00000000000076d8fcea02ec0963de4abfd01e771fec0863f960c2c64fe6f357
consensus.BIP66Height = 245817; // 00000000000b1fa2dfa312863570e13fae9ca7b5566cb27e55422620b469aefa
consensus.BIP147Height = 939456; // 00000000000000117befca4fab5622514772f608852e5edd8df9c55464b6fe37
consensus.CSVHeight = 622944; // 00000000000002e3d3a6224cfce80bae367fd3283d1e5a8ba50e5e60b2d2905d
consensus.DIP0001Height = 782208; // 000000000000000cbc9cb551e8ee1ac7aa223585cbdfb755d3683bafd93679e4
consensus.DIP0003Height = 1028160;
@ -165,7 +166,7 @@ public:
consensus.BRRHeight = 1374912; // 000000000000000c5a124f3eccfbe6e17876dca79cec9e63dfa70d269113c926
consensus.DIP0020Height = 1516032; // 000000000000000f64ed3bd9af1078177ac026f6aa2677aa4d8beeae43be56cc
consensus.DIP0024Height = 1737792; // 0000000000000001342be9c0b75ad40c276beaad91616423c4d9cb101b3db438
consensus.MinBIP9WarningHeight = 1090656; // dip8 activation height + miner confirmation window
consensus.MinBIP9WarningHeight = 1737792 + 2016; // dip0024 activation height + miner confirmation window
consensus.powLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 20
consensus.nPowTargetTimespan = 24 * 60 * 60; // Dash: 1 day
consensus.nPowTargetSpacing = 2.5 * 60; // Dash: 2.5 minutes
@ -179,47 +180,6 @@ public:
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008
// Deployment of BIP147
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].bit = 2;
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nStartTime = 1524477600; // Apr 23th, 2018
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nTimeout = 1556013600; // Apr 23th, 2019
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nWindowSize = 4032;
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nThresholdStart = 3226; // 80% of 4032
// Deployment of DIP0003
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].bit = 3;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nStartTime = 1546300800; // Jan 1st, 2019
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nTimeout = 1577836800; // Jan 1st, 2020
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nWindowSize = 4032;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nThresholdStart = 3226; // 80% of 4032
// Deployment of Block Reward Reallocation
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].bit = 5;
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nStartTime = 1601510400; // Oct 1st, 2020
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nTimeout = 1633046400; // Oct 1st, 2021
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nWindowSize = 4032;
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nThresholdStart = 3226; // 80% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nThresholdMin = 2420; // 60% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nFalloffCoeff = 5; // this corresponds to 10 periods
// Deployment of DIP0020, DIP0021 and LLMQ_100_67 quorums
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].bit = 6;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nStartTime = 1625097600; // July 1st, 2021
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nTimeout = 1656633600; // July 1st, 2022
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nWindowSize = 4032;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nThresholdStart = 3226; // 80% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nThresholdMin = 2420; // 60% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nFalloffCoeff = 5; // this corresponds to 10 periods
// Deployment of Quorum Rotation DIP and decreased proposal fee (Values to be determined)
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].bit = 7;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nStartTime = 1660521600; // Tuesday, August 15, 2022 12:00:00 AM
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nTimeout = 1692057600; // Tuesday, August 15, 2023 12:00:00 AM
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nWindowSize = 4032;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nThresholdStart = 3226; // 80% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nThresholdMin = 2420; // 60% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nFalloffCoeff = 5; // this corresponds to 10 periods
// Deployment of Deployment of Basic BLS, AssetLocks, EHF
consensus.vDeployments[Consensus::DEPLOYMENT_V19].bit = 8;
consensus.vDeployments[Consensus::DEPLOYMENT_V19].nStartTime = 1682380800; // Tuesday, April 25, 2023 0:00:00
@ -388,6 +348,7 @@ public:
consensus.BIP34Hash = uint256S("0x000008ebb1db2598e897d17275285767717c6acfeac4c73def49fbea1ddcbcb6");
consensus.BIP65Height = 2431; // 0000039cf01242c7f921dcb4806a5994bc003b48c1973ae0c89b67809c2bb2ab
consensus.BIP66Height = 2075; // 0000002acdd29a14583540cb72e1c5cc83783560e38fa7081495d474fe1671f7
consensus.BIP147Height = 4300; // 0000000040c1480d413c9203664253ab18da284130c329bf88fcfc84312bcbe0
consensus.CSVHeight = 8064; // 00000005eb94d027e34649373669191188858a22c70f4a6d29105e559124cec7
consensus.DIP0001Height = 5500; // 00000001d60a01d8f1f39011cc6b26e3a1c97a24238cab856c2da71a4dd801a9
consensus.DIP0003Height = 7000;
@ -397,7 +358,7 @@ public:
consensus.BRRHeight = 387500; // 0000001537dbfd09dea69f61c1f8b2afa27c8dc91c934e144797761c9f10367b
consensus.DIP0020Height = 414100; // 000000cf961868662fbfbb5d1af6f1caa1809f6a4e390efe5f8cd3031adea668
consensus.DIP0024Height = 769700; // 0000008d84e4efd890ae95c70a7a6126a70a80e5c19e4cb264a5b3469aeef172
consensus.MinBIP9WarningHeight = 80816; // dip8 activation height + miner confirmation window
consensus.MinBIP9WarningHeight = 769700 + 2016; // dip0024 activation height + miner confirmation window
consensus.powLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 20
consensus.nPowTargetTimespan = 24 * 60 * 60; // Dash: 1 day
consensus.nPowTargetSpacing = 2.5 * 60; // Dash: 2.5 minutes
@ -411,47 +372,6 @@ public:
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008
// Deployment of BIP147
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].bit = 2;
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nStartTime = 1544655600; // Dec 13th, 2018
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nThresholdStart = 50; // 50% of 100
// Deployment of DIP0003
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].bit = 3;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nStartTime = 1544655600; // Dec 13th, 2018
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nThresholdStart = 50; // 50% of 100
// Deployment of Block Reward Reallocation
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].bit = 5;
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nStartTime = 1598918400; // Sep 1st, 2020
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nThresholdStart = 80; // 80% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nThresholdMin = 60; // 60% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nFalloffCoeff = 5; // this corresponds to 10 periods
// Deployment of DIP0020, DIP0021 and LLMQ_100_67 quorums
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].bit = 6;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nStartTime = 1606780800; // December 1st, 2020
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nTimeout = 1638316800; // December 1st, 2021
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nThresholdStart = 80; // 80% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nThresholdMin = 60; // 60% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nFalloffCoeff = 5; // this corresponds to 10 periods
// Deployment of Quorum Rotation DIP and decreased proposal fee
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].bit = 7;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nStartTime = 1649980800; // Friday, April 15, 2022 0:00:00
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nThresholdStart = 80; // 80% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nThresholdMin = 60; // 60% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nFalloffCoeff = 5; // this corresponds to 10 periods
// Deployment of Deployment of Basic BLS, AssetLocks, EHF
consensus.vDeployments[Consensus::DEPLOYMENT_V19].bit = 8;
consensus.vDeployments[Consensus::DEPLOYMENT_V19].nStartTime = 1678838400; // Wed, March 15, 2023 0:00:00
@ -593,6 +513,7 @@ public:
consensus.BIP34Height = 1; // BIP34 activated immediately on devnet
consensus.BIP65Height = 1; // BIP65 activated immediately on devnet
consensus.BIP66Height = 1; // BIP66 activated immediately on devnet
consensus.BIP147Height = 1; // BIP147 activated immediately on devnet
consensus.CSVHeight = 1; // BIP68 activated immediately on devnet
consensus.DIP0001Height = 2; // DIP0001 activated immediately on devnet
consensus.DIP0003Height = 2; // DIP0003 activated immediately on devnet
@ -602,7 +523,7 @@ public:
consensus.BRRHeight = 300;
consensus.DIP0020Height = 300;
consensus.DIP0024Height = 300;
consensus.MinBIP9WarningHeight = 2018; // dip8 activation height + miner confirmation window
consensus.MinBIP9WarningHeight = 300 + 2016; // dip0024 activation height + miner confirmation window
consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 1
consensus.nPowTargetTimespan = 24 * 60 * 60; // Dash: 1 day
consensus.nPowTargetSpacing = 2.5 * 60; // Dash: 2.5 minutes
@ -616,46 +537,6 @@ public:
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008
// Deployment of BIP147
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].bit = 2;
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nStartTime = 1517792400; // Feb 5th, 2018
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nThresholdStart = 50; // 50% of 100
// Deployment of DIP0003
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].bit = 3;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nStartTime = 1535752800; // Sep 1st, 2018
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nThresholdStart = 50; // 50% of 100
// Deployment of Block Reward Reallocation
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].bit = 5;
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nStartTime = 1598918400; // Sep 1st, 2020
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nThresholdStart = 80; // 80% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nThresholdMin = 60; // 60% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nFalloffCoeff = 5; // this corresponds to 10 periods
// Deployment of DIP0020, DIP0021 and LLMQ_100_67 quorums
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].bit = 6;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nStartTime = 1604188800; // November 1st, 2020
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nThresholdStart = 80; // 80% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nThresholdMin = 60; // 60% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nFalloffCoeff = 5; // this corresponds to 10 periods
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].bit = 7;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nStartTime = 1625097600; // July 1st, 2021
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nThresholdStart = 80; // 80% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nThresholdMin = 60; // 60% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nFalloffCoeff = 5; // this corresponds to 10 periods
// Deployment of Deployment of Basic BLS, AssetLocks, EHF
consensus.vDeployments[Consensus::DEPLOYMENT_V19].bit = 8;
consensus.vDeployments[Consensus::DEPLOYMENT_V19].nStartTime = 1661990400; // Sep 1st, 2022
@ -869,6 +750,7 @@ public:
consensus.BIP34Hash = uint256();
consensus.BIP65Height = 1351; // BIP65 activated on regtest (Used in functional tests)
consensus.BIP66Height = 1251; // BIP66 activated on regtest (Used in functional tests)
consensus.BIP147Height = 432; // BIP147 activated on regtest (Used in functional tests)
consensus.CSVHeight = 432; // CSV activated on regtest (Used in rpc activation tests)
consensus.DIP0001Height = 2000;
consensus.DIP0003Height = 432;
@ -891,35 +773,6 @@ public:
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].bit = 2;
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nStartTime = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].bit = 3;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nStartTime = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].bit = 5;
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nStartTime = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nWindowSize = 500;
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nThresholdStart = 400; // 80%
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nThresholdMin = 300; // 60%
consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nFalloffCoeff = 5;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].bit = 6;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nStartTime = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nThresholdStart = 80;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nThresholdMin = 60;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nFalloffCoeff = 5;
// Deployment of Quorum Rotation DIP and decreased proposal fee
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].bit = 7;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nStartTime = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nWindowSize = 300;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nThresholdStart = 240; // 80% of 300
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nThresholdMin = 180; // 60% of 300
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nFalloffCoeff = 5; // this corresponds to 10 periods
// Deployment of Deployment of Basic BLS, AssetLocks, EHF
consensus.vDeployments[Consensus::DEPLOYMENT_V19].bit = 8;

View File

@ -15,11 +15,6 @@ namespace Consensus {
enum DeploymentPos {
DEPLOYMENT_TESTDUMMY,
DEPLOYMENT_BIP147, // Deployment of BIP147 (NULLDUMMY)
DEPLOYMENT_DIP0003, // Deployment of DIP0002 and DIP0003 (txv3 and deterministic MN lists)
DEPLOYMENT_REALLOC, // Deployment of Block Reward Reallocation
DEPLOYMENT_DIP0020, // Deployment of DIP0020, DIP0021 and LMQ_100_67 quorums
DEPLOYMENT_DIP0024, // Deployment of DIP0024 (Quorum Rotation) and decreased governance proposal fee
DEPLOYMENT_V19, // Deployment of Basic BLS, AssetLocks
DEPLOYMENT_V20, // Deployment of EHF, LLMQ Randomness Beacon
// NOTE: Also add new deployments to VersionBitsDeploymentInfo in versionbits.cpp
@ -75,22 +70,24 @@ struct Params {
int BIP65Height;
/** Block height at which BIP66 becomes active */
int BIP66Height;
// Deployment of BIP147 (NULLDUMMY)
int BIP147Height;
/** Block height at which CSV (BIP68, BIP112 and BIP113) becomes active */
int CSVHeight;
/** Block height at which DIP0001 becomes active */
int DIP0001Height;
/** Block height at which DIP0003 becomes active */
/** Block height at which DIP0002 and DIP0003 (txv3 and deterministic MN lists) becomes active */
int DIP0003Height;
/** Block height at which DIP0003 becomes enforced */
int DIP0003EnforcementHeight;
uint256 DIP0003EnforcementHash;
/** Block height at which DIP0008 becomes active */
int DIP0008Height;
/** Block height at which BRR becomes active */
/** Block height at which BRR (Block Reward Reallocation) becomes active */
int BRRHeight;
/** Block height at which DIP20 becomes active */
/** Block height at which DIP0020, DIP0021 and LLMQ_100_67 quorums become active */
int DIP0020Height;
/** Block height at which DIP24 becomes active */
/** Block height at which DIP0024 (Quorum Rotation) and decreased governance proposal fee becomes active */
int DIP0024Height;
/** Don't warn about unknown BIP 9 activations below this height.
* This prevents us from warning about the CSV and DIP activations. */

View File

@ -1577,13 +1577,18 @@ UniValue getblockchaininfo(const JSONRPCRequest& request)
BuriedForkDescPushBack(softforks,"bip34", consensusParams.BIP34Height);
BuriedForkDescPushBack(softforks,"bip66", consensusParams.BIP66Height);
BuriedForkDescPushBack(softforks,"bip65", consensusParams.BIP65Height);
BuriedForkDescPushBack(softforks,"bip147", consensusParams.BIP147Height);
BuriedForkDescPushBack(softforks, "csv", consensusParams.CSVHeight);
BuriedForkDescPushBack(softforks, "dip0001", consensusParams.DIP0001Height);
BuriedForkDescPushBack(softforks, "dip0003", consensusParams.DIP0003Height);
BuriedForkDescPushBack(softforks, "dip0008", consensusParams.DIP0008Height);
for (int pos = Consensus::DEPLOYMENT_TESTDUMMY + 1; pos != Consensus::MAX_VERSION_BITS_DEPLOYMENTS; ++pos) {
BIP9SoftForkDescPushBack(softforks, VersionBitsDeploymentInfo[pos].name, consensusParams, static_cast<Consensus::DeploymentPos>(pos));
}
BuriedForkDescPushBack(softforks, "dip0020", consensusParams.DIP0020Height);
BuriedForkDescPushBack(softforks, "dip0024", consensusParams.DIP0024Height);
BuriedForkDescPushBack(softforks, "realloc", consensusParams.BRRHeight);
BIP9SoftForkDescPushBack(softforks, "v19", consensusParams, Consensus::DEPLOYMENT_V19);
BIP9SoftForkDescPushBack(softforks, "v20", consensusParams, Consensus::DEPLOYMENT_V20);
BIP9SoftForkDescPushBack(softforks, "testdummy", consensusParams, Consensus::DEPLOYMENT_TESTDUMMY);
obj.pushKV("softforks", softforks);
obj.pushKV("warnings", GetWarnings(false));

View File

@ -35,9 +35,6 @@
using SimpleUTXOMap = std::map<COutPoint, std::pair<int, CAmount>>;
const auto deployment_id = Consensus::DEPLOYMENT_REALLOC;
const int window{500}, th_start{400}, th_end{300};
struct TestChainBRRBeforeActivationSetup : public TestChainSetup
{
// Force fast DIP3 activation
@ -142,16 +139,6 @@ static CScript GenerateRandomAddress()
return GetScriptForDestination(PKHash(key.GetPubKey()));
}
static constexpr int threshold(int attempt)
{
// An implementation of VersionBitsConditionChecker::Threshold()
int threshold_calc = th_start - attempt * attempt * window / 100 / 5;
if (threshold_calc < th_end) {
return th_end;
}
return threshold_calc;
}
BOOST_AUTO_TEST_SUITE(block_reward_reallocation_tests)
BOOST_FIXTURE_TEST_CASE(block_reward_reallocation, TestChainBRRBeforeActivationSetup)
@ -159,30 +146,6 @@ BOOST_FIXTURE_TEST_CASE(block_reward_reallocation, TestChainBRRBeforeActivationS
const auto& consensus_params = Params().GetConsensus();
CScript coinbasePubKey = CScript() << ToByteVector(coinbaseKey.GetPubKey()) << OP_CHECKSIG;
auto signal = [&](int num_blocks, bool expected_lockin)
{
// Mine non-signalling blocks
gArgs.ForceSetArg("-blockversion", "536870912");
for ([[maybe_unused]] auto _ : irange::range(window - num_blocks)) {
CreateAndProcessBlock({}, coinbaseKey);
LOCK(cs_main);
deterministicMNManager->UpdatedBlockTip(::ChainActive().Tip());
}
gArgs.ForceRemoveArg("blockversion");
// Mine signalling blocks
for ([[maybe_unused]] auto _ : irange::range(num_blocks)) {
CreateAndProcessBlock({}, coinbaseKey);
LOCK(cs_main);
deterministicMNManager->UpdatedBlockTip(::ChainActive().Tip());
}
LOCK(cs_main);
if (expected_lockin) {
BOOST_CHECK_EQUAL(VersionBitsState(::ChainActive().Tip(), consensus_params, deployment_id, versionbitscache), ThresholdState::LOCKED_IN);
} else {
BOOST_CHECK_EQUAL(VersionBitsState(::ChainActive().Tip(), consensus_params, deployment_id, versionbitscache), ThresholdState::STARTED);
}
};
BOOST_ASSERT(deterministicMNManager->IsDIP3Enforced(WITH_LOCK(cs_main, return ::ChainActive().Height())));
// Register one MN
@ -200,77 +163,35 @@ BOOST_FIXTURE_TEST_CASE(block_reward_reallocation, TestChainBRRBeforeActivationS
BOOST_ASSERT(deterministicMNManager->GetListAtChainTip().HasMN(tx.GetHash()));
BOOST_CHECK_EQUAL(::ChainActive().Height(), 498);
BOOST_CHECK_EQUAL(VersionBitsState(::ChainActive().Tip(), consensus_params, deployment_id, versionbitscache), ThresholdState::DEFINED);
BOOST_CHECK(::ChainActive().Height() < Params().GetConsensus().BRRHeight);
}
CreateAndProcessBlock({}, coinbaseKey);
{
LOCK(cs_main);
// Advance from DEFINED to STARTED at height = 499
BOOST_CHECK_EQUAL(::ChainActive().Height(), 499);
deterministicMNManager->UpdatedBlockTip(::ChainActive().Tip());
BOOST_ASSERT(deterministicMNManager->GetListAtChainTip().HasMN(tx.GetHash()));
BOOST_CHECK_EQUAL(VersionBitsState(::ChainActive().Tip(), consensus_params, deployment_id, versionbitscache), ThresholdState::STARTED);
BOOST_CHECK_EQUAL(VersionBitsStatistics(::ChainActive().Tip(), consensus_params, deployment_id, versionbitscache).threshold, threshold(0));
// Next block should be signaling by default
BOOST_CHECK(::ChainActive().Height() < Params().GetConsensus().BRRHeight);
// Creating blocks by different ways
const auto pblocktemplate = BlockAssembler(*sporkManager, *governance, *m_node.llmq_ctx->quorum_block_processor, *m_node.llmq_ctx->clhandler, *m_node.llmq_ctx->isman, *m_node.evodb, *m_node.mempool, Params()).CreateNewBlock(::ChainstateActive(), coinbasePubKey);
const uint32_t bitmask = ((uint32_t)1) << consensus_params.vDeployments[deployment_id].bit;
BOOST_CHECK_EQUAL(::ChainActive().Tip()->nVersion & bitmask, 0);
BOOST_CHECK_EQUAL(pblocktemplate->block.nVersion & bitmask, bitmask);
}
signal(threshold(0) - 1, false); // 1 block short
{
// Still STARTED but new threshold should be lower at height = 999
LOCK(cs_main);
BOOST_CHECK_EQUAL(::ChainActive().Height(), 999);
deterministicMNManager->UpdatedBlockTip(::ChainActive().Tip());
BOOST_ASSERT(deterministicMNManager->GetListAtChainTip().HasMN(tx.GetHash()));
BOOST_CHECK_EQUAL(VersionBitsState(::ChainActive().Tip(), consensus_params, deployment_id, versionbitscache), ThresholdState::STARTED);
BOOST_CHECK_EQUAL(VersionBitsStatistics(::ChainActive().Tip(), consensus_params, deployment_id, versionbitscache).threshold, threshold(1));
}
signal(threshold(1) - 1, false); // 1 block short again
{
// Still STARTED but new threshold should be even lower at height = 1499
LOCK(cs_main);
BOOST_CHECK_EQUAL(::ChainActive().Height(), 1499);
deterministicMNManager->UpdatedBlockTip(::ChainActive().Tip());
BOOST_ASSERT(deterministicMNManager->GetListAtChainTip().HasMN(tx.GetHash()));
BOOST_CHECK_EQUAL(VersionBitsState(::ChainActive().Tip(), consensus_params, deployment_id, versionbitscache), ThresholdState::STARTED);
BOOST_CHECK_EQUAL(VersionBitsStatistics(::ChainActive().Tip(), consensus_params, deployment_id, versionbitscache).threshold, threshold(2));
}
signal(threshold(2), true); // just enough to lock in
{
// Advanced to LOCKED_IN at height = 1999
LOCK(cs_main);
BOOST_CHECK_EQUAL(::ChainActive().Height(), 1999);
deterministicMNManager->UpdatedBlockTip(::ChainActive().Tip());
BOOST_ASSERT(deterministicMNManager->GetListAtChainTip().HasMN(tx.GetHash()));
BOOST_CHECK_EQUAL(VersionBitsState(::ChainActive().Tip(), consensus_params, deployment_id, versionbitscache), ThresholdState::LOCKED_IN);
}
for ([[maybe_unused]] auto _ : irange::range(499)) {
// Still LOCKED_IN at height = 2498
for ([[maybe_unused]] auto _ : irange::range(1999)) {
CreateAndProcessBlock({}, coinbaseKey);
LOCK(cs_main);
BOOST_CHECK_EQUAL(VersionBitsState(::ChainActive().Tip(), consensus_params, deployment_id, versionbitscache), ThresholdState::LOCKED_IN);
deterministicMNManager->UpdatedBlockTip(::ChainActive().Tip());
}
BOOST_CHECK(::ChainActive().Height() < Params().GetConsensus().BRRHeight);
CreateAndProcessBlock({}, coinbaseKey);
{
// Advance from LOCKED_IN to ACTIVE at height = 2499
// Advance to ACTIVE at height = 2499
LOCK(cs_main);
BOOST_CHECK_EQUAL(::ChainActive().Height(), 2499);
deterministicMNManager->UpdatedBlockTip(::ChainActive().Tip());
BOOST_ASSERT(deterministicMNManager->GetListAtChainTip().HasMN(tx.GetHash()));
BOOST_CHECK_EQUAL(VersionBitsState(::ChainActive().Tip(), consensus_params, deployment_id, versionbitscache), ThresholdState::ACTIVE);
BOOST_CHECK_EQUAL(VersionBitsStateSinceHeight(::ChainActive().Tip(), consensus_params, deployment_id, versionbitscache), 2500);
BOOST_CHECK(::ChainActive().Height() + 1 == Params().GetConsensus().BRRHeight);
}
{

View File

@ -2046,7 +2046,7 @@ static unsigned int GetBlockScriptFlags(const CBlockIndex* pindex, const Consens
}
// Start enforcing BIP147 (NULLDUMMY) rule using versionbits logic.
if (VersionBitsState(pindex->pprev, consensusparams, Consensus::DEPLOYMENT_BIP147, versionbitscache) == ThresholdState::ACTIVE) {
if (pindex->nHeight >= consensusparams.BIP147Height) {
flags |= SCRIPT_VERIFY_NULLDUMMY;
}

View File

@ -12,31 +12,6 @@ const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_B
/*.gbt_force =*/ true,
/*.check_mn_protocol =*/ false,
},
{
/*.name =*/ "bip147",
/*.gbt_force =*/ true,
/*.check_mn_protocol =*/ false,
},
{
/*.name =*/ "dip0003",
/*.gbt_force =*/ true,
/*.check_mn_protocol =*/ false,
},
{
/*.name =*/ "realloc",
/*.gbt_force =*/ true,
/*.check_mn_protocol =*/ false,
},
{
/*.name =*/ "dip0020",
/*.gbt_force =*/ true,
/*.check_mn_protocol =*/ false,
},
{
/*.name =*/"dip0024",
/*.gbt_force =*/true,
/*.check_mn_protocol =*/false,
},
{
/*.name =*/"v19",
/*.gbt_force =*/true,
@ -46,5 +21,5 @@ const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_B
/*.name =*/"v20",
/*.gbt_force =*/true,
/*.check_mn_protocol =*/false,
}
},
};

View File

@ -5,7 +5,7 @@
from test_framework.messages import COIN, COutPoint, CTransaction, CTxIn, CTxOut, ToHex
from test_framework.script import CScript, OP_CAT, OP_DROP, OP_TRUE
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_raises_rpc_error, get_bip9_details, softfork_active, satoshi_round
from test_framework.util import assert_raises_rpc_error, softfork_active, satoshi_round
'''
feature_dip0020_activation.py
@ -55,7 +55,7 @@ class DIP0020ActivationTest(BitcoinTestFramework):
tx0_hex = ToHex(tx0)
# This tx isn't valid yet
assert_equal(get_bip9_details(self.nodes[0], 'dip0020')['status'], 'locked_in')
assert not softfork_active(self.nodes[0], 'dip0020')
assert_raises_rpc_error(-26, DISABLED_OPCODE_ERROR, self.node.sendrawtransaction, tx0_hex)
# Generate enough blocks to activate DIP0020 opcodes

View File

@ -41,8 +41,7 @@ class TestP2PConn(P2PInterface):
class LLMQCoinbaseCommitmentsTest(DashTestFramework):
def set_test_params(self):
extra_args = [["-vbparams=dip0024:999999999999:999999999999"]] * 4 # disable dip0024
self.set_dash_test_params(4, 3, extra_args=extra_args, fast_dip3_enforcement=True)
self.set_dash_test_params(4, 3, fast_dip3_enforcement=True)
def run_test(self):
self.test_node = self.nodes[0].add_p2p_connection(TestP2PConn())

View File

@ -150,70 +150,14 @@ class BlockchainTest(BitcoinTestFramework):
'bip34': {'type': 'buried', 'active': False, 'height': 500},
'bip66': {'type': 'buried', 'active': False, 'height': 1251},
'bip65': {'type': 'buried', 'active': False, 'height': 1351},
'bip147': { 'type': 'buried', 'active': False, 'height': 432},
'csv': {'type': 'buried', 'active': False, 'height': 432},
'dip0001': { 'type': 'buried', 'active': False, 'height': 2000},
'dip0003': { 'type': 'buried', 'active': False, 'height': 432},
'dip0008': { 'type': 'buried', 'active': False, 'height': 432},
'bip147': {
'type': 'bip9',
'bip9': {
'status': 'started',
'bit': 2,
'start_time': 0,
'timeout': 999999999999,
'since': 144,
'statistics': {
'period': 144,
'threshold': 108,
'elapsed': 57,
'count': 57,
'possible': True
},
},
'active': False},
'dip0003': {
'type': 'bip9',
'bip9': {
'status': 'started',
'bit': 3,
'start_time': 0,
'timeout': 999999999999,
'since': 144,
'statistics': {
'period': 144,
'threshold': 108,
'elapsed': 57,
'count': 57,
'possible': True
},
},
'active': False},
'realloc': {
'type': 'bip9',
'bip9': {
'status': 'defined',
'start_time': 0,
'timeout': 999999999999,
'since': 0
},
'active': False},
'dip0020': {
'type': 'bip9',
'bip9': {
'status': 'locked_in',
'start_time': 0,
'timeout': 999999999999,
'since': 200
},
'active': False},
'dip0024': {
'type': 'bip9',
'bip9': {
'status': 'defined',
'start_time': 0,
'timeout': 999999999999,
'since': 0
},
'active': False},
'dip0020': { 'type': 'buried', 'active': False, 'height': 300},
'dip0024': { 'type': 'buried', 'active': False, 'height': 900},
'realloc': { 'type': 'buried', 'active': False, 'height': 2500},
'v19': {
'type': 'bip9',
'bip9': {

View File

@ -35,13 +35,13 @@ class DumptxoutsetTest(BitcoinTestFramework):
# Blockhash should be deterministic based on mocked time.
assert_equal(
out['base_hash'],
'65a627bab5f50aea8e69acbf9fcbe6e5162bd556ce1c46f0ec4452afaedbb702')
'0266fa3cd96867c40f2f3056da3b66daf8fb4c83ec4f3f5344fd3fe9755794b5')
with open(str(expected_path), 'rb') as f:
digest = hashlib.sha256(f.read()).hexdigest()
# UTXO snapshot hash should be deterministic based on mocked time.
assert_equal(
digest, '1d34e230e9d7d5691aaa03684492798ca8f92a9254c6cf80528241bf35939869')
digest, '83ec62f0b9d9f2cdfe4514e8996d5ba0a6aa4cf74517988670d912db83bc0318')
# Specifying a path to an existing file will fail.
assert_raises_rpc_error(