diff --git a/src/governance/governance.cpp b/src/governance/governance.cpp index 038f33bf5869..43cdc2d46c0f 100644 --- a/src/governance/governance.cpp +++ b/src/governance/governance.cpp @@ -1303,3 +1303,8 @@ void CGovernanceManager::RemoveInvalidVotes() // store current MN list for the next run so that we can determine which keys changed lastMNListForVotingKeys = curMNList; } + +bool AreSuperblocksEnabled() +{ + return gArgs.GetBoolArg("-enablesuperblocks", DEFAULT_ENABLE_SUPERBLOCKS); +} diff --git a/src/governance/governance.h b/src/governance/governance.h index a85d57daa5b8..80e19967ed5d 100644 --- a/src/governance/governance.h +++ b/src/governance/governance.h @@ -40,6 +40,8 @@ typedef std::pair object_info_pair_t; static const int RATE_BUFFER_SIZE = 5; +static const bool DEFAULT_ENABLE_SUPERBLOCKS = true; + class CRateCheckBuffer { private: @@ -432,4 +434,6 @@ class CGovernanceManager }; +bool AreSuperblocksEnabled(); + #endif // BITCOIN_GOVERNANCE_GOVERNANCE_H diff --git a/src/init.cpp b/src/init.cpp index f0c7dc09c7c8..eb0a18319fda 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -61,8 +61,10 @@ #include #include -#include #include +#include +#include +#include #include #include @@ -585,7 +587,6 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-debug=", strprintf(_("Output debugging information (default: %u, supplying is optional)"), 0) + ". " + _("If is not supplied or if = 1, output all debugging information.") + " " + _(" can be:") + " " + ListLogCategories() + "."); strUsage += HelpMessageOpt("-debugexclude=", strprintf(_("Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories."))); - strUsage += HelpMessageOpt("-disablegovernance", strprintf(_("Disable governance validation (0-1, default: %u)"), 0)); strUsage += HelpMessageOpt("-help-debug", _("Show all debugging options (usage: --help -help-debug)")); strUsage += HelpMessageOpt("-logips", strprintf(_("Include IP addresses in debug output (default: %u)"), DEFAULT_LOGIPS)); if (showDebug) @@ -615,9 +616,17 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-masternodeblsprivkey=", _("Set the masternode BLS private key and enable the client to act as a masternode")); strUsage += HelpMessageOpt("-platform-user=", _("Set the username for the \"platform user\", a restricted user intended to be used by Dash Platform, to the specified username.")); + strUsage += HelpMessageGroup(_("ChainLocks options:")); + strUsage += HelpMessageOpt("-enablechainlocks", strprintf(_("Enable use of ChainLocks (default: %u)"), DEFAULT_ENABLE_CHAINLOCKS)); + strUsage += HelpMessageGroup(_("InstantSend options:")); strUsage += HelpMessageOpt("-instantsendnotify=", _("Execute command when a wallet InstantSend transaction is successfully locked (%s in cmd is replaced by TxID)")); + strUsage += HelpMessageOpt("-enableinstantsend", strprintf(_("Enable use of InstantSend (default: %u)"), DEFAULT_ENABLE_INSTANTSEND)); + strUsage += HelpMessageOpt("-rejectconflictingblocks", strprintf(_("Reject blocks containing txes that conflict with ones locked via InstantSend (default: %u)"), DEFAULT_REJECT_CONFLICTING_BLOCKS)); + strUsage += HelpMessageGroup(_("Goverenance options:")); + strUsage += HelpMessageOpt("-enablesuperblocks", strprintf(_("Allow Superblocks to be produced at predefined intervals (default: %u)"), DEFAULT_ENABLE_SUPERBLOCKS)); + strUsage += HelpMessageOpt("-disablegovernance", strprintf(_("Disable governance validation (0-1, default: %u)"), 0)); strUsage += HelpMessageGroup(_("Node relay options:")); if (showDebug) { diff --git a/src/llmq/quorums_chainlocks.cpp b/src/llmq/quorums_chainlocks.cpp index edbe36e92755..fbf7a2505594 100644 --- a/src/llmq/quorums_chainlocks.cpp +++ b/src/llmq/quorums_chainlocks.cpp @@ -90,7 +90,7 @@ CChainLockSig CChainLocksHandler::GetBestChainLock() void CChainLocksHandler::ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vRecv, CConnman& connman) { - if (!sporkManager.IsSporkActive(SPORK_19_CHAINLOCKS_ENABLED)) { + if (!AreChainLocksEnabled()) { return; } @@ -230,8 +230,8 @@ void CChainLocksHandler::CheckActiveState() LOCK(cs); bool oldIsEnforced = isEnforced; - isSporkActive = sporkManager.IsSporkActive(SPORK_19_CHAINLOCKS_ENABLED); - isEnforced = (fDIP0008Active && isSporkActive); + isEnabled = AreChainLocksEnabled(); + isEnforced = (fDIP0008Active && isEnabled); if (!oldIsEnforced && isEnforced) { // ChainLocks got activated just recently, but it's possible that it was already running before, leaving @@ -273,7 +273,7 @@ void CChainLocksHandler::TrySignChainTip() { LOCK(cs); - if (!isSporkActive) { + if (!isEnabled) { return; } @@ -300,7 +300,7 @@ void CChainLocksHandler::TrySignChainTip() // considered safe when it is islocked or at least known since 10 minutes (from mempool or block). These checks are // performed for the tip (which we try to sign) and the previous 5 blocks. If a ChainLocked block is found on the // way down, we consider all TXs to be safe. - if (IsInstantSendEnabled() && sporkManager.IsSporkActive(SPORK_3_INSTANTSEND_BLOCK_FILTERING)) { + if (IsInstantSendEnabled() && RejectConflictingBlocks()) { auto pindexWalk = pindex; while (pindexWalk) { if (pindex->nHeight - pindexWalk->nHeight > 5) { @@ -459,7 +459,7 @@ CChainLocksHandler::BlockTxs::mapped_type CChainLocksHandler::GetBlockTxs(const bool CChainLocksHandler::IsTxSafeForMining(const uint256& txid) { - if (!sporkManager.IsSporkActive(SPORK_3_INSTANTSEND_BLOCK_FILTERING)) { + if (!RejectConflictingBlocks()) { return true; } if (!IsInstantSendEnabled()) { @@ -469,7 +469,7 @@ bool CChainLocksHandler::IsTxSafeForMining(const uint256& txid) int64_t txAge = 0; { LOCK(cs); - if (!isSporkActive || !isEnforced) { + if (!isEnabled || !isEnforced) { return true; } auto it = txFirstSeenTime.find(txid); @@ -568,7 +568,7 @@ void CChainLocksHandler::HandleNewRecoveredSig(const llmq::CRecoveredSig& recove { LOCK(cs); - if (!isSporkActive) { + if (!isEnabled) { return; } @@ -727,4 +727,9 @@ void CChainLocksHandler::Cleanup() lastCleanupTime = GetTimeMillis(); } +bool AreChainLocksEnabled() +{ + return gArgs.GetBoolArg("-enablechainlocks", DEFAULT_ENABLE_CHAINLOCKS); +} + } // namespace llmq diff --git a/src/llmq/quorums_chainlocks.h b/src/llmq/quorums_chainlocks.h index a10b3bc414b9..783b1abdf871 100644 --- a/src/llmq/quorums_chainlocks.h +++ b/src/llmq/quorums_chainlocks.h @@ -19,6 +19,8 @@ class CBlockIndex; class CScheduler; +static const bool DEFAULT_ENABLE_CHAINLOCKS = true; + namespace llmq { @@ -57,7 +59,7 @@ class CChainLocksHandler : public CRecoveredSigsListener boost::thread* scheduler_thread; CCriticalSection cs; bool tryLockChainTipScheduled{false}; - bool isSporkActive{false}; + bool isEnabled{false}; bool isEnforced{false}; uint256 bestChainLockHash; @@ -122,6 +124,7 @@ class CChainLocksHandler : public CRecoveredSigsListener extern CChainLocksHandler* chainLocksHandler; +bool AreChainLocksEnabled(); } // namespace llmq diff --git a/src/llmq/quorums_instantsend.cpp b/src/llmq/quorums_instantsend.cpp index acd87816ad41..a5435f5c204c 100644 --- a/src/llmq/quorums_instantsend.cpp +++ b/src/llmq/quorums_instantsend.cpp @@ -1142,7 +1142,7 @@ void CInstantSendManager::UpdatedBlockTip(const CBlockIndex* pindexNew) // TODO remove this after DIP8 has activated bool fDIP0008Active = VersionBitsState(pindexNew->pprev, Params().GetConsensus(), Consensus::DEPLOYMENT_DIP0008, versionbitscache) == ThresholdState::ACTIVE; - if (sporkManager.IsSporkActive(SPORK_19_CHAINLOCKS_ENABLED) && fDIP0008Active) { + if (AreChainLocksEnabled() && fDIP0008Active) { // Nothing to do here. We should keep all islocks and let chainlocks handle them. return; } @@ -1519,7 +1519,12 @@ void CInstantSendManager::WorkThreadMain() bool IsInstantSendEnabled() { - return sporkManager.IsSporkActive(SPORK_2_INSTANTSEND_ENABLED); + return gArgs.GetBoolArg("-enableinstantsend", DEFAULT_ENABLE_INSTANTSEND); +} + +bool RejectConflictingBlocks() +{ + return gArgs.GetBoolArg("-rejectconflictingblocks", DEFAULT_REJECT_CONFLICTING_BLOCKS); } } // namespace llmq diff --git a/src/llmq/quorums_instantsend.h b/src/llmq/quorums_instantsend.h index b0dad34ae5a2..42af72e9bb16 100644 --- a/src/llmq/quorums_instantsend.h +++ b/src/llmq/quorums_instantsend.h @@ -14,6 +14,9 @@ #include #include +static const bool DEFAULT_ENABLE_INSTANTSEND = true; +static const bool DEFAULT_REJECT_CONFLICTING_BLOCKS = true; + namespace llmq { @@ -174,6 +177,7 @@ class CInstantSendManager : public CRecoveredSigsListener extern CInstantSendManager* quorumInstantSendManager; bool IsInstantSendEnabled(); +bool RejectConflictingBlocks(); } // namespace llmq diff --git a/src/masternode/masternode-payments.cpp b/src/masternode/masternode-payments.cpp index e64935e39f11..68de30ec1be0 100644 --- a/src/masternode/masternode-payments.cpp +++ b/src/masternode/masternode-payments.cpp @@ -119,9 +119,8 @@ bool IsBlockValueValid(const CBlock& block, int nBlockHeight, CAmount blockRewar // we are synced and possibly on a superblock now - if (!sporkManager.IsSporkActive(SPORK_9_SUPERBLOCKS_ENABLED)) { - // should NOT allow superblocks at all, when superblocks are disabled - // revert to block reward limits in this case + if (!AreSuperblocksEnabled()) { + // should NOT allow superblocks at all, revert to block reward limits in this case LogPrint(BCLog::GOBJECT, "%s -- Superblocks are disabled, no superblocks allowed\n", __func__); if(!isBlockRewardValueMet) { strErrorRet = strprintf("coinbase pays too much at height %d (actual=%d vs limit=%d), exceeded block reward, superblocks are disabled", @@ -177,7 +176,7 @@ bool IsBlockPayeeValid(const CTransaction& txNew, int nBlockHeight, CAmount bloc // superblocks started // SEE IF THIS IS A VALID SUPERBLOCK - if(sporkManager.IsSporkActive(SPORK_9_SUPERBLOCKS_ENABLED)) { + if(AreSuperblocksEnabled()) { if(CSuperblockManager::IsSuperblockTriggered(nBlockHeight)) { if(CSuperblockManager::IsValid(txNew, nBlockHeight, blockReward)) { LogPrint(BCLog::GOBJECT, "%s -- Valid superblock at height %d: %s", __func__, nBlockHeight, txNew.ToString()); /* Continued */ @@ -191,7 +190,7 @@ bool IsBlockPayeeValid(const CTransaction& txNew, int nBlockHeight, CAmount bloc LogPrint(BCLog::GOBJECT, "%s -- No triggered superblock detected at height %d\n", __func__, nBlockHeight); } } else { - // should NOT allow superblocks at all, when superblocks are disabled + // should NOT allow superblocks at all LogPrint(BCLog::GOBJECT, "%s -- Superblocks are disabled, no superblocks allowed\n", __func__); } @@ -207,12 +206,11 @@ bool IsBlockPayeeValid(const CTransaction& txNew, int nBlockHeight, CAmount bloc void FillBlockPayments(CMutableTransaction& txNew, int nBlockHeight, CAmount blockReward, std::vector& voutMasternodePaymentsRet, std::vector& voutSuperblockPaymentsRet) { - // only create superblocks if spork is enabled AND if superblock is actually triggered + // only create superblocks if they are allowed AND if superblock is actually triggered // (height should be validated inside) - if(sporkManager.IsSporkActive(SPORK_9_SUPERBLOCKS_ENABLED) && - CSuperblockManager::IsSuperblockTriggered(nBlockHeight)) { - LogPrint(BCLog::GOBJECT, "%s -- triggered superblock creation at height %d\n", __func__, nBlockHeight); - CSuperblockManager::GetSuperblockPayments(nBlockHeight, voutSuperblockPaymentsRet); + if(AreSuperblocksEnabled() && CSuperblockManager::IsSuperblockTriggered(nBlockHeight)) { + LogPrint(BCLog::GOBJECT, "%s -- triggered superblock creation at height %d\n", __func__, nBlockHeight); + CSuperblockManager::GetSuperblockPayments(nBlockHeight, voutSuperblockPaymentsRet); } if (!CMasternodePayments::GetMasternodeTxOuts(nBlockHeight, blockReward, voutMasternodePaymentsRet)) { diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 6adced15b0b6..530c265e88fb 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -472,7 +472,7 @@ UniValue getblocktemplate(const JSONRPCRequest& request) mnpayments.GetBlockTxOuts(chainActive.Height() + 1, 0, voutMasternodePayments); // next bock is a superblock and we need governance info to correctly construct it - if (sporkManager.IsSporkActive(SPORK_9_SUPERBLOCKS_ENABLED) + if (AreSuperblocksEnabled() && !masternodeSync.IsSynced() && CSuperblock::IsValidBlockHeight(chainActive.Height() + 1)) throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Dash Core is syncing with network..."); @@ -704,7 +704,7 @@ UniValue getblocktemplate(const JSONRPCRequest& request) } result.pushKV("superblock", superblockObjArray); result.pushKV("superblocks_started", pindexPrev->nHeight + 1 > consensusParams.nSuperblockStartBlock); - result.pushKV("superblocks_enabled", sporkManager.IsSporkActive(SPORK_9_SUPERBLOCKS_ENABLED)); + result.pushKV("superblocks_enabled", AreSuperblocksEnabled()); result.pushKV("coinbase_payload", HexStr(pblock->vtx[0]->vExtraPayload)); diff --git a/src/spork.cpp b/src/spork.cpp index 9bff991fa761..fe3693852af1 100644 --- a/src/spork.cpp +++ b/src/spork.cpp @@ -17,11 +17,7 @@ const std::string CSporkManager::SERIALIZATION_VERSION_STRING = "CSporkManager-V #define MAKE_SPORK_DEF(name, defaultValue) CSporkDef{name, defaultValue, #name} std::vector sporkDefs = { - MAKE_SPORK_DEF(SPORK_2_INSTANTSEND_ENABLED, 4070908800ULL), // OFF - MAKE_SPORK_DEF(SPORK_3_INSTANTSEND_BLOCK_FILTERING, 4070908800ULL), // OFF - MAKE_SPORK_DEF(SPORK_9_SUPERBLOCKS_ENABLED, 4070908800ULL), // OFF MAKE_SPORK_DEF(SPORK_17_QUORUM_DKG_ENABLED, 4070908800ULL), // OFF - MAKE_SPORK_DEF(SPORK_19_CHAINLOCKS_ENABLED, 4070908800ULL), // OFF MAKE_SPORK_DEF(SPORK_21_QUORUM_ALL_CONNECTED, 4070908800ULL), // OFF MAKE_SPORK_DEF(SPORK_22_PS_MORE_PARTICIPANTS, 4070908800ULL), // OFF }; diff --git a/src/spork.h b/src/spork.h index 53079e534525..48476fd87242 100644 --- a/src/spork.h +++ b/src/spork.h @@ -21,11 +21,7 @@ class CSporkManager; - This would result in old clients getting confused about which spork is for what */ enum SporkId : int32_t { - SPORK_2_INSTANTSEND_ENABLED = 10001, - SPORK_3_INSTANTSEND_BLOCK_FILTERING = 10002, - SPORK_9_SUPERBLOCKS_ENABLED = 10008, SPORK_17_QUORUM_DKG_ENABLED = 10016, - SPORK_19_CHAINLOCKS_ENABLED = 10018, SPORK_21_QUORUM_ALL_CONNECTED = 10020, SPORK_22_PS_MORE_PARTICIPANTS = 10021, diff --git a/src/validation.cpp b/src/validation.cpp index abba6062b119..031445a42d13 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2313,7 +2313,7 @@ bool CChainState::ConnectBlock(const CBlock& block, CValidationState& state, CBl // DASH : CHECK TRANSACTIONS FOR INSTANTSEND - if (sporkManager.IsSporkActive(SPORK_3_INSTANTSEND_BLOCK_FILTERING)) { + if (llmq::RejectConflictingBlocks()) { // Require other nodes to comply, send them some data in case they are missing it. for (const auto& tx : block.vtx) { // skip txes that have no inputs diff --git a/test/functional/feature_dip4_coinbasemerkleroots.py b/test/functional/feature_dip4_coinbasemerkleroots.py index 1e99281f67bd..8eda65b80e07 100755 --- a/test/functional/feature_dip4_coinbasemerkleroots.py +++ b/test/functional/feature_dip4_coinbasemerkleroots.py @@ -36,8 +36,9 @@ def getmnlistdiff(self, baseBlockHash, blockHash): class LLMQCoinbaseCommitmentsTest(DashTestFramework): def set_test_params(self): - self.set_dash_test_params(4, 3, fast_dip3_enforcement=True) - self.set_dash_dip8_activation(200) + # Note: Have to disable ChainLocks because they won't let you to invalidate already locked blocks. + # Do this for the whole test to avoid restarting all nodes twice while running it. + self.set_dash_test_params(4, 3, [["-enablechainlocks=0"]] * 4, fast_dip3_enforcement=True) def run_test(self): self.test_node = self.nodes[0].add_p2p_connection(TestP2PConn()) diff --git a/test/functional/feature_governance_objects.py b/test/functional/feature_governance_objects.py index 2bf4734a5c91..b73765e951c7 100755 --- a/test/functional/feature_governance_objects.py +++ b/test/functional/feature_governance_objects.py @@ -22,7 +22,7 @@ def validate_object(prepared, rpc_prepared): class DashGovernanceTest (DashTestFramework): def set_test_params(self): - self.set_dash_test_params(2, 1) + self.set_dash_test_params(2, 1, fast_dip3_enforcement=True) def prepare_object(self, object_type, parent_hash, creation_time, revision, name, amount): proposal_rev = revision diff --git a/test/functional/feature_llmq_chainlocks.py b/test/functional/feature_llmq_chainlocks.py index 10f1e4a77f1a..cb646da1ad2e 100755 --- a/test/functional/feature_llmq_chainlocks.py +++ b/test/functional/feature_llmq_chainlocks.py @@ -19,7 +19,6 @@ class LLMQChainLocksTest(DashTestFramework): def set_test_params(self): self.set_dash_test_params(4, 3, fast_dip3_enforcement=True) - self.set_dash_dip8_activation(10) def run_test(self): @@ -43,9 +42,6 @@ def run_test(self): for i in range(4): self.mine_quorum() - self.nodes[0].spork("SPORK_19_CHAINLOCKS_ENABLED", 0) - self.wait_for_sporks_same() - self.log.info("Mine single block, wait for chainlock") self.nodes[0].generate(1) self.wait_for_chainlocked_block_all_nodes(self.nodes[0].getbestblockhash()) @@ -106,11 +102,6 @@ def run_test(self): self.wait_for_chainlocked_block(self.nodes[0], self.nodes[1].getbestblockhash()) assert(self.nodes[0].getbestblockhash() == self.nodes[1].getbestblockhash()) - self.log.info("Enable LLMQ bases InstantSend, which also enables checks for \"safe\" transactions") - self.nodes[0].spork("SPORK_2_INSTANTSEND_ENABLED", 0) - self.nodes[0].spork("SPORK_3_INSTANTSEND_BLOCK_FILTERING", 0) - self.wait_for_sporks_same() - self.log.info("Isolate a node and let it create some transactions which won't get IS locked") isolate_node(self.nodes[0]) txs = [] @@ -124,17 +115,18 @@ def run_test(self): assert("confirmations" not in tx) time.sleep(1) assert(not self.nodes[0].getblock(self.nodes[0].getbestblockhash())["chainlock"]) - self.log.info("Disable LLMQ based InstantSend for a very short time (this never gets propagated to other nodes)") - self.nodes[0].spork("SPORK_2_INSTANTSEND_ENABLED", 4070908800) + self.log.info("Restart the node with LLMQ based InstantSend disabled") + self.restart_node(0, self.extra_args[0] + ['-enableinstantsend=0']) self.log.info("Now the TXs should be included") self.nodes[0].generate(1) - self.nodes[0].spork("SPORK_2_INSTANTSEND_ENABLED", 0) self.log.info("Assert that TXs got included now") for txid in txs: tx = self.nodes[0].getrawtransaction(txid, 1) assert("confirmations" in tx and tx["confirmations"] > 0) # Enable network on first node again, which will cause the blocks to propagate and IS locks to happen retroactively # for the mined TXs, which will then allow the network to create a CLSIG + self.log.info("Restart the node with LLMQ based InstantSend enabled") + self.restart_node(0, self.extra_args[0]) self.log.info("Reenable network on first node and wait for chainlock") reconnect_isolated_node(self.nodes[0], 1) self.wait_for_chainlocked_block(self.nodes[0], self.nodes[0].getbestblockhash(), timeout=30) diff --git a/test/functional/feature_llmq_dkgerrors.py b/test/functional/feature_llmq_dkgerrors.py index f07b111609a8..b5ddf0ef9737 100755 --- a/test/functional/feature_llmq_dkgerrors.py +++ b/test/functional/feature_llmq_dkgerrors.py @@ -15,7 +15,6 @@ class LLMQDKGErrors(DashTestFramework): def set_test_params(self): self.set_dash_test_params(4, 3, [["-whitelist=127.0.0.1"]] * 4, fast_dip3_enforcement=True) - self.set_dash_dip8_activation(10) def run_test(self): diff --git a/test/functional/feature_llmq_is_cl_conflicts.py b/test/functional/feature_llmq_is_cl_conflicts.py index 4012fb30bc86..485decc78763 100755 --- a/test/functional/feature_llmq_is_cl_conflicts.py +++ b/test/functional/feature_llmq_is_cl_conflicts.py @@ -48,7 +48,6 @@ def on_getdata(self, message): class LLMQ_IS_CL_Conflicts(DashTestFramework): def set_test_params(self): self.set_dash_test_params(4, 3, fast_dip3_enforcement=True) - self.set_dash_dip8_activation(10) #disable_mocktime() def run_test(self): @@ -62,9 +61,6 @@ def run_test(self): self.nodes[0].p2p.wait_for_verack() self.nodes[0].spork("SPORK_17_QUORUM_DKG_ENABLED", 0) - self.nodes[0].spork("SPORK_19_CHAINLOCKS_ENABLED", 0) - self.nodes[0].spork("SPORK_2_INSTANTSEND_ENABLED", 0) - self.nodes[0].spork("SPORK_3_INSTANTSEND_BLOCK_FILTERING", 0) self.wait_for_sporks_same() self.mine_quorum() diff --git a/test/functional/feature_llmq_is_retroactive.py b/test/functional/feature_llmq_is_retroactive.py index 2c745acf607c..25d595c7d45e 100755 --- a/test/functional/feature_llmq_is_retroactive.py +++ b/test/functional/feature_llmq_is_retroactive.py @@ -22,7 +22,6 @@ def set_test_params(self): # -whitelist is needed to avoid the trickling logic on node0 self.set_dash_test_params(6, 5, [["-whitelist=127.0.0.1"], [], [], [], ["-minrelaytxfee=0.001"], ["-minrelaytxfee=0.001"]], fast_dip3_enforcement=True) self.set_dash_llmq_test_params(5, 3) - self.set_dash_dip8_activation(10) def run_test(self): while self.nodes[0].getblockchaininfo()["bip9_softforks"]["dip0008"]["status"] != "active": @@ -30,9 +29,6 @@ def run_test(self): self.sync_blocks(self.nodes, timeout=60*5) self.nodes[0].spork("SPORK_17_QUORUM_DKG_ENABLED", 0) - self.nodes[0].spork("SPORK_19_CHAINLOCKS_ENABLED", 0) - self.nodes[0].spork("SPORK_2_INSTANTSEND_ENABLED", 0) - self.nodes[0].spork("SPORK_3_INSTANTSEND_BLOCK_FILTERING", 0) self.wait_for_sporks_same() self.mine_quorum() diff --git a/test/functional/feature_llmq_simplepose.py b/test/functional/feature_llmq_simplepose.py index b9a5529d466b..2ead3f655d0f 100755 --- a/test/functional/feature_llmq_simplepose.py +++ b/test/functional/feature_llmq_simplepose.py @@ -17,7 +17,9 @@ class LLMQSimplePoSeTest(DashTestFramework): def set_test_params(self): - self.set_dash_test_params(6, 5, fast_dip3_enforcement=True) + # Note: Have to disable ChainLocks for this test because we have too many + # failing masternodes here and quorums will fail to sign blocks. + self.set_dash_test_params(6, 5, [["-enablechainlocks=0"]] * 6, fast_dip3_enforcement=True) self.set_dash_llmq_test_params(5, 3) def run_test(self): diff --git a/test/functional/feature_multikeysporks.py b/test/functional/feature_multikeysporks.py index 695c08a007cb..51bffc80b8d3 100755 --- a/test/functional/feature_multikeysporks.py +++ b/test/functional/feature_multikeysporks.py @@ -90,12 +90,10 @@ def setup_network(self): def get_test_spork_value(self, node): info = node.spork('show') - # use InstantSend spork for tests - return info['SPORK_2_INSTANTSEND_ENABLED'] + return info['SPORK_17_QUORUM_DKG_ENABLED'] def set_test_spork_value(self, node, value): - # use InstantSend spork for tests - node.spork('SPORK_2_INSTANTSEND_ENABLED', value) + node.spork('SPORK_17_QUORUM_DKG_ENABLED', value) def run_test(self): # check test spork default state diff --git a/test/functional/feature_sporks.py b/test/functional/feature_sporks.py index 13e507c96db1..cadb483af7d1 100755 --- a/test/functional/feature_sporks.py +++ b/test/functional/feature_sporks.py @@ -23,16 +23,14 @@ def setup_network(self): def get_test_spork_state(self, node): info = node.spork('active') - # use InstantSend spork for tests - return info['SPORK_2_INSTANTSEND_ENABLED'] + return info['SPORK_17_QUORUM_DKG_ENABLED'] def set_test_spork_state(self, node, state): if state: value = 0 else: value = 4070908800 - # use InstantSend spork for tests - node.spork('SPORK_2_INSTANTSEND_ENABLED', value) + node.spork('SPORK_17_QUORUM_DKG_ENABLED', value) def run_test(self): spork_default_state = self.get_test_spork_state(self.nodes[0]) diff --git a/test/functional/interface_zmq_dash.py b/test/functional/interface_zmq_dash.py index 320e678f51b1..3daeab2c956b 100755 --- a/test/functional/interface_zmq_dash.py +++ b/test/functional/interface_zmq_dash.py @@ -45,7 +45,6 @@ def set_test_params(self): node0_extra_args.append("-whitelist=127.0.0.1") self.set_dash_test_params(4, 3, fast_dip3_enforcement=True, extra_args=[node0_extra_args, [], [], []]) - self.set_dash_dip8_activation(10) def run_test(self): # Check that dashd has been built with ZMQ enabled. @@ -65,9 +64,7 @@ def run_test(self): while self.nodes[0].getblockchaininfo()["bip9_softforks"]["dip0008"]["status"] != "active": self.nodes[0].generate(10) self.sync_blocks() - self.nodes[0].spork("SPORK_2_INSTANTSEND_ENABLED", 0) self.nodes[0].spork("SPORK_17_QUORUM_DKG_ENABLED", 0) - self.nodes[0].spork("SPORK_19_CHAINLOCKS_ENABLED", 0) self.wait_for_sporks_same() # Create an LLMQ for testing self.quorum_type = 100 # llmq_test diff --git a/test/functional/p2p_instantsend.py b/test/functional/p2p_instantsend.py index 3b45f52eb795..28b0bb13e1a2 100755 --- a/test/functional/p2p_instantsend.py +++ b/test/functional/p2p_instantsend.py @@ -27,10 +27,6 @@ def run_test(self): self.wait_for_sporks_same() self.mine_quorum() - self.nodes[0].spork("SPORK_2_INSTANTSEND_ENABLED", 0) - self.nodes[0].spork("SPORK_3_INSTANTSEND_BLOCK_FILTERING", 0) - self.wait_for_sporks_same() - self.test_mempool_doublespend() self.test_block_doublespend() diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index 0220d80e4586..73cf51d4b0a3 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -526,6 +526,9 @@ def set_dash_test_params(self, num_nodes, masterodes_count, extra_args=None, fas for i in range(0, num_nodes): self.extra_args[i].append("-dip3params=30:50") + # make sure to activate dip8 after prepare_masternodes has finished its job already + self.set_dash_dip8_activation(200) + # LLMQ default test params (no need to pass -llmqtestparams) self.llmq_size = 3 self.llmq_threshold = 2