You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: invalidate quorum commitment cache on disconnect
CachedGetQcHashesQcIndexedHashes keyed both process-lifetime layers only by
quorum base blocks/hashes, not by the mined CFinalCommitment. Different valid
branches can therefore produce different commitment hashes for the same base
list. evoDb rolled back on disconnect, but the caches did not, which can make
CalcCbTxMerkleRootQuorums reject a valid replacement branch with
bad-cbtx-quorummerkleroot.
Invalidate both the outer whole-result cache and the per-quorum LRU from
CQuorumBlockProcessor::UndoBlock when a non-null commitment is undone, and add
unit coverage for the branch-change and UndoBlock invalidation seams.
Co-Authored-By: Claude <noreply@anthropic.com>
// Clear per-type LRU contents but keep the map entries so InitQuorumsCache is
75
+
// not required on every post-invalidation miss.
76
+
for (auto& [_, cache] : g_qc_hashes_lru) {
77
+
cache.clear();
78
+
}
79
+
}
80
+
52
81
/**
53
82
* Handles the calculation or caching of qcHashes and qcIndexedHashes
54
83
* @param pindexPrev The const CBlockIndex* (ie a block) of a block. Both the Quorum list and quorum rotation activation status will be retrieved based on this block.
@@ -58,45 +87,40 @@ auto CachedGetQcHashesQcIndexedHashes(const CBlockIndex* pindexPrev, const llmq:
0 commit comments