-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: bury v20 fork - fire up test chains by first block - 4/n #6225
Changes from all commits
ca83b26
7735631
762a808
64cedb3
1087489
2381255
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,8 @@ CMNHFManager::~CMNHFManager() | |
|
||
CMNHFManager::Signals CMNHFManager::GetSignalsStage(const CBlockIndex* const pindexPrev) | ||
{ | ||
if (!DeploymentActiveAfter(pindexPrev, Params().GetConsensus(), Consensus::DEPLOYMENT_V20)) return {}; | ||
|
||
Signals signals = GetForBlock(pindexPrev); | ||
if (pindexPrev == nullptr) return {}; | ||
const int height = pindexPrev->nHeight + 1; | ||
|
@@ -116,6 +118,10 @@ bool CheckMNHFTx(const ChainstateManager& chainman, const llmq::CQuorumManager& | |
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-mnhf-version"); | ||
} | ||
|
||
if (!Params().IsValidMNActivation(mnhfTx.signal.versionBit, pindexPrev->GetMedianTimePast())) { | ||
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-mnhf-non-ehf"); | ||
} | ||
Comment on lines
+121
to
+123
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 6c69808: could probably be it's own distinct PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could not, because it's impossible (or very hard) to implement this functionality in functional tests within v20 buried. |
||
|
||
const CBlockIndex* pindexQuorum = WITH_LOCK(::cs_main, return chainman.m_blockman.LookupBlockIndex(mnhfTx.signal.quorumHash)); | ||
if (!pindexQuorum) { | ||
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-mnhf-quorum-hash"); | ||
|
@@ -139,10 +145,6 @@ bool CheckMNHFTx(const ChainstateManager& chainman, const llmq::CQuorumManager& | |
return false; | ||
} | ||
|
||
if (!Params().IsValidMNActivation(mnhfTx.signal.versionBit, pindexPrev->GetMedianTimePast())) { | ||
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-mnhf-non-ehf"); | ||
} | ||
|
||
return true; | ||
} | ||
|
||
|
@@ -319,7 +321,7 @@ std::optional<CMNHFManager::Signals> CMNHFManager::GetFromCache(const CBlockInde | |
} | ||
{ | ||
LOCK(cs_cache); | ||
if (ThresholdState::ACTIVE != v20_activation.State(pindex->pprev, Params().GetConsensus(), Consensus::DEPLOYMENT_V20)) { | ||
if (!DeploymentActiveAt(*pindex, Params().GetConsensus(), Consensus::DEPLOYMENT_V20)) { | ||
mnhfCache.insert(blockHash, signals); | ||
return signals; | ||
} | ||
|
@@ -340,10 +342,8 @@ void CMNHFManager::AddToCache(const Signals& signals, const CBlockIndex* const p | |
LOCK(cs_cache); | ||
mnhfCache.insert(blockHash, signals); | ||
} | ||
{ | ||
LOCK(cs_cache); | ||
if (ThresholdState::ACTIVE != v20_activation.State(pindex->pprev, Params().GetConsensus(), Consensus::DEPLOYMENT_V20)) return; | ||
} | ||
if (!DeploymentActiveAt(*pindex, Params().GetConsensus(), Consensus::DEPLOYMENT_V20)) return; | ||
|
||
m_evoDb.Write(std::make_pair(DB_SIGNALS, blockHash), signals); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the minimum set of commits needed in this PR to merge in 47def13?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two commits can be excluded from this PR as just useful follow-ups:
and probably 3cd7a42
All others commits are required for 47def13