diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 60ef60638d..838a8d5af7 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -249,6 +249,15 @@ public: consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nThresholdMin = 2420; // 60% of 4032 consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nFalloffCoeff = 5; // this corresponds to 10 periods + // Deployment of Deployment of Basic BLS, AssetLocks, EHF + consensus.vDeployments[Consensus::DEPLOYMENT_V19].bit = 8; + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nStartTime = 19999999999; // TODO: To be determined later + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nTimeout = 999999999999ULL; + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nWindowSize = 4032; + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nThresholdStart = 3226; // 80% of 4032 + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nThresholdMin = 2420; // 60% of 4032 + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nFalloffCoeff = 5; // this corresponds to 10 periods + // The best chain should have at least this much work. consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000079c96bdb79315818b358"); // 1756000 @@ -474,6 +483,15 @@ public: consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nThresholdMin = 60; // 60% of 100 consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nFalloffCoeff = 5; // this corresponds to 10 periods + // Deployment of Deployment of Basic BLS, AssetLocks, EHF + consensus.vDeployments[Consensus::DEPLOYMENT_V19].bit = 8; + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nStartTime = 19999999999; // TODO: To be determined later + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nTimeout = 999999999999ULL; + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nWindowSize = 100; + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nThresholdStart = 80; // 80% of 100 + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nThresholdMin = 60; // 60% of 100 + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nFalloffCoeff = 5; // this corresponds to 10 periods + // The best chain should have at least this much work. consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000000002d68c333d26a1b3"); // 817000 @@ -670,6 +688,15 @@ public: consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nThresholdMin = 60; // 60% of 100 consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nFalloffCoeff = 5; // this corresponds to 10 periods + // Deployment of Deployment of Basic BLS, AssetLocks, EHF + consensus.vDeployments[Consensus::DEPLOYMENT_V19].bit = 8; + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nStartTime = 1661990400; // Sep 1st, 2022 + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nTimeout = 999999999999ULL; + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nWindowSize = 100; + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nThresholdStart = 80; // 80% of 100 + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nThresholdMin = 60; // 60% of 100 + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nFalloffCoeff = 5; // this corresponds to 10 periods + // The best chain should have at least this much work. consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000000000000000000"); @@ -911,6 +938,15 @@ public: consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nThresholdMin = 180; // 60% of 300 consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nFalloffCoeff = 5; // this corresponds to 10 periods + // Deployment of Deployment of Basic BLS, AssetLocks, EHF + consensus.vDeployments[Consensus::DEPLOYMENT_V19].bit = 8; + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nStartTime = 0; + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nTimeout = 999999999999ULL; + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nWindowSize = 300; + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nThresholdStart = 240; // 80% of 300 + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nThresholdMin = 180; // 60% of 300 + consensus.vDeployments[Consensus::DEPLOYMENT_V19].nFalloffCoeff = 5; // this corresponds to 10 periods + // The best chain should have at least this much work. consensus.nMinimumChainWork = uint256S("0x00"); diff --git a/src/consensus/params.h b/src/consensus/params.h index 88849a022d..b538c7726c 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -23,6 +23,7 @@ enum DeploymentPos { DEPLOYMENT_REALLOC, // Deployment of Block Reward Reallocation DEPLOYMENT_DIP0020, // Deployment of DIP0020, DIP0021 and LMQ_100_67 quorums DEPLOYMENT_DIP0024, // Deployment of DIP0024 (Quorum Rotation) and decreased governance proposal fee + DEPLOYMENT_V19, // Deployment of Basic BLS, AssetLocks, EHF // NOTE: Also add new deployments to VersionBitsDeploymentInfo in versionbits.cpp MAX_VERSION_BITS_DEPLOYMENTS }; diff --git a/src/llmq/utils.cpp b/src/llmq/utils.cpp index 43d2c1c2ad..c051f53542 100644 --- a/src/llmq/utils.cpp +++ b/src/llmq/utils.cpp @@ -598,6 +598,14 @@ bool IsDIP0024Active(const CBlockIndex* pindex) return VersionBitsState(pindex, Params().GetConsensus(), Consensus::DEPLOYMENT_DIP0024, llmq_versionbitscache) == ThresholdState::ACTIVE; } +bool IsV19Active(const CBlockIndex* pindex) +{ + assert(pindex); + + LOCK(cs_llmq_vbc); + return VersionBitsState(pindex, Params().GetConsensus(), Consensus::DEPLOYMENT_V19, llmq_versionbitscache) == ThresholdState::ACTIVE; +} + bool IsInstantSendLLMQTypeShared() { if (Params().GetConsensus().llmqTypeInstantSend == Params().GetConsensus().llmqTypeChainLocks || diff --git a/src/llmq/utils.h b/src/llmq/utils.h index 35cfcae5eb..4afaf675c7 100644 --- a/src/llmq/utils.h +++ b/src/llmq/utils.h @@ -93,6 +93,7 @@ bool IsQuorumRotationEnabled(Consensus::LLMQType llmqType, const CBlockIndex* pi Consensus::LLMQType GetInstantSendLLMQType(const CQuorumManager& qman, const CBlockIndex* pindex); Consensus::LLMQType GetInstantSendLLMQType(bool deterministic); bool IsDIP0024Active(const CBlockIndex* pindex); +bool IsV19Active(const CBlockIndex* pindex); static bool IsInstantSendLLMQTypeShared(); /// Returns the state of `-llmq-data-recovery` diff --git a/src/versionbitsinfo.cpp b/src/versionbitsinfo.cpp index aed106cac0..fb94fa7e39 100644 --- a/src/versionbitsinfo.cpp +++ b/src/versionbitsinfo.cpp @@ -51,5 +51,10 @@ const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_B /*.name =*/"dip0024", /*.gbt_force =*/true, /*.check_mn_protocol =*/false, + }, + { + /*.name =*/"v19", + /*.gbt_force =*/true, + /*.check_mn_protocol =*/false, } }; diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index b04df12082..6cc73bf87c 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -881,15 +881,8 @@ class DashTestFramework(BitcoinTestFramework): self.sync_blocks() self.sync_blocks() - def activate_dip0024(self, expected_activation_height=None): - self.log.info("Wait for dip0024 activation") - - # disable spork17 while mining blocks to activate dip0024 to prevent accidental quorum formation - spork17_value = self.nodes[0].spork('show')['SPORK_17_QUORUM_DKG_ENABLED'] - self.bump_mocktime(1) - self.nodes[0].sporkupdate("SPORK_17_QUORUM_DKG_ENABLED", 4070908800) - self.wait_for_sporks_same() - + def activate_by_name(self, name, expected_activation_height=None): + self.log.info("Wait for " + name + " activation") # mine blocks in batches batch_size = 10 if expected_activation_height is not None: @@ -904,19 +897,31 @@ class DashTestFramework(BitcoinTestFramework): self.bump_mocktime(blocks_left) self.nodes[0].generate(blocks_left) self.sync_blocks() - assert self.nodes[0].getblockchaininfo()['bip9_softforks']['dip0024']['status'] != 'active' + assert self.nodes[0].getblockchaininfo()['bip9_softforks'][name]['status'] != 'active' - while self.nodes[0].getblockchaininfo()['bip9_softforks']['dip0024']['status'] != 'active': + while self.nodes[0].getblockchaininfo()['bip9_softforks'][name]['status'] != 'active': self.bump_mocktime(batch_size) self.nodes[0].generate(batch_size) self.sync_blocks() self.sync_blocks() + def activate_dip0024(self, expected_activation_height=None): + # disable spork17 while mining blocks to activate dip0024 to prevent accidental quorum formation + spork17_value = self.nodes[0].spork('show')['SPORK_17_QUORUM_DKG_ENABLED'] + self.bump_mocktime(1) + self.nodes[0].sporkupdate("SPORK_17_QUORUM_DKG_ENABLED", 4070908800) + self.wait_for_sporks_same() + + self.activate_by_name('dip0024', expected_activation_height) + # revert spork17 changes self.bump_mocktime(1) self.nodes[0].sporkupdate("SPORK_17_QUORUM_DKG_ENABLED", spork17_value) self.wait_for_sporks_same() + def activate_v19(self, expected_activation_height=None): + self.activate_by_name('v19', expected_activation_height) + def set_dash_llmq_test_params(self, llmq_size, llmq_threshold): self.llmq_size = llmq_size self.llmq_threshold = llmq_threshold