diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 1f3cbff28f..10a9300fd3 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -245,6 +245,15 @@ public: consensus.vDeployments[Consensus::DEPLOYMENT_V19].nThresholdMin = 2420; // 60% of 4032 consensus.vDeployments[Consensus::DEPLOYMENT_V19].nFalloffCoeff = 5; // this corresponds to 10 periods + consensus.vDeployments[Consensus::DEPLOYMENT_V20].bit = 9; + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nStartTime = 19999999999; // TODO: To be determined later + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nTimeout = 999999999999ULL; + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nWindowSize = 4032; + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nThresholdStart = 3226; // 80% of 4032 + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nThresholdMin = 2420; // 60% of 4032 + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nFalloffCoeff = 5; // this corresponds to 10 periods + + // The best chain should have at least this much work. consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000082094584a23266cbb5f8"); // 1850400 @@ -484,6 +493,14 @@ public: consensus.vDeployments[Consensus::DEPLOYMENT_V19].nThresholdMin = 60; // 60% of 100 consensus.vDeployments[Consensus::DEPLOYMENT_V19].nFalloffCoeff = 5; // this corresponds to 10 periods + consensus.vDeployments[Consensus::DEPLOYMENT_V20].bit = 9; + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nStartTime = 19999999999; // TODO: To be determined later + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nTimeout = 999999999999ULL; + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nWindowSize = 100; + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nThresholdStart = 80; // 80% of 100 + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nThresholdMin = 60; // 60% of 100 + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nFalloffCoeff = 5; // this corresponds to 10 periods + // The best chain should have at least this much work. consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000000002d68cb6c090031f"); // 864000 @@ -696,6 +713,14 @@ public: consensus.vDeployments[Consensus::DEPLOYMENT_V19].nThresholdMin = 60; // 60% of 100 consensus.vDeployments[Consensus::DEPLOYMENT_V19].nFalloffCoeff = 5; // this corresponds to 10 periods + consensus.vDeployments[Consensus::DEPLOYMENT_V20].bit = 9; + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nStartTime = 1661990400; // Sep 1st, 2022 + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nTimeout = 999999999999ULL; + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nWindowSize = 120; + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nThresholdStart = 80; // 80% of 100 + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nThresholdMin = 60; // 60% of 100 + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nFalloffCoeff = 5; // this corresponds to 10 periods + // The best chain should have at least this much work. consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000000000000000000"); @@ -959,6 +984,14 @@ public: consensus.vDeployments[Consensus::DEPLOYMENT_V19].nThresholdMin = 180; // 60% of 300 consensus.vDeployments[Consensus::DEPLOYMENT_V19].nFalloffCoeff = 5; // this corresponds to 10 periods + consensus.vDeployments[Consensus::DEPLOYMENT_V20].bit = 9; + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nStartTime = 0; + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nTimeout = 999999999999ULL; + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nWindowSize = 320; + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nThresholdStart = 240; // 80% of 300 + consensus.vDeployments[Consensus::DEPLOYMENT_V20].nThresholdMin = 180; // 60% of 300 + consensus.vDeployments[Consensus::DEPLOYMENT_V20].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 b538c7726c..d9f238ea82 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -23,7 +23,8 @@ 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 + DEPLOYMENT_V19, // Deployment of Basic BLS, AssetLocks + DEPLOYMENT_V20, // Deployment of EHF, LLMQ Randomness Beacon // 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 ce0fba766c..cd4972fe82 100644 --- a/src/llmq/utils.cpp +++ b/src/llmq/utils.cpp @@ -671,6 +671,14 @@ const CBlockIndex* V19ActivationIndex(const CBlockIndex* pindex) return pindex->GetAncestor(nHeight); } +bool IsV20Active(const CBlockIndex* pindex) +{ + assert(pindex); + + LOCK(cs_llmq_vbc); + return VersionBitsState(pindex, Params().GetConsensus(), Consensus::DEPLOYMENT_V20, 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 289d6b4bc3..cb2741d53e 100644 --- a/src/llmq/utils.h +++ b/src/llmq/utils.h @@ -85,6 +85,7 @@ Consensus::LLMQType GetInstantSendLLMQType(bool deterministic); bool IsDIP0024Active(const CBlockIndex* pindex); bool IsV19Active(const CBlockIndex* pindex); const CBlockIndex* V19ActivationIndex(const CBlockIndex* pindex); +bool IsV20Active(const CBlockIndex* pindex); /// Returns the state of `-llmq-data-recovery` bool QuorumDataRecoveryEnabled(); diff --git a/src/versionbitsinfo.cpp b/src/versionbitsinfo.cpp index fb94fa7e39..c2a3d1c15a 100644 --- a/src/versionbitsinfo.cpp +++ b/src/versionbitsinfo.cpp @@ -56,5 +56,10 @@ const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_B /*.name =*/"v19", /*.gbt_force =*/true, /*.check_mn_protocol =*/false, + }, + { + /*.name =*/"v20", + /*.gbt_force =*/true, + /*.check_mn_protocol =*/false, } };