Skip to content

Commit

Permalink
Added EunosHeight
Browse files Browse the repository at this point in the history
  • Loading branch information
surangap authored and bvbfan committed Apr 6, 2021
1 parent 6c0a28c commit 86b7592
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>::max(); // 30th March 2021

consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
// consensus.pos.nTargetTimespan = 14 * 24 * 60 * 60; // two weeks
Expand Down Expand Up @@ -305,6 +306,7 @@ class CTestNetParams : public CChainParams {
consensus.ClarkeQuayHeight = 155000;
consensus.DakotaHeight = 220680;
consensus.DakotaCrescentHeight = 287700;
consensus.EunosHeight = std::numeric_limits<int>::max(); // 30th March 2021

consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
// consensus.pos.nTargetTimespan = 14 * 24 * 60 * 60; // two weeks
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -809,6 +813,17 @@ void CRegTestParams::UpdateActivationParametersFromArgs(const ArgsManager& args)
consensus.DakotaCrescentHeight = static_cast<int>(height);
}

if (gArgs.IsArgSet("-eunosheight")) {
int64_t height = gArgs.GetArg("-eunosheight", consensus.EunosHeight);
if (height < -1 || height >= std::numeric_limits<int>::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<int>::max();
}
consensus.EunosHeight = static_cast<int>(height);
}

if (!args.IsArgSet("-vbparams")) return;

for (const std::string& strDeployment : args.GetArgs("-vbparams")) {
Expand Down
2 changes: 2 additions & 0 deletions src/consensus/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions test/functional/rpc_blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand Down

0 comments on commit 86b7592

Please sign in to comment.