From 6a8d27b46760e39fde50f3cd02e5ac7a7661320a Mon Sep 17 00:00:00 2001 From: Peter John Bushnell Date: Thu, 9 Nov 2023 10:50:32 +0000 Subject: [PATCH] Add forks for DF23 and DF24 (#2690) --- src/chainparams.cpp | 12 ++++++++++++ src/consensus/params.h | 2 ++ src/init.cpp | 2 ++ src/rpc/blockchain.cpp | 2 ++ test/functional/rpc_blockchain.py | 10 ++++++++++ 5 files changed, 28 insertions(+) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 6b8f6a041a..66feabbaca 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -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::max(); + consensus.DF24UpgradeHeight = std::numeric_limits::max(); consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // consensus.pos.nTargetTimespan = 14 * 24 * 60 * 60; // two weeks @@ -418,6 +420,8 @@ class CTestNetParams : public CChainParams { consensus.DF20GrandCentralHeight = 1150020; consensus.DF21GrandCentralEpilogueHeight = 1150030; consensus.DF22MetachainHeight = 1150040; + consensus.DF23UpgradeHeight = std::numeric_limits::max(); + consensus.DF24UpgradeHeight = std::numeric_limits::max(); consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // consensus.pos.nTargetTimespan = 14 * 24 * 60 * 60; // two weeks @@ -636,6 +640,8 @@ class CChangiParams : public CChainParams { consensus.DF20GrandCentralHeight = 1366000; consensus.DF21GrandCentralEpilogueHeight = 1438200; consensus.DF22MetachainHeight = 1586750; + consensus.DF23UpgradeHeight = std::numeric_limits::max(); + consensus.DF24UpgradeHeight = std::numeric_limits::max(); consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); consensus.pos.nTargetTimespan = 5 * 60; // 5 min == 10 blocks @@ -851,6 +857,8 @@ class CDevNetParams : public CChainParams { consensus.DF20GrandCentralHeight = 1366000; consensus.DF21GrandCentralEpilogueHeight = 1438200; consensus.DF22MetachainHeight = 1586750; + consensus.DF23UpgradeHeight = std::numeric_limits::max(); + consensus.DF24UpgradeHeight = std::numeric_limits::max(); consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); consensus.pos.nTargetTimespan = 5 * 60; // 5 min == 10 blocks @@ -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 @@ -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 diff --git a/src/consensus/params.h b/src/consensus/params.h index f47e8c7dc9..e0c6885a95 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -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; diff --git a/src/init.cpp b/src/init.cpp index 0a4e1457d3..9186b3121e 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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); diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index e07466dd07..026580c4a4 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -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); diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py index d1f1addc51..00dc310296 100755 --- a/test/functional/rpc_blockchain.py +++ b/test/functional/rpc_blockchain.py @@ -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": {