Skip to content

Commit 977048f

Browse files
Merge #6325: feat: start DIP0024 from block 1 - fire up test chains by 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
2 parents bf22090 + 906c2d7 commit 977048f

18 files changed

+116
-148
lines changed

doc/release-notes-6325.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Tests
2+
-----
3+
4+
- Command line arguments -dip8params, -bip147height are removed in favour of -testactivationheight. (dash#6325)

src/chainparams.cpp

Lines changed: 6 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ class CMainParams : public CChainParams {
189189
consensus.DIP0008Height = 1088640; // 00000000000000112e41e4b3afda8b233b8cc07c532d2eac5de097b68358c43e
190190
consensus.BRRHeight = 1374912; // 000000000000000c5a124f3eccfbe6e17876dca79cec9e63dfa70d269113c926
191191
consensus.DIP0020Height = 1516032; // 000000000000000f64ed3bd9af1078177ac026f6aa2677aa4d8beeae43be56cc
192-
consensus.DIP0024Height = 1737792; // 0000000000000001342be9c0b75ad40c276beaad91616423c4d9cb101b3db438
193192
consensus.DIP0024QuorumsHeight = 1738698; // 000000000000001aa25181e4c466e593992c98f9eb21c69ee757b8bb0af50244
194193
consensus.V19Height = 1899072; // 0000000000000015e32e73052d663626327004c81c5c22cb8b42c361015c0eae
195194
consensus.V20Height = 1987776; // 000000000000001bf41cff06b76780050682ca29e61a91c391893d4745579777
@@ -387,7 +386,6 @@ class CTestNetParams : public CChainParams {
387386
consensus.DIP0008Height = 78800; // 000000000e9329d964d80e7dab2e704b43b6bd2b91fea1e9315d38932e55fb55
388387
consensus.BRRHeight = 387500; // 0000001537dbfd09dea69f61c1f8b2afa27c8dc91c934e144797761c9f10367b
389388
consensus.DIP0020Height = 414100; // 000000cf961868662fbfbb5d1af6f1caa1809f6a4e390efe5f8cd3031adea668
390-
consensus.DIP0024Height = 769700; // 0000008d84e4efd890ae95c70a7a6126a70a80e5c19e4cb264a5b3469aeef172
391389
consensus.DIP0024QuorumsHeight = 770730; // 0000003c43b3ae7fffe61278ca5537a0e256ebf4d709d45f0ab040271074d51e
392390
consensus.V19Height = 850100; // 000004728b8ff2a16b9d4eebb0fd61eeffadc9c7fe4b0ec0b5a739869401ab5b
393391
consensus.V20Height = 905100; // 0000020c5e0f86f385cbf8e90210de9a9fd63633f01433bf47a6b3227a2851fd
@@ -560,12 +558,11 @@ class CDevNetParams : public CChainParams {
560558
consensus.DIP0008Height = 2; // DIP0008 activated immediately on devnet
561559
consensus.BRRHeight = 2; // BRR (realloc) activated immediately on devnet
562560
consensus.DIP0020Height = 2; // DIP0020 activated immediately on devnet
563-
consensus.DIP0024Height = 2; // DIP0024 activated immediately on devnet
564561
consensus.DIP0024QuorumsHeight = 2; // DIP0024 activated immediately on devnet
565562
consensus.V19Height = 2; // V19 activated immediately on devnet
566563
consensus.V20Height = 2; // V20 activated immediately on devnet
567564
consensus.MN_RRHeight = 2; // MN_RR activated immediately on devnet
568-
consensus.MinBIP9WarningHeight = 2 + 2016; // v19 activation height + miner confirmation window
565+
consensus.MinBIP9WarningHeight = 2 + 2016; // mn_rr activation height + miner confirmation window
569566
consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 1
570567
consensus.nPowTargetTimespan = 24 * 60 * 60; // Dash: 1 day
571568
consensus.nPowTargetSpacing = 2.5 * 60; // Dash: 2.5 minutes
@@ -790,14 +787,14 @@ class CRegTestParams : public CChainParams {
790787
consensus.BIP147Height = 1; // Always active unless overridden
791788
consensus.CSVHeight = 1; // Always active unless overridden
792789
consensus.DIP0001Height = 1; // Always active unless overridden
793-
consensus.DIP0003Height = 432;
790+
consensus.DIP0003Height = 432; // Always active for DashTestFramework in functional tests (see dip3params)
791+
// For unit tests and for BitcoinTestFramework is disabled due to missing quorum commitment for blocks created by helpers such as create_blocks
794792
consensus.DIP0003EnforcementHeight = 500;
795793
consensus.DIP0003EnforcementHash = uint256();
796794
consensus.DIP0008Height = 1; // Always active unless overridden
797795
consensus.BRRHeight = 1; // Always active unless overridden
798796
consensus.DIP0020Height = 1; // Always active unless overridden
799-
consensus.DIP0024Height = 900;
800-
consensus.DIP0024QuorumsHeight = 900;
797+
consensus.DIP0024QuorumsHeight = 1; // Always have dip0024 quorums unless overridden
801798
consensus.V19Height = 900;
802799
consensus.V20Height = 900;
803800
consensus.MN_RRHeight = 900;
@@ -845,8 +842,6 @@ class CRegTestParams : public CChainParams {
845842

846843
UpdateActivationParametersFromArgs(args);
847844
UpdateDIP3ParametersFromArgs(args);
848-
UpdateDIP8ParametersFromArgs(args);
849-
UpdateBIP147ParametersFromArgs(args);
850845
UpdateBudgetParametersFromArgs(args);
851846

852847
genesis = CreateGenesisBlock(1417713337, 1096447, 0x207fffff, 1, 50 * COIN);
@@ -965,21 +960,6 @@ class CRegTestParams : public CChainParams {
965960
}
966961
void UpdateDIP3ParametersFromArgs(const ArgsManager& args);
967962

968-
/**
969-
* Allows modifying the DIP8 activation height
970-
*/
971-
void UpdateDIP8Parameters(int nActivationHeight)
972-
{
973-
consensus.DIP0008Height = nActivationHeight;
974-
}
975-
void UpdateDIP8ParametersFromArgs(const ArgsManager& args);
976-
977-
void UpdateBIP147Parameters(int nActivationHeight)
978-
{
979-
consensus.BIP147Height = nActivationHeight;
980-
}
981-
void UpdateBIP147ParametersFromArgs(const ArgsManager& args);
982-
983963
/**
984964
* Allows modifying the budget regtest parameters.
985965
*/
@@ -1045,6 +1025,8 @@ static void MaybeUpdateHeights(const ArgsManager& args, Consensus::Params& conse
10451025
consensus.DIP0001Height = int{height};
10461026
} else if (name == "dip0008") {
10471027
consensus.DIP0008Height = int{height};
1028+
} else if (name == "dip0024") {
1029+
consensus.DIP0024QuorumsHeight = int{height};
10481030
} else if (name == "v20") {
10491031
consensus.V20Height = int{height};
10501032
} else if (name == "mn_rr") {
@@ -1136,35 +1118,6 @@ void CRegTestParams::UpdateDIP3ParametersFromArgs(const ArgsManager& args)
11361118
UpdateDIP3Parameters(nDIP3ActivationHeight, nDIP3EnforcementHeight);
11371119
}
11381120

1139-
void CRegTestParams::UpdateDIP8ParametersFromArgs(const ArgsManager& args)
1140-
{
1141-
if (!args.IsArgSet("-dip8params")) return;
1142-
1143-
std::string strParams = args.GetArg("-dip8params", "");
1144-
std::vector<std::string> vParams = SplitString(strParams, ':');
1145-
if (vParams.size() != 1) {
1146-
throw std::runtime_error("DIP8 parameters malformed, expecting <activation>");
1147-
}
1148-
int nDIP8ActivationHeight;
1149-
if (!ParseInt32(vParams[0], &nDIP8ActivationHeight)) {
1150-
throw std::runtime_error(strprintf("Invalid activation height (%s)", vParams[0]));
1151-
}
1152-
LogPrintf("Setting DIP8 parameters to activation=%ld\n", nDIP8ActivationHeight);
1153-
UpdateDIP8Parameters(nDIP8ActivationHeight);
1154-
}
1155-
1156-
void CRegTestParams::UpdateBIP147ParametersFromArgs(const ArgsManager& args)
1157-
{
1158-
if (!args.IsArgSet("-bip147height")) return;
1159-
int nBIP147Height;
1160-
const std::string strParams = args.GetArg("-bip147height", "");
1161-
if (!ParseInt32(strParams, &nBIP147Height)) {
1162-
throw std::runtime_error(strprintf("Invalid activation height (%s)", strParams));
1163-
}
1164-
LogPrintf("Setting BIP147 parameters to activation=%lld\n", nBIP147Height);
1165-
UpdateBIP147Parameters(nBIP147Height);
1166-
}
1167-
11681121
void CRegTestParams::UpdateBudgetParametersFromArgs(const ArgsManager& args)
11691122
{
11701123
if (!args.IsArgSet("-budgetparams")) return;

src/chainparamsbase.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ void SetupChainParamsBaseOptions(ArgsManager& argsman)
2020
argsman.AddArg("-budgetparams=<masternode>:<budget>:<superblock>", "Override masternode, budget and superblock start heights (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
2121
argsman.AddArg("-devnet=<name>", "Use devnet chain with provided name", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
2222
argsman.AddArg("-dip3params=<activation>:<enforcement>", "Override DIP3 activation and enforcement heights (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
23-
argsman.AddArg("-dip8params=<activation>", "Override DIP8 activation height (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
24-
argsman.AddArg("-bip147height=<activation>", "Override BIP147 activation height (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
25-
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);
23+
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);
2624
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);
2725
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);
2826
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);

src/consensus/params.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ struct Params {
137137
int BRRHeight;
138138
/** Block height at which DIP0020, DIP0021 and LLMQ_100_67 quorums become active */
139139
int DIP0020Height;
140-
/** Block height at which DIP0024 (Quorum Rotation) and decreased governance proposal fee becomes active */
141-
int DIP0024Height;
142140
/** Block height at which the first DIP0024 quorum was mined */
143141
int DIP0024QuorumsHeight;
144142
/** Block height at which V19 (Basic BLS and EvoNodes) becomes active */
@@ -205,7 +203,7 @@ struct Params {
205203
case DEPLOYMENT_DIP0020:
206204
return DIP0020Height;
207205
case DEPLOYMENT_DIP0024:
208-
return DIP0024Height;
206+
return DIP0024QuorumsHeight;
209207
case DEPLOYMENT_BRR:
210208
return BRRHeight;
211209
case DEPLOYMENT_V19:

src/evo/creditpool.cpp

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,24 +112,29 @@ void CCreditPoolManager::AddToCache(const uint256& block_hash, int height, const
112112
}
113113
}
114114

115-
static std::optional<CBlock> GetBlockForCreditPool(const CBlockIndex* const block_index, const Consensus::Params& consensusParams)
115+
static std::optional<CBlock> GetBlockForCreditPool(const gsl::not_null<const CBlockIndex*> block_index,
116+
const Consensus::Params& consensusParams)
116117
{
118+
// There's no CbTx before DIP0003 activation
119+
if (!DeploymentActiveAt(*block_index, Params().GetConsensus(), Consensus::DEPLOYMENT_DIP0003)) {
120+
return std::nullopt;
121+
}
122+
117123
CBlock block;
118124
if (!ReadBlockFromDisk(block, block_index, consensusParams)) {
119125
throw std::runtime_error("failed-getcbforblock-read");
120126
}
121127

122-
assert(!block.vtx.empty());
123-
124-
// Should not fail if V20 (DIP0027) is active but it happens for RegChain (unit tests)
125-
if (!block.vtx[0]->IsSpecialTxVersion()) return std::nullopt;
126-
127-
assert(!block.vtx[0]->vExtraPayload.empty());
128+
if (block.vtx.empty() || block.vtx[0]->vExtraPayload.empty() || !block.vtx[0]->IsSpecialTxVersion()) {
129+
LogPrintf("%s: ERROR: empty CbTx for CreditPool at height=%d\n", __func__, block_index->nHeight);
130+
return std::nullopt;
131+
}
128132

129133
return block;
130134
}
131135

132-
CCreditPool CCreditPoolManager::ConstructCreditPool(const CBlockIndex* const block_index, CCreditPool prev, const Consensus::Params& consensusParams)
136+
CCreditPool CCreditPoolManager::ConstructCreditPool(const gsl::not_null<const CBlockIndex*> block_index,
137+
CCreditPool prev, const Consensus::Params& consensusParams)
133138
{
134139
std::optional<CBlock> block = GetBlockForCreditPool(block_index, consensusParams);
135140
if (!block) {
@@ -210,7 +215,7 @@ CCreditPool CCreditPoolManager::ConstructCreditPool(const CBlockIndex* const blo
210215

211216
CCreditPool CCreditPoolManager::GetCreditPool(const CBlockIndex* block_index, const Consensus::Params& consensusParams)
212217
{
213-
std::stack<const CBlockIndex *> to_calculate;
218+
std::stack<gsl::not_null<const CBlockIndex*>> to_calculate;
214219

215220
std::optional<CCreditPool> poolTmp;
216221
while (block_index != nullptr && !(poolTmp = GetFromCache(*block_index)).has_value()) {

src/evo/creditpool.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include <evo/assetlocktx.h>
1818

19+
#include <gsl/pointers.h>
1920
#include <optional>
2021
#include <unordered_set>
2122

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

137-
CCreditPool ConstructCreditPool(const CBlockIndex* block_index, CCreditPool prev, const Consensus::Params& consensusParams);
138+
CCreditPool ConstructCreditPool(const gsl::not_null<const CBlockIndex*> block_index, CCreditPool prev,
139+
const Consensus::Params& consensusParams);
138140
};
139141

140142
std::optional<CCreditPoolDiff> GetCreditPoolDiffForBlock(CCreditPoolManager& cpoolman, const BlockManager& blockman, const llmq::CQuorumManager& qman,

src/evo/specialtxman.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,16 +267,20 @@ bool CSpecialTxProcessor::CheckCreditPoolDiffForBlock(const CBlock& block, const
267267

268268
try {
269269
if (!DeploymentActiveAt(*pindex, m_consensus_params, Consensus::DEPLOYMENT_DIP0003)) return true;
270+
if (!DeploymentActiveAt(*pindex, m_consensus_params, Consensus::DEPLOYMENT_DIP0008)) return true;
270271
if (!DeploymentActiveAt(*pindex, m_consensus_params, Consensus::DEPLOYMENT_V20)) return true;
271272

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

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

281285
const auto opt_cbTx = GetTxPayload<CCbTx>(tx);
282286
if (!opt_cbTx) {

src/llmq/options.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,26 +116,26 @@ std::map<Consensus::LLMQType, QvvecSyncMode> GetEnabledQuorumVvecSyncEntries()
116116

117117
bool IsQuorumTypeEnabled(Consensus::LLMQType llmqType, gsl::not_null<const CBlockIndex*> pindexPrev)
118118
{
119-
return IsQuorumTypeEnabledInternal(llmqType, pindexPrev, std::nullopt, std::nullopt);
119+
return IsQuorumTypeEnabledInternal(llmqType, pindexPrev, std::nullopt);
120120
}
121121

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

127-
const bool fDIP0024IsActive{optDIP0024IsActive.value_or(DeploymentActiveAfter(pindexPrev, consensusParams, Consensus::DEPLOYMENT_DIP0024))};
128-
const bool fHaveDIP0024Quorums{optHaveDIP0024Quorums.value_or(pindexPrev->nHeight >= consensusParams.DIP0024QuorumsHeight)};
127+
const bool fDIP0024IsActive{
128+
optIsDIP0024Active.value_or(DeploymentActiveAfter(pindexPrev, consensusParams, Consensus::DEPLOYMENT_DIP0024))};
129129
switch (llmqType)
130130
{
131131
case Consensus::LLMQType::LLMQ_DEVNET:
132132
return true;
133133
case Consensus::LLMQType::LLMQ_50_60:
134-
return !fDIP0024IsActive || !fHaveDIP0024Quorums || Params().NetworkIDString() == CBaseChainParams::TESTNET ||
134+
return !fDIP0024IsActive || Params().NetworkIDString() == CBaseChainParams::TESTNET ||
135135
Params().NetworkIDString() == CBaseChainParams::DEVNET;
136136
case Consensus::LLMQType::LLMQ_TEST_INSTANTSEND:
137-
return !fDIP0024IsActive || !fHaveDIP0024Quorums ||
138-
consensusParams.llmqTypeDIP0024InstantSend == Consensus::LLMQType::LLMQ_TEST_INSTANTSEND;
137+
return !fDIP0024IsActive ||
138+
consensusParams.llmqTypeDIP0024InstantSend == Consensus::LLMQType::LLMQ_TEST_INSTANTSEND;
139139
case Consensus::LLMQType::LLMQ_TEST:
140140
case Consensus::LLMQType::LLMQ_TEST_PLATFORM:
141141
case Consensus::LLMQType::LLMQ_400_60:

src/llmq/options.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ bool IsWatchQuorumsEnabled();
4444
std::map<Consensus::LLMQType, QvvecSyncMode> GetEnabledQuorumVvecSyncEntries();
4545

4646
bool IsQuorumTypeEnabled(Consensus::LLMQType llmqType, gsl::not_null<const CBlockIndex*> pindexPrev);
47-
bool IsQuorumTypeEnabledInternal(Consensus::LLMQType llmqType, gsl::not_null<const CBlockIndex*> pindexPrev, std::optional<bool> optDIP0024IsActive, std::optional<bool> optHaveDIP0024Quorums);
47+
bool IsQuorumTypeEnabledInternal(Consensus::LLMQType llmqType, gsl::not_null<const CBlockIndex*> pindexPrev,
48+
std::optional<bool> optHaveDIP0024Quorums);
4849

4950
std::vector<Consensus::LLMQType> GetEnabledQuorumTypes(gsl::not_null<const CBlockIndex*> pindex);
5051
std::vector<std::reference_wrapper<const Consensus::LLMQParams>> GetEnabledQuorumParams(gsl::not_null<const CBlockIndex*> pindex);

src/test/evo_utils_tests.cpp

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,14 @@ void Test(NodeContext& node)
2121
using namespace llmq;
2222
auto tip = node.chainman->ActiveTip();
2323
const auto& consensus_params = Params().GetConsensus();
24-
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeDIP0024InstantSend, tip, false, false), false);
25-
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeDIP0024InstantSend, tip, true, false), true);
26-
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeDIP0024InstantSend, tip, true, true), true);
27-
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeChainLocks, tip, false, false), true);
28-
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeChainLocks, tip, true, false), true);
29-
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeChainLocks, tip, true, true), true);
30-
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypePlatform, tip, false, false), Params().IsTestChain());
31-
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypePlatform, tip, true, false), Params().IsTestChain());
32-
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypePlatform, tip, true, true), Params().IsTestChain());
33-
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeMnhf, tip, false, false), true);
34-
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeMnhf, tip, true, false), true);
35-
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeMnhf, tip, true, true), true);
24+
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeDIP0024InstantSend, tip, false), false);
25+
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeDIP0024InstantSend, tip, true), true);
26+
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeChainLocks, tip, false), true);
27+
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeChainLocks, tip, true), true);
28+
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypePlatform, tip, false), Params().IsTestChain());
29+
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypePlatform, tip, true), Params().IsTestChain());
30+
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeMnhf, tip, false), true);
31+
BOOST_CHECK_EQUAL(IsQuorumTypeEnabledInternal(consensus_params.llmqTypeMnhf, tip, true), true);
3632
}
3733

3834
BOOST_FIXTURE_TEST_CASE(utils_IsQuorumTypeEnabled_tests_regtest, RegTestingSetup)

0 commit comments

Comments
 (0)