feat: drop SPORK 24 (EHF) so far as this feature works on testnet / mainnet

This commit is contained in:
Konstantin Akimov 2024-09-19 17:06:47 +07:00
parent da0dc06eea
commit 9a9d0d5b79
No known key found for this signature in database
GPG Key ID: 2176C4A5D01EA524
5 changed files with 16 additions and 37 deletions

View File

@ -44,8 +44,8 @@ LLMQContext::LLMQContext(CChainState& chainstate, CConnman& connman, CDeterminis
llmq::quorumInstantSendManager = std::make_unique<llmq::CInstantSendManager>(*llmq::chainLocksHandler, chainstate, connman, *qman, *sigman, *shareman, sporkman, mempool, mn_sync, peerman, is_masternode, unit_tests, wipe);
return llmq::quorumInstantSendManager.get();
}()},
ehfSignalsHandler{std::make_unique<llmq::CEHFSignalsHandler>(chainstate, mnhfman, *sigman, *shareman, mempool,
*qman, sporkman, peerman)}
ehfSignalsHandler{
std::make_unique<llmq::CEHFSignalsHandler>(chainstate, mnhfman, *sigman, *shareman, mempool, *qman, peerman)}
{
}

View File

@ -16,7 +16,6 @@
#include <index/txindex.h> // g_txindex
#include <net_processing.h>
#include <primitives/transaction.h>
#include <spork.h>
#include <txmempool.h>
#include <validation.h>
@ -25,14 +24,13 @@ namespace llmq {
CEHFSignalsHandler::CEHFSignalsHandler(CChainState& chainstate, CMNHFManager& mnhfman, CSigningManager& sigman,
CSigSharesManager& shareman, CTxMemPool& mempool, const CQuorumManager& qman,
const CSporkManager& sporkman, const std::unique_ptr<PeerManager>& peerman) :
const std::unique_ptr<PeerManager>& peerman) :
chainstate(chainstate),
mnhfman(mnhfman),
sigman(sigman),
shareman(shareman),
mempool(mempool),
qman(qman),
sporkman(sporkman),
m_peerman(peerman)
{
sigman.RegisterRecoveredSigsListener(this);
@ -48,7 +46,7 @@ void CEHFSignalsHandler::UpdatedBlockTip(const CBlockIndex* const pindexNew, boo
{
if (!DeploymentActiveAfter(pindexNew, Params().GetConsensus(), Consensus::DEPLOYMENT_V20)) return;
if (!is_masternode || (Params().IsTestChain() && !sporkman.IsSporkActive(SPORK_24_TEST_EHF))) {
if (!is_masternode) {
return;
}

View File

@ -12,7 +12,6 @@
class CBlockIndex;
class CChainState;
class CMNHFManager;
class CSporkManager;
class CTxMemPool;
class PeerManager;
@ -31,7 +30,6 @@ private:
CSigSharesManager& shareman;
CTxMemPool& mempool;
const CQuorumManager& qman;
const CSporkManager& sporkman;
const std::unique_ptr<PeerManager>& m_peerman;
/**
@ -42,7 +40,7 @@ private:
public:
explicit CEHFSignalsHandler(CChainState& chainstate, CMNHFManager& mnhfman, CSigningManager& sigman,
CSigSharesManager& shareman, CTxMemPool& mempool, const CQuorumManager& qman,
const CSporkManager& sporkman, const std::unique_ptr<PeerManager>& peerman);
const std::unique_ptr<PeerManager>& peerman);
~CEHFSignalsHandler();

View File

@ -42,7 +42,7 @@ enum SporkId : int32_t {
SPORK_19_CHAINLOCKS_ENABLED = 10018,
SPORK_21_QUORUM_ALL_CONNECTED = 10020,
SPORK_23_QUORUM_POSE = 10022,
SPORK_24_TEST_EHF = 10023,
// SPORK_24_DEPRECATED = 10023,
SPORK_INVALID = -1,
};
@ -76,7 +76,6 @@ struct CSporkDef
MAKE_SPORK_DEF(SPORK_19_CHAINLOCKS_ENABLED, 4070908800ULL), // OFF
MAKE_SPORK_DEF(SPORK_21_QUORUM_ALL_CONNECTED, 4070908800ULL), // OFF
MAKE_SPORK_DEF(SPORK_23_QUORUM_POSE, 4070908800ULL), // OFF
MAKE_SPORK_DEF(SPORK_24_TEST_EHF, 4070908800ULL), // OFF
};
#undef MAKE_SPORK_DEF

View File

@ -5,6 +5,7 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import struct
import time
from io import BytesIO
from test_framework.authproxy import JSONRPCException
@ -45,15 +46,6 @@ class MnehfTest(DashTestFramework):
for i in range(1, self.num_nodes):
self.connect_nodes(i, 0)
def slowly_generate_batch(self, amount):
self.log.info(f"Slowly generate {amount} blocks")
while amount > 0:
self.log.info(f"Generating batch of blocks {amount} left")
next = min(10, amount)
amount -= next
self.bump_mocktime(next)
self.nodes[1].generate(next)
self.sync_all()
def create_mnehf(self, versionBit, pubkey=None):
# request ID = sha256("mnhf", versionBit)
@ -241,26 +233,18 @@ class MnehfTest(DashTestFramework):
node.generate(1)
self.sync_blocks()
self.restart_all_nodes(params=[self.mocktime, self.mocktime + 1000000])
self.check_fork('defined')
self.mine_quorum()
ehf_tx_new_start = self.create_mnehf(28, pubkey)
self.log.info("Test spork 24 (EHF)")
self.check_fork('defined')
self.nodes[0].sporkupdate("SPORK_24_TEST_EHF", 0)
self.wait_for_sporks_same()
self.check_fork('defined')
self.log.info("Mine one block and ensure EHF tx for the new deployment is mined")
ehf_tx_sent = self.send_tx(ehf_tx_new_start)
tip_blockhash = node.generate(1)[0]
self.sync_all()
block = node.getblock(tip_blockhash)
assert ehf_tx_sent in block['tx']
self.check_fork('defined')
self.slowly_generate_batch(4 * 4)
self.log.info("Waiting a bit to make EHF activating...")
self.mine_quorum()
for _ in range(4 * 4):
time.sleep(1)
self.bump_mocktime(1)
self.nodes[1].generate(1)
self.sync_all()
self.check_fork('active')