Skip to content

Commit

Permalink
Add forks for DF23 and DF24 (#2690)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bushstar authored Nov 9, 2023
1 parent 3af5615 commit 6a8d27b
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ class CMainParams : public CChainParams {
consensus.DF20GrandCentralHeight = 2479000; // Dec 8th, 2022.
consensus.DF21GrandCentralEpilogueHeight = 2574000; // Jan 10th, 2023.
consensus.DF22MetachainHeight = 3462000; // Nov 15th, 2023.
consensus.DF23UpgradeHeight = std::numeric_limits<int>::max();
consensus.DF24UpgradeHeight = std::numeric_limits<int>::max();

consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
// consensus.pos.nTargetTimespan = 14 * 24 * 60 * 60; // two weeks
Expand Down Expand Up @@ -418,6 +420,8 @@ class CTestNetParams : public CChainParams {
consensus.DF20GrandCentralHeight = 1150020;
consensus.DF21GrandCentralEpilogueHeight = 1150030;
consensus.DF22MetachainHeight = 1150040;
consensus.DF23UpgradeHeight = std::numeric_limits<int>::max();
consensus.DF24UpgradeHeight = std::numeric_limits<int>::max();

consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
// consensus.pos.nTargetTimespan = 14 * 24 * 60 * 60; // two weeks
Expand Down Expand Up @@ -636,6 +640,8 @@ class CChangiParams : public CChainParams {
consensus.DF20GrandCentralHeight = 1366000;
consensus.DF21GrandCentralEpilogueHeight = 1438200;
consensus.DF22MetachainHeight = 1586750;
consensus.DF23UpgradeHeight = std::numeric_limits<int>::max();
consensus.DF24UpgradeHeight = std::numeric_limits<int>::max();

consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.pos.nTargetTimespan = 5 * 60; // 5 min == 10 blocks
Expand Down Expand Up @@ -851,6 +857,8 @@ class CDevNetParams : public CChainParams {
consensus.DF20GrandCentralHeight = 1366000;
consensus.DF21GrandCentralEpilogueHeight = 1438200;
consensus.DF22MetachainHeight = 1586750;
consensus.DF23UpgradeHeight = std::numeric_limits<int>::max();
consensus.DF24UpgradeHeight = std::numeric_limits<int>::max();

consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.pos.nTargetTimespan = 5 * 60; // 5 min == 10 blocks
Expand Down Expand Up @@ -1070,6 +1078,8 @@ class CRegTestParams : public CChainParams {
consensus.DF20GrandCentralHeight = 10000000;
consensus.DF21GrandCentralEpilogueHeight = 10000000;
consensus.DF22MetachainHeight = 10000000;
consensus.DF23UpgradeHeight = 10000000;
consensus.DF24UpgradeHeight = 10000000;

consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.pos.nTargetTimespan = 14 * 24 * 60 * 60; // two weeks
Expand Down Expand Up @@ -1337,6 +1347,8 @@ void SetupCommonArgActivationParams(Consensus::Params &consensus) {
UpdateHeightValidation("Grand Central", "-grandcentralheight", consensus.DF20GrandCentralHeight);
UpdateHeightValidation("Grand Central Epilogue", "-grandcentralepilogueheight", consensus.DF21GrandCentralEpilogueHeight);
UpdateHeightValidation("Metachain", "-metachainheight", consensus.DF22MetachainHeight);
UpdateHeightValidation("DF23 Upgrade Height", "-df23upgradeheight", consensus.DF23UpgradeHeight);
UpdateHeightValidation("DF24 Upgrade Height", "-df24upgradeheight", consensus.DF24UpgradeHeight);

if (gArgs.GetBoolArg("-simulatemainnet", false)) {
consensus.pos.nTargetTimespan = 5 * 60; // 5 min == 10 blocks
Expand Down
2 changes: 2 additions & 0 deletions src/consensus/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ struct Params {
int DF20GrandCentralHeight;
int DF21GrandCentralEpilogueHeight;
int DF22MetachainHeight;
int DF23UpgradeHeight;
int DF24UpgradeHeight;

/** Foundation share after AMK, normalized to COIN = 100% */
CAmount foundationShareDFIP1;
Expand Down
2 changes: 2 additions & 0 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,8 @@ void SetupServerArgs()
gArgs.AddArg("-grandcentralheight", "Grand Central fork activation height (regtest only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
gArgs.AddArg("-grandcentralepilogueheight", "Grand Central Epilogue fork activation height (regtest only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
gArgs.AddArg("-metachainheight", "Metachain fork activation height (regtest only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
gArgs.AddArg("-df23upgradeheight", "DF23 fork activation height (regtest only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
gArgs.AddArg("-df24upgradeheight", "DF24 fork activation height (regtest only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
gArgs.AddArg("-jellyfish_regtest", "Configure the regtest network for jellyfish testing", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::OPTIONS);
gArgs.AddArg("-regtest-skip-loan-collateral-validation", "Skip loan collateral check for jellyfish testing", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::OPTIONS);
gArgs.AddArg("-regtest-minttoken-simulate-mainnet", "Simulate mainnet for minttokens on regtest - default behavior on regtest is to allow anyone to mint mintable tokens for ease of testing", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::OPTIONS);
Expand Down
2 changes: 2 additions & 0 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1546,6 +1546,8 @@ UniValue getblockchaininfo(const JSONRPCRequest& request)
BuriedForkDescPushBack(softforks, "grandcentral", consensusParams.DF20GrandCentralHeight);
BuriedForkDescPushBack(softforks, "grandcentralepilogue", consensusParams.DF21GrandCentralEpilogueHeight);
BuriedForkDescPushBack(softforks, "metachain", consensusParams.DF22MetachainHeight);
BuriedForkDescPushBack(softforks, "df23upgrade", consensusParams.DF23UpgradeHeight);
BuriedForkDescPushBack(softforks, "df24upgrade", consensusParams.DF24UpgradeHeight);
BIP9SoftForkDescPushBack(softforks, "testdummy", consensusParams, Consensus::DEPLOYMENT_TESTDUMMY);
obj.pushKV("softforks", softforks);

Expand Down
10 changes: 10 additions & 0 deletions test/functional/rpc_blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,16 @@ def _test_getblockchaininfo(self):
"active": False,
"height": 10000000,
},
"df23upgrade": {
"type": "buried",
"active": False,
"height": 10000000,
},
"df24upgrade": {
"type": "buried",
"active": False,
"height": 10000000,
},
"testdummy": {
"type": "bip9",
"bip9": {
Expand Down

0 comments on commit 6a8d27b

Please sign in to comment.