Skip to content

Commit

Permalink
Merge #6325: feat: start DIP0024 from block 1 - fire up test chains b…
Browse files Browse the repository at this point in the history
…y first block - 7/n

906c2d7 refactor: add annotation gsl::not_null for ConstructCreditPool (Konstantin Akimov)
f1905ca fix: intermittent missing of PoSe ban in feature_llmq_simplepose.py (Konstantin Akimov)
cf84dff fix: bump time for all nodes during mine_quorum in feature_llmq_rotation.py test (Konstantin Akimov)
efd4701 fix: intermittent error for feature_llmq_simplepose due to rotating quorums (Konstantin Akimov)
2bafadf feat: put DIP0024 activation to block 1 on RegTest (Konstantin Akimov)
632c4c4 feat: re-bury DIP0024 with new height when quorums actually appeared (Konstantin Akimov)
343c74b fix: intermittent error in feature_index_prune due to DKG influence (Konstantin Akimov)
de821b9 refactor: remove command line argument -bip147height, -dip8params (Konstantin Akimov)
d8ce0a7 docs: updated comment for DIP0003 activation on RegTest (Konstantin Akimov)
4dafec8 fix: add check that DIP0003 activated before retrieving CbTx for CreditPool (Konstantin Akimov)
26e9813 fix: assertion in Credit Pool validation during connecting blocks (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  This PR is 7th in the achieving ultimate goal to activate old forks from block 1.
  It helps to run unit and functional tests faster; it helps for platform's dev-environment to start faster.

  ## What was done?
  Prior work: #6187, #6189, #6214, #6225, #6269, #6275

  This PR:
   - simplify DIP0024 activation and activate it from block 1 at RegTest
   - removes command lines arguments: -bip147height, -dip8params
   - fixed intermittent errors in feature_index_prune.py and feature_llmq_simplepose.py
   - fix assertion crash on Regtest if using strange combination of -testactivationheight and -dip3params

  ## How Has This Been Tested?
  Run unit, functional tests.

  ## Breaking Changes
  [regtest only] -dip8params, -bip147height are removed.

  ## Checklist:
  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas
  - [x] I have added or updated relevant unit/integration/functional/e2e tests
  - [x] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone

ACKs for top commit:
  UdjinM6:
    utACK 906c2d7
  PastaPastaPasta:
    utACK 906c2d7

Tree-SHA512: fab8a9bc03bb7f220c19dd952a03f8fec0b6ef1362d7308eb77c90e0ba814a241bb2bf36beccf78bb285ede1b6d85ec52fa19b3729ac9b643b420d13fbb63b47
  • Loading branch information
PastaPastaPasta committed Dec 10, 2024
2 parents bf22090 + 906c2d7 commit 977048f
Show file tree
Hide file tree
Showing 18 changed files with 116 additions and 148 deletions.
4 changes: 4 additions & 0 deletions doc/release-notes-6325.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Tests
-----

- Command line arguments -dip8params, -bip147height are removed in favour of -testactivationheight. (dash#6325)
59 changes: 6 additions & 53 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ class CMainParams : public CChainParams {
consensus.DIP0008Height = 1088640; // 00000000000000112e41e4b3afda8b233b8cc07c532d2eac5de097b68358c43e
consensus.BRRHeight = 1374912; // 000000000000000c5a124f3eccfbe6e17876dca79cec9e63dfa70d269113c926
consensus.DIP0020Height = 1516032; // 000000000000000f64ed3bd9af1078177ac026f6aa2677aa4d8beeae43be56cc
consensus.DIP0024Height = 1737792; // 0000000000000001342be9c0b75ad40c276beaad91616423c4d9cb101b3db438
consensus.DIP0024QuorumsHeight = 1738698; // 000000000000001aa25181e4c466e593992c98f9eb21c69ee757b8bb0af50244
consensus.V19Height = 1899072; // 0000000000000015e32e73052d663626327004c81c5c22cb8b42c361015c0eae
consensus.V20Height = 1987776; // 000000000000001bf41cff06b76780050682ca29e61a91c391893d4745579777
Expand Down Expand Up @@ -387,7 +386,6 @@ class CTestNetParams : public CChainParams {
consensus.DIP0008Height = 78800; // 000000000e9329d964d80e7dab2e704b43b6bd2b91fea1e9315d38932e55fb55
consensus.BRRHeight = 387500; // 0000001537dbfd09dea69f61c1f8b2afa27c8dc91c934e144797761c9f10367b
consensus.DIP0020Height = 414100; // 000000cf961868662fbfbb5d1af6f1caa1809f6a4e390efe5f8cd3031adea668
consensus.DIP0024Height = 769700; // 0000008d84e4efd890ae95c70a7a6126a70a80e5c19e4cb264a5b3469aeef172
consensus.DIP0024QuorumsHeight = 770730; // 0000003c43b3ae7fffe61278ca5537a0e256ebf4d709d45f0ab040271074d51e
consensus.V19Height = 850100; // 000004728b8ff2a16b9d4eebb0fd61eeffadc9c7fe4b0ec0b5a739869401ab5b
consensus.V20Height = 905100; // 0000020c5e0f86f385cbf8e90210de9a9fd63633f01433bf47a6b3227a2851fd
Expand Down Expand Up @@ -560,12 +558,11 @@ class CDevNetParams : public CChainParams {
consensus.DIP0008Height = 2; // DIP0008 activated immediately on devnet
consensus.BRRHeight = 2; // BRR (realloc) activated immediately on devnet
consensus.DIP0020Height = 2; // DIP0020 activated immediately on devnet
consensus.DIP0024Height = 2; // DIP0024 activated immediately on devnet
consensus.DIP0024QuorumsHeight = 2; // DIP0024 activated immediately on devnet
consensus.V19Height = 2; // V19 activated immediately on devnet
consensus.V20Height = 2; // V20 activated immediately on devnet
consensus.MN_RRHeight = 2; // MN_RR activated immediately on devnet
consensus.MinBIP9WarningHeight = 2 + 2016; // v19 activation height + miner confirmation window
consensus.MinBIP9WarningHeight = 2 + 2016; // mn_rr activation height + miner confirmation window
consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 1
consensus.nPowTargetTimespan = 24 * 60 * 60; // Dash: 1 day
consensus.nPowTargetSpacing = 2.5 * 60; // Dash: 2.5 minutes
Expand Down Expand Up @@ -790,14 +787,14 @@ class CRegTestParams : public CChainParams {
consensus.BIP147Height = 1; // Always active unless overridden
consensus.CSVHeight = 1; // Always active unless overridden
consensus.DIP0001Height = 1; // Always active unless overridden
consensus.DIP0003Height = 432;
consensus.DIP0003Height = 432; // Always active for DashTestFramework in functional tests (see dip3params)
// For unit tests and for BitcoinTestFramework is disabled due to missing quorum commitment for blocks created by helpers such as create_blocks
consensus.DIP0003EnforcementHeight = 500;
consensus.DIP0003EnforcementHash = uint256();
consensus.DIP0008Height = 1; // Always active unless overridden
consensus.BRRHeight = 1; // Always active unless overridden
consensus.DIP0020Height = 1; // Always active unless overridden
consensus.DIP0024Height = 900;
consensus.DIP0024QuorumsHeight = 900;
consensus.DIP0024QuorumsHeight = 1; // Always have dip0024 quorums unless overridden
consensus.V19Height = 900;
consensus.V20Height = 900;
consensus.MN_RRHeight = 900;
Expand Down Expand Up @@ -845,8 +842,6 @@ class CRegTestParams : public CChainParams {

UpdateActivationParametersFromArgs(args);
UpdateDIP3ParametersFromArgs(args);
UpdateDIP8ParametersFromArgs(args);
UpdateBIP147ParametersFromArgs(args);
UpdateBudgetParametersFromArgs(args);

genesis = CreateGenesisBlock(1417713337, 1096447, 0x207fffff, 1, 50 * COIN);
Expand Down Expand Up @@ -965,21 +960,6 @@ class CRegTestParams : public CChainParams {
}
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.
*/
Expand Down Expand Up @@ -1045,6 +1025,8 @@ static void MaybeUpdateHeights(const ArgsManager& args, Consensus::Params& conse
consensus.DIP0001Height = int{height};
} else if (name == "dip0008") {
consensus.DIP0008Height = int{height};
} else if (name == "dip0024") {
consensus.DIP0024QuorumsHeight = int{height};
} else if (name == "v20") {
consensus.V20Height = int{height};
} else if (name == "mn_rr") {
Expand Down Expand Up @@ -1136,35 +1118,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<std::string> vParams = SplitString(strParams, ':');
if (vParams.size() != 1) {
throw std::runtime_error("DIP8 parameters malformed, expecting <activation>");
}
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;
Expand Down
4 changes: 1 addition & 3 deletions src/chainparamsbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ void SetupChainParamsBaseOptions(ArgsManager& argsman)
argsman.AddArg("-budgetparams=<masternode>:<budget>:<superblock>", "Override masternode, budget and superblock start heights (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-devnet=<name>", "Use devnet chain with provided name", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-dip3params=<activation>:<enforcement>", "Override DIP3 activation and enforcement heights (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-dip8params=<activation>", "Override DIP8 activation height (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-bip147height=<activation>", "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("-testactivationheight=name@height.", "Set the activation height of 'name' (bip147, bip34, dersig, cltv, csv, brr, dip0001, dip0008, dip0024, v20, mn_rr). (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-highsubsidyblocks=<n>", "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=<n>", "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);
argsman.AddArg("-llmqchainlocks=<quorum name>", "Override the default LLMQ type used for ChainLocks. Allows using ChainLocks with smaller LLMQs. (default: llmq_devnet, devnet-only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
Expand Down
4 changes: 1 addition & 3 deletions src/consensus/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ struct Params {
int BRRHeight;
/** Block height at which DIP0020, DIP0021 and LLMQ_100_67 quorums become active */
int DIP0020Height;
/** Block height at which DIP0024 (Quorum Rotation) and decreased governance proposal fee becomes active */
int DIP0024Height;
/** Block height at which the first DIP0024 quorum was mined */
int DIP0024QuorumsHeight;
/** Block height at which V19 (Basic BLS and EvoNodes) becomes active */
Expand Down Expand Up @@ -205,7 +203,7 @@ struct Params {
case DEPLOYMENT_DIP0020:
return DIP0020Height;
case DEPLOYMENT_DIP0024:
return DIP0024Height;
return DIP0024QuorumsHeight;
case DEPLOYMENT_BRR:
return BRRHeight;
case DEPLOYMENT_V19:
Expand Down
23 changes: 14 additions & 9 deletions src/evo/creditpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,24 +112,29 @@ void CCreditPoolManager::AddToCache(const uint256& block_hash, int height, const
}
}

static std::optional<CBlock> GetBlockForCreditPool(const CBlockIndex* const block_index, const Consensus::Params& consensusParams)
static std::optional<CBlock> GetBlockForCreditPool(const gsl::not_null<const CBlockIndex*> block_index,
const Consensus::Params& consensusParams)
{
// There's no CbTx before DIP0003 activation
if (!DeploymentActiveAt(*block_index, Params().GetConsensus(), Consensus::DEPLOYMENT_DIP0003)) {
return std::nullopt;
}

CBlock block;
if (!ReadBlockFromDisk(block, block_index, consensusParams)) {
throw std::runtime_error("failed-getcbforblock-read");
}

assert(!block.vtx.empty());

// Should not fail if V20 (DIP0027) is active but it happens for RegChain (unit tests)
if (!block.vtx[0]->IsSpecialTxVersion()) return std::nullopt;

assert(!block.vtx[0]->vExtraPayload.empty());
if (block.vtx.empty() || block.vtx[0]->vExtraPayload.empty() || !block.vtx[0]->IsSpecialTxVersion()) {
LogPrintf("%s: ERROR: empty CbTx for CreditPool at height=%d\n", __func__, block_index->nHeight);
return std::nullopt;
}

return block;
}

CCreditPool CCreditPoolManager::ConstructCreditPool(const CBlockIndex* const block_index, CCreditPool prev, const Consensus::Params& consensusParams)
CCreditPool CCreditPoolManager::ConstructCreditPool(const gsl::not_null<const CBlockIndex*> block_index,
CCreditPool prev, const Consensus::Params& consensusParams)
{
std::optional<CBlock> block = GetBlockForCreditPool(block_index, consensusParams);
if (!block) {
Expand Down Expand Up @@ -210,7 +215,7 @@ CCreditPool CCreditPoolManager::ConstructCreditPool(const CBlockIndex* const blo

CCreditPool CCreditPoolManager::GetCreditPool(const CBlockIndex* block_index, const Consensus::Params& consensusParams)
{
std::stack<const CBlockIndex *> to_calculate;
std::stack<gsl::not_null<const CBlockIndex*>> to_calculate;

std::optional<CCreditPool> poolTmp;
while (block_index != nullptr && !(poolTmp = GetFromCache(*block_index)).has_value()) {
Expand Down
4 changes: 3 additions & 1 deletion src/evo/creditpool.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <evo/assetlocktx.h>

#include <gsl/pointers.h>
#include <optional>
#include <unordered_set>

Expand Down Expand Up @@ -134,7 +135,8 @@ class CCreditPoolManager
std::optional<CCreditPool> GetFromCache(const CBlockIndex& block_index);
void AddToCache(const uint256& block_hash, int height, const CCreditPool& pool);

CCreditPool ConstructCreditPool(const CBlockIndex* block_index, CCreditPool prev, const Consensus::Params& consensusParams);
CCreditPool ConstructCreditPool(const gsl::not_null<const CBlockIndex*> block_index, CCreditPool prev,
const Consensus::Params& consensusParams);
};

std::optional<CCreditPoolDiff> GetCreditPoolDiffForBlock(CCreditPoolManager& cpoolman, const BlockManager& blockman, const llmq::CQuorumManager& qman,
Expand Down
10 changes: 7 additions & 3 deletions src/evo/specialtxman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,16 +267,20 @@ bool CSpecialTxProcessor::CheckCreditPoolDiffForBlock(const CBlock& block, const

try {
if (!DeploymentActiveAt(*pindex, m_consensus_params, Consensus::DEPLOYMENT_DIP0003)) return true;
if (!DeploymentActiveAt(*pindex, m_consensus_params, Consensus::DEPLOYMENT_DIP0008)) return true;
if (!DeploymentActiveAt(*pindex, m_consensus_params, Consensus::DEPLOYMENT_V20)) return true;

auto creditPoolDiff = GetCreditPoolDiffForBlock(m_cpoolman, m_chainman.m_blockman, m_qman, block, pindex->pprev, m_consensus_params, blockSubsidy, state);
if (!creditPoolDiff.has_value()) return false;

// If we get there we have v20 activated and credit pool amount must be included in block CbTx
if (block.vtx.empty()) {
return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "bad-missing-cbtx");
}
const auto& tx = *block.vtx[0];
assert(tx.IsCoinBase());
assert(tx.IsSpecialTxVersion());
assert(tx.nType == TRANSACTION_COINBASE);
if (!tx.IsCoinBase() || !tx.IsSpecialTxVersion() || tx.nType != TRANSACTION_COINBASE) {
return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "bad-cbtx-type");
}

const auto opt_cbTx = GetTxPayload<CCbTx>(tx);
if (!opt_cbTx) {
Expand Down
14 changes: 7 additions & 7 deletions src/llmq/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,26 +116,26 @@ std::map<Consensus::LLMQType, QvvecSyncMode> GetEnabledQuorumVvecSyncEntries()

bool IsQuorumTypeEnabled(Consensus::LLMQType llmqType, gsl::not_null<const CBlockIndex*> pindexPrev)
{
return IsQuorumTypeEnabledInternal(llmqType, pindexPrev, std::nullopt, std::nullopt);
return IsQuorumTypeEnabledInternal(llmqType, pindexPrev, std::nullopt);
}

bool IsQuorumTypeEnabledInternal(Consensus::LLMQType llmqType, gsl::not_null<const CBlockIndex*> pindexPrev,
std::optional<bool> optDIP0024IsActive, std::optional<bool> optHaveDIP0024Quorums)
std::optional<bool> optIsDIP0024Active)
{
const Consensus::Params& consensusParams = Params().GetConsensus();

const bool fDIP0024IsActive{optDIP0024IsActive.value_or(DeploymentActiveAfter(pindexPrev, consensusParams, Consensus::DEPLOYMENT_DIP0024))};
const bool fHaveDIP0024Quorums{optHaveDIP0024Quorums.value_or(pindexPrev->nHeight >= consensusParams.DIP0024QuorumsHeight)};
const bool fDIP0024IsActive{
optIsDIP0024Active.value_or(DeploymentActiveAfter(pindexPrev, consensusParams, Consensus::DEPLOYMENT_DIP0024))};
switch (llmqType)
{
case Consensus::LLMQType::LLMQ_DEVNET:
return true;
case Consensus::LLMQType::LLMQ_50_60:
return !fDIP0024IsActive || !fHaveDIP0024Quorums || Params().NetworkIDString() == CBaseChainParams::TESTNET ||
return !fDIP0024IsActive || Params().NetworkIDString() == CBaseChainParams::TESTNET ||
Params().NetworkIDString() == CBaseChainParams::DEVNET;
case Consensus::LLMQType::LLMQ_TEST_INSTANTSEND:
return !fDIP0024IsActive || !fHaveDIP0024Quorums ||
consensusParams.llmqTypeDIP0024InstantSend == Consensus::LLMQType::LLMQ_TEST_INSTANTSEND;
return !fDIP0024IsActive ||
consensusParams.llmqTypeDIP0024InstantSend == Consensus::LLMQType::LLMQ_TEST_INSTANTSEND;
case Consensus::LLMQType::LLMQ_TEST:
case Consensus::LLMQType::LLMQ_TEST_PLATFORM:
case Consensus::LLMQType::LLMQ_400_60:
Expand Down
3 changes: 2 additions & 1 deletion src/llmq/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ bool IsWatchQuorumsEnabled();
std::map<Consensus::LLMQType, QvvecSyncMode> GetEnabledQuorumVvecSyncEntries();

bool IsQuorumTypeEnabled(Consensus::LLMQType llmqType, gsl::not_null<const CBlockIndex*> pindexPrev);
bool IsQuorumTypeEnabledInternal(Consensus::LLMQType llmqType, gsl::not_null<const CBlockIndex*> pindexPrev, std::optional<bool> optDIP0024IsActive, std::optional<bool> optHaveDIP0024Quorums);
bool IsQuorumTypeEnabledInternal(Consensus::LLMQType llmqType, gsl::not_null<const CBlockIndex*> pindexPrev,
std::optional<bool> optHaveDIP0024Quorums);

std::vector<Consensus::LLMQType> GetEnabledQuorumTypes(gsl::not_null<const CBlockIndex*> pindex);
std::vector<std::reference_wrapper<const Consensus::LLMQParams>> GetEnabledQuorumParams(gsl::not_null<const CBlockIndex*> pindex);
Expand Down
20 changes: 8 additions & 12 deletions src/test/evo_utils_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,14 @@ void Test(NodeContext& node)
using namespace llmq;
auto tip = node.chainman->ActiveTip();
const auto& consensus_params = Params().GetConsensus();
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeDIP0024InstantSend, tip, false, false), false);
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeDIP0024InstantSend, tip, true, false), true);
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeDIP0024InstantSend, tip, true, true), true);
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeChainLocks, tip, false, false), true);
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeChainLocks, tip, true, false), true);
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeChainLocks, tip, true, true), true);
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypePlatform, tip, false, false), Params().IsTestChain());
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypePlatform, tip, true, false), Params().IsTestChain());
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypePlatform, tip, true, true), Params().IsTestChain());
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeMnhf, tip, false, false), true);
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeMnhf, tip, true, false), true);
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeMnhf, tip, true, true), true);
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeDIP0024InstantSend, tip, false), false);
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeDIP0024InstantSend, tip, true), true);
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeChainLocks, tip, false), true);
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeChainLocks, tip, true), true);
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypePlatform, tip, false), Params().IsTestChain());
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypePlatform, tip, true), Params().IsTestChain());
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeMnhf, tip, false), true);
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeMnhf, tip, true), true);
}

BOOST_FIXTURE_TEST_CASE(utils_IsQuorumTypeEnabled_tests_regtest, RegTestingSetup)
Expand Down
Loading

0 comments on commit 977048f

Please sign in to comment.