From 04cd03f713e39eb1c6035d66ddb423d9c75dcfe4 Mon Sep 17 00:00:00 2001 From: Peter Bushnell Date: Fri, 16 Jun 2023 11:52:02 +0100 Subject: [PATCH] Add temporary fork to avoid conflicts on Changi --- src/chainparams.cpp | 6 ++++++ src/consensus/params.h | 1 + src/init.cpp | 3 ++- src/rpc/blockchain.cpp | 1 + test/functional/rpc_blockchain.py | 1 + 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index b3413e33af..cc8896a481 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -141,6 +141,7 @@ class CMainParams : public CChainParams { consensus.GrandCentralHeight = 2479000; // Dec 8th, 2022. consensus.GrandCentralEpilogueHeight = 2574000; // Jan 10th, 2023. consensus.NextNetworkUpgradeHeight = std::numeric_limits::max(); + consensus.ChangiIntermediateHeight = std::numeric_limits::max(); consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // consensus.pos.nTargetTimespan = 14 * 24 * 60 * 60; // two weeks @@ -416,6 +417,7 @@ class CTestNetParams : public CChainParams { consensus.GrandCentralHeight = 1366000; consensus.GrandCentralEpilogueHeight = 1438200; consensus.NextNetworkUpgradeHeight = std::numeric_limits::max(); + consensus.ChangiIntermediateHeight = std::numeric_limits::max(); consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // consensus.pos.nTargetTimespan = 14 * 24 * 60 * 60; // two weeks @@ -634,6 +636,7 @@ class CChangiParams : public CChainParams { consensus.GrandCentralHeight = 1366000; consensus.GrandCentralEpilogueHeight = 1438200; consensus.NextNetworkUpgradeHeight = 1586750; + consensus.ChangiIntermediateHeight = std::numeric_limits::max(); consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); consensus.pos.nTargetTimespan = 5 * 60; // 5 min == 10 blocks @@ -850,6 +853,7 @@ class CDevNetParams : public CChainParams { consensus.GrandCentralHeight = 1366000; consensus.GrandCentralEpilogueHeight = 1438200; consensus.NextNetworkUpgradeHeight = 1586750; + consensus.ChangiIntermediateHeight = std::numeric_limits::max(); consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); consensus.pos.nTargetTimespan = 5 * 60; // 5 min == 10 blocks @@ -1069,6 +1073,7 @@ class CRegTestParams : public CChainParams { consensus.GrandCentralHeight = 10000000; consensus.GrandCentralEpilogueHeight = 10000000; consensus.NextNetworkUpgradeHeight = 10000000; + consensus.ChangiIntermediateHeight = 10000000; consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); consensus.pos.nTargetTimespan = 14 * 24 * 60 * 60; // two weeks @@ -1315,6 +1320,7 @@ void SetupCommonArgActivationParams(Consensus::Params &consensus) { UpdateHeightValidation("Grand Central", "-grandcentralheight", consensus.GrandCentralHeight); UpdateHeightValidation("Grand Central Epilogue", "-grandcentralepilogueheight", consensus.GrandCentralEpilogueHeight); UpdateHeightValidation("Next Network Upgrade", "-nextnetworkupgradeheight", consensus.NextNetworkUpgradeHeight); + UpdateHeightValidation("Changi Intermediate", "-changiintermediateheight", consensus.ChangiIntermediateHeight); 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 5b21801430..ed1429a639 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -102,6 +102,7 @@ struct Params { int GrandCentralHeight; int GrandCentralEpilogueHeight; int NextNetworkUpgradeHeight; + int ChangiIntermediateHeight; // To be changed to NextNetworkUpgradeHeight on mainnet release /** Foundation share after AMK, normalized to COIN = 100% */ CAmount foundationShareDFIP1; diff --git a/src/init.cpp b/src/init.cpp index ed2af2850f..2374893924 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -511,7 +511,8 @@ void SetupServerArgs() gArgs.AddArg("-fortcanningepilogueheight", "Alias for Fort Canning Epilogue fork activation height (regtest only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS); 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("-nextnetworkupgradeheight", "Next NEtwork Upgrade fork activation height (regtest only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS); + gArgs.AddArg("-nextnetworkupgradeheight", "Next Network Upgrade fork activation height (regtest only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS); + gArgs.AddArg("-changiintermediateheight", "Changi Intermediate 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 767b75de4e..9e9b23687a 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1354,6 +1354,7 @@ UniValue getblockchaininfo(const JSONRPCRequest& request) BuriedForkDescPushBack(softforks, "grandcentral", consensusParams.GrandCentralHeight); BuriedForkDescPushBack(softforks, "grandcentralepilogue", consensusParams.GrandCentralEpilogueHeight); BuriedForkDescPushBack(softforks, "nextnetworkupgrade", consensusParams.NextNetworkUpgradeHeight); + BuriedForkDescPushBack(softforks, "changiintermediate", consensusParams.ChangiIntermediateHeight); 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 57bbe52c02..7471a5694d 100755 --- a/test/functional/rpc_blockchain.py +++ b/test/functional/rpc_blockchain.py @@ -144,6 +144,7 @@ def _test_getblockchaininfo(self): 'grandcentral': {'type': 'buried', 'active': False, 'height': 10000000}, 'grandcentralepilogue': {'type': 'buried', 'active': False, 'height': 10000000}, 'nextnetworkupgrade': {'type': 'buried', 'active': False, 'height': 10000000}, + 'changiintermediate': {'type': 'buried', 'active': False, 'height': 10000000}, 'testdummy': { 'type': 'bip9', 'bip9': {