From de821b9b1516d9dd39f99f2edb76a99b5f4dcd81 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Fri, 9 Aug 2024 00:59:32 +0700 Subject: [PATCH] refactor: remove command line argument -bip147height, -dip8params bip147height is superseeded by -testactivationheight=bip147@height dip8params is superseeded by -testactivationheight=dip0008@height --- doc/release-notes-6325.md | 4 ++++ src/chainparams.cpp | 46 --------------------------------------- src/chainparamsbase.cpp | 2 -- 3 files changed, 4 insertions(+), 48 deletions(-) create mode 100644 doc/release-notes-6325.md diff --git a/doc/release-notes-6325.md b/doc/release-notes-6325.md new file mode 100644 index 0000000000..84c02201d4 --- /dev/null +++ b/doc/release-notes-6325.md @@ -0,0 +1,4 @@ +Tests +----- + +- Command line arguments -dip8params, -bip147height are removed in favour of -testactivationheight. (dash#6325) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index b4b47682ad..4d7e5841bc 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -846,8 +846,6 @@ public: UpdateActivationParametersFromArgs(args); UpdateDIP3ParametersFromArgs(args); - UpdateDIP8ParametersFromArgs(args); - UpdateBIP147ParametersFromArgs(args); UpdateBudgetParametersFromArgs(args); genesis = CreateGenesisBlock(1417713337, 1096447, 0x207fffff, 1, 50 * COIN); @@ -966,21 +964,6 @@ public: } void UpdateDIP3ParametersFromArgs(const ArgsManager& args); - /** - * Allows modifying the DIP8 activation height - */ - void UpdateDIP8Parameters(int nActivationHeight) - { - consensus.DIP0008Height = nActivationHeight; - } - void UpdateDIP8ParametersFromArgs(const ArgsManager& args); - - void UpdateBIP147Parameters(int nActivationHeight) - { - consensus.BIP147Height = nActivationHeight; - } - void UpdateBIP147ParametersFromArgs(const ArgsManager& args); - /** * Allows modifying the budget regtest parameters. */ @@ -1137,35 +1120,6 @@ void CRegTestParams::UpdateDIP3ParametersFromArgs(const ArgsManager& args) UpdateDIP3Parameters(nDIP3ActivationHeight, nDIP3EnforcementHeight); } -void CRegTestParams::UpdateDIP8ParametersFromArgs(const ArgsManager& args) -{ - if (!args.IsArgSet("-dip8params")) return; - - std::string strParams = args.GetArg("-dip8params", ""); - std::vector vParams = SplitString(strParams, ':'); - if (vParams.size() != 1) { - throw std::runtime_error("DIP8 parameters malformed, expecting "); - } - int nDIP8ActivationHeight; - if (!ParseInt32(vParams[0], &nDIP8ActivationHeight)) { - throw std::runtime_error(strprintf("Invalid activation height (%s)", vParams[0])); - } - LogPrintf("Setting DIP8 parameters to activation=%ld\n", nDIP8ActivationHeight); - UpdateDIP8Parameters(nDIP8ActivationHeight); -} - -void CRegTestParams::UpdateBIP147ParametersFromArgs(const ArgsManager& args) -{ - if (!args.IsArgSet("-bip147height")) return; - int nBIP147Height; - const std::string strParams = args.GetArg("-bip147height", ""); - if (!ParseInt32(strParams, &nBIP147Height)) { - throw std::runtime_error(strprintf("Invalid activation height (%s)", strParams)); - } - LogPrintf("Setting BIP147 parameters to activation=%lld\n", nBIP147Height); - UpdateBIP147Parameters(nBIP147Height); -} - void CRegTestParams::UpdateBudgetParametersFromArgs(const ArgsManager& args) { if (!args.IsArgSet("-budgetparams")) return; diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index d7ef237c0e..755025c17e 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -20,8 +20,6 @@ void SetupChainParamsBaseOptions(ArgsManager& argsman) argsman.AddArg("-budgetparams=::", "Override masternode, budget and superblock start heights (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS); argsman.AddArg("-devnet=", "Use devnet chain with provided name", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); argsman.AddArg("-dip3params=:", "Override DIP3 activation and enforcement heights (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS); - argsman.AddArg("-dip8params=", "Override DIP8 activation height (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS); - argsman.AddArg("-bip147height=", "Override BIP147 activation height (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS); argsman.AddArg("-testactivationheight=name@height.", "Set the activation height of 'name' (bip147, bip34, dersig, cltv, csv, brr, dip0001, dip0008, v20, mn_rr). (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); argsman.AddArg("-highsubsidyblocks=", "The number of blocks with a higher than normal subsidy to mine at the start of a chain. Block after that height will have fixed subsidy base. (default: 0, devnet-only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); argsman.AddArg("-highsubsidyfactor=", "The factor to multiply the normal block subsidy by while in the highsubsidyblocks window of a chain (default: 1, devnet-only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);