MWEB: Consensus params
This commit is contained in:
parent
fb672d32fe
commit
d32dfcca56
@ -91,6 +91,11 @@ public:
|
||||
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nStartHeight = 2161152; // End November 2021
|
||||
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeoutHeight = 2370816; // 364 days later
|
||||
|
||||
// Deployment of MWEB (LIP-0002, LIP-0003, and LIP-0004)
|
||||
consensus.vDeployments[Consensus::DEPLOYMENT_MWEB].bit = 4;
|
||||
consensus.vDeployments[Consensus::DEPLOYMENT_MWEB].nStartHeight = 2217600; // End Feb 2022
|
||||
consensus.vDeployments[Consensus::DEPLOYMENT_MWEB].nTimeoutHeight = 2427264; // 364 days later
|
||||
|
||||
consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000702edaa57d42a9fd9e2");
|
||||
consensus.defaultAssumeValid = uint256S("0x62e2e3d21343a00994d38a63524867507dbeee6850e8fbf02e9c47a3ccf82f24"); // 2186382
|
||||
|
||||
@ -205,6 +210,11 @@ public:
|
||||
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nStartTime = 1619222400; // April 24th, 2021
|
||||
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = 1628640000; // August 11th, 2021
|
||||
|
||||
// Deployment of MWEB (LIP-0002, LIP-0003, and LIP-0004)
|
||||
consensus.vDeployments[Consensus::DEPLOYMENT_MWEB].bit = 4;
|
||||
consensus.vDeployments[Consensus::DEPLOYMENT_MWEB].nStartHeight = 2209536; // Jan/Feb 2022
|
||||
consensus.vDeployments[Consensus::DEPLOYMENT_MWEB].nTimeoutHeight = 2419200; // 364 days later
|
||||
|
||||
consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000004260a1758f04aa");
|
||||
consensus.defaultAssumeValid = uint256S("0x4a280c0e150e3b74ebe19618e6394548c8a39d5549fd9941b9c431c73822fbd5"); // 1737876
|
||||
|
||||
@ -296,6 +306,11 @@ public:
|
||||
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nStartTime = Consensus::BIP9Deployment::ALWAYS_ACTIVE;
|
||||
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
|
||||
|
||||
// Deployment of MWEB (LIP-0002 and LIP-0003)
|
||||
consensus.vDeployments[Consensus::DEPLOYMENT_MWEB].bit = 4;
|
||||
consensus.vDeployments[Consensus::DEPLOYMENT_MWEB].nStartTime = 1601450001; // September 30, 2020
|
||||
consensus.vDeployments[Consensus::DEPLOYMENT_MWEB].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
|
||||
|
||||
consensus.nMinimumChainWork = uint256{};
|
||||
consensus.defaultAssumeValid = uint256{};
|
||||
|
||||
|
||||
@ -15,6 +15,7 @@ enum DeploymentPos
|
||||
{
|
||||
DEPLOYMENT_TESTDUMMY,
|
||||
DEPLOYMENT_TAPROOT, // Deployment of Schnorr/Taproot (BIPs 340-342)
|
||||
DEPLOYMENT_MWEB, // Deployment of MWEB (LIPs 0002-0004)
|
||||
// NOTE: Also add new deployments to VersionBitsDeploymentInfo in versionbits.cpp
|
||||
MAX_VERSION_BITS_DEPLOYMENTS
|
||||
};
|
||||
|
||||
@ -1362,6 +1362,7 @@ RPCHelpMan getblockchaininfo()
|
||||
BuriedForkDescPushBack(softforks, "segwit", consensusParams.SegwitHeight);
|
||||
VBSoftForkDescPushBack(softforks, "testdummy", consensusParams, Consensus::DEPLOYMENT_TESTDUMMY);
|
||||
VBSoftForkDescPushBack(softforks, "taproot", consensusParams, Consensus::DEPLOYMENT_TAPROOT);
|
||||
VBSoftForkDescPushBack(softforks, "mweb", consensusParams, Consensus::DEPLOYMENT_MWEB);
|
||||
obj.pushKV("softforks", softforks);
|
||||
|
||||
obj.pushKV("warnings", GetWarnings(false).original);
|
||||
|
||||
@ -3414,6 +3414,12 @@ bool IsWitnessEnabled(const CBlockIndex* pindexPrev, const Consensus::Params& pa
|
||||
return (height >= params.SegwitHeight);
|
||||
}
|
||||
|
||||
bool IsMWEBEnabled(const CBlockIndex* pindexPrev, const Consensus::Params& params)
|
||||
{
|
||||
LOCK(cs_main);
|
||||
return (VersionBitsState(pindexPrev, params, Consensus::DEPLOYMENT_MWEB, versionbitscache) == ThresholdState::ACTIVE);
|
||||
}
|
||||
|
||||
void UpdateUncommittedBlockStructures(CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams)
|
||||
{
|
||||
int commitpos = GetWitnessCommitmentIndex(block);
|
||||
|
||||
@ -306,6 +306,9 @@ bool TestBlockValidity(BlockValidationState& state, const CChainParams& chainpar
|
||||
* Note that transaction witness validation rules are always enforced when P2SH is enforced. */
|
||||
bool IsWitnessEnabled(const CBlockIndex* pindexPrev, const Consensus::Params& params);
|
||||
|
||||
/** Check whether MWEB (LIPs 002-004) has activated. */
|
||||
bool IsMWEBEnabled(const CBlockIndex* pindexPrev, const Consensus::Params& params);
|
||||
|
||||
/** Update uncommitted block structures (currently: only the witness reserved value). This is safe for submitted blocks. */
|
||||
void UpdateUncommittedBlockStructures(CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams);
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ ThresholdState AbstractThresholdConditionChecker::GetStateFor(const CBlockIndex*
|
||||
cache[pindexPrev] = ThresholdState::DEFINED;
|
||||
break;
|
||||
}
|
||||
if (fHeightBased ? (pindexPrev->nHeight + 1) < nHeightStart : pindexPrev->GetMedianTimePast() < nTimeStart) {
|
||||
if (fHeightBased ? ((pindexPrev->nHeight + 1) < nHeightStart) : (pindexPrev->GetMedianTimePast() < nTimeStart)) {
|
||||
// Optimization: don't recompute down further, as we know every earlier block will be before the start time
|
||||
cache[pindexPrev] = ThresholdState::DEFINED;
|
||||
break;
|
||||
@ -76,7 +76,7 @@ ThresholdState AbstractThresholdConditionChecker::GetStateFor(const CBlockIndex*
|
||||
}
|
||||
if (count >= nThreshold) {
|
||||
stateNext = ThresholdState::LOCKED_IN;
|
||||
} else if (fHeightBased ? (pindexPrev->nHeight + 1) >= nHeightTimeout : pindexPrev->GetMedianTimePast() >= nTimeTimeout) {
|
||||
} else if (fHeightBased ? ((pindexPrev->nHeight + 1) >= nHeightTimeout) : (pindexPrev->GetMedianTimePast() >= nTimeTimeout)) {
|
||||
stateNext = fHeightBased ? ThresholdState::LOCKED_IN : ThresholdState::FAILED;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -15,4 +15,8 @@ const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_B
|
||||
/*.name =*/ "taproot",
|
||||
/*.gbt_force =*/ true,
|
||||
},
|
||||
{
|
||||
/*.name =*/ "mweb",
|
||||
/*.gbt_force =*/ true,
|
||||
},
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user