diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 00a95a1185a..afccc6de4b1 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -121,6 +121,7 @@ class CMainParams : public CChainParams { consensus.ClarkeQuayHeight = 595738; consensus.DakotaHeight = 678000; // 1st March 2021 consensus.DakotaCrescentHeight = 733000; // 25th March 2021 + consensus.EunosHeight = std::numeric_limits::max(); // 30th March 2021 consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // consensus.pos.nTargetTimespan = 14 * 24 * 60 * 60; // two weeks @@ -305,6 +306,7 @@ class CTestNetParams : public CChainParams { consensus.ClarkeQuayHeight = 155000; consensus.DakotaHeight = 220680; consensus.DakotaCrescentHeight = 287700; + consensus.EunosHeight = std::numeric_limits::max(); // 30th March 2021 consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // consensus.pos.nTargetTimespan = 14 * 24 * 60 * 60; // two weeks @@ -454,6 +456,7 @@ class CDevNetParams : public CChainParams { consensus.ClarkeQuayHeight = 0; consensus.DakotaHeight = 0; consensus.DakotaCrescentHeight = 0; + consensus.EunosHeight = 0; consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); consensus.pos.nTargetTimespan = 5 * 60; // 5 min == 10 blocks @@ -595,6 +598,7 @@ class CRegTestParams : public CChainParams { consensus.ClarkeQuayHeight = 10000000; consensus.DakotaHeight = 10000000; consensus.DakotaCrescentHeight = 10000000; + consensus.EunosHeight = 10000000; consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); consensus.pos.nTargetTimespan = 14 * 24 * 60 * 60; // two weeks @@ -809,6 +813,17 @@ void CRegTestParams::UpdateActivationParametersFromArgs(const ArgsManager& args) consensus.DakotaCrescentHeight = static_cast(height); } + if (gArgs.IsArgSet("-eunosheight")) { + int64_t height = gArgs.GetArg("-eunosheight", consensus.EunosHeight); + if (height < -1 || height >= std::numeric_limits::max()) { + throw std::runtime_error(strprintf("Activation height %ld for Eunos is out of valid range. Use -1 to disable Eunos features.", height)); + } else if (height == -1) { + LogPrintf("Eunos disabled for testing\n"); + height = std::numeric_limits::max(); + } + consensus.EunosHeight = static_cast(height); + } + if (!args.IsArgSet("-vbparams")) return; for (const std::string& strDeployment : args.GetArgs("-vbparams")) { diff --git a/src/consensus/params.h b/src/consensus/params.h index d627e0624b1..52c2e27ca33 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -82,6 +82,8 @@ struct Params { int DakotaHeight; /** Fifth major fork **/ int DakotaCrescentHeight; + /** Sixth major fork **/ + int EunosHeight; /** Foundation share after AMK, normalized to COIN = 100% */ CAmount foundationShareDFIP1; diff --git a/src/init.cpp b/src/init.cpp index 8383fca3a85..8e461d57a9a 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -468,6 +468,7 @@ void SetupServerArgs() gArgs.AddArg("-clarkequayheight", "ClarkeQuay fork activation height (regtest only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); gArgs.AddArg("-dakotaheight", "Dakota fork activation height (regtest only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); gArgs.AddArg("-dakotacrescentheight", "DakotaCrescent fork activation height (regtest only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); + gArgs.AddArg("-eunosheight", "Eunos fork activation height (regtest only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); #ifdef USE_UPNP #if USE_UPNP gArgs.AddArg("-upnp", "Use UPnP to map the listening port (default: 1 when listening and no -proxy)", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 08117f51780..9726f281638 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1324,6 +1324,7 @@ UniValue getblockchaininfo(const JSONRPCRequest& request) BuriedForkDescPushBack(softforks, "clarkequay", consensusParams.ClarkeQuayHeight); BuriedForkDescPushBack(softforks, "dakota", consensusParams.DakotaHeight); BuriedForkDescPushBack(softforks, "dakotacrescent", consensusParams.DakotaCrescentHeight); + BuriedForkDescPushBack(softforks, "eunos", consensusParams.EunosHeight); 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 de8457b71b5..674b96adff5 100755 --- a/test/functional/rpc_blockchain.py +++ b/test/functional/rpc_blockchain.py @@ -134,6 +134,7 @@ def _test_getblockchaininfo(self): 'clarkequay': {'type': 'buried', 'active': False, 'height': 10000000}, 'dakota': {'type': 'buried', 'active': False, 'height': 10000000}, 'dakotacrescent': {'type': 'buried', 'active': False, 'height': 10000000}, + 'eunos': {'type': 'buried', 'active': False, 'height': 10000000}, 'testdummy': { 'type': 'bip9', 'bip9': {