backport: assumeutxo M4 — evo snapshot format v3 and LLMQ reconstruction#53
Open
PastaPastaPasta wants to merge 4 commits into
Open
backport: assumeutxo M4 — evo snapshot format v3 and LLMQ reconstruction#53PastaPastaPasta wants to merge 4 commits into
PastaPastaPasta wants to merge 4 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
4 tasks
32d5966 to
4f9d716
Compare
52a0371 to
ed610de
Compare
4f9d716 to
f08bce5
Compare
ed610de to
609b604
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue being fixed or feature implemented
Upstream UTXO-only snapshots can't validate a DIP3-active chain like Dash's:
masternode lists, LLMQ quorums/rotation, the credit pool, and EHF state all
need to be captured and reconstructible from a snapshot, independently
verifiable against the chain (not merely trusted). This is milestone 4/7, the
largest design unit of the series (10 review rounds; design docs D1/D2). The
execution plan and per-unit ledger (M4 section) are tracked outside the repo
in a private gist, not checked in: https://gist.github.com/PastaPastaPasta/aa52b1f89fb74a0566ba3b5e15afab6a
loadtxoutsetis deliberately still unexposed after this PR — it needs theformat landed here, but the RPC itself arrives in M5.
PR 4/7 in the stacked series — base is M3 (
assumeutxo/m3-background-completion).This PR implements the user-locked design decision (2026-07-11): the evo
snapshot carries the FULL quorum member-reconstruction history, diff-encoded
from the base MN list, plus per-work-block score modifiers/CbTx signatures —
chosen over a smaller verification-only format because both rotated and
non-rotated
GetHashModifierneed CbTx data unavailable pre-completion, andreconstructing the active non-rotated set needs MN lists ~24 cycles (~576
blocks) to ~2,304 blocks back, depending on quorum type.
What was done?
evo_hash:CEvoSnapshotv3 replacesfull historical lists with one canonical reverse diff chain from the base
list through every required LLMQ work block (predecessor/target hashes,
height, registration counter, canonical target hash, bounded canonical
CDeterministicMNListDiffper link; exact(llmq_type, work_block_hash, modifier)tuples for every commitment/rotation reference). A pure horizonenumerator covers non-rotated active+safety cycles and rotated H-C..H-4C
(worst default span 2,312 blocks; 104 on regtest), with a params-derived
link count cap (192 max with currently enabled LLMQs) and a shared
786,432-operation decode budget. Five review rounds.
dumptxoutsetbuilds the v3section under the coins-cursor
cs_mainpin; populate validates ancestry,exact history/modifier coverage, work-block relationships, evo_hash, and
CbTx roots, then atomically seeds reconstructed lists, modifiers,
commitments, rotation snapshots, credit pool, and MNHF state under the
snapshot EvoDB identity. A modifier-mismatch signal is contained at quorum,
connect/disconnect, direct-validity, VerifyDB, and replay boundaries and
routes to the controlled invalid-snapshot/shutdown path. 3 review rounds.
lifecycle dirs before the EvoDB wipe/detection; an
assumeutxoprune lockprotects the base block until deferred CbTx/evo checks complete. Round 2
review found a released prune lock resurrected by
DisconnectTiprewind —fixed via
BlockManager::DeletePruneLock.broken by extracting
evo/snapshot_types.hand moving snapshotload/seed/completion orchestration into
evo/snapshot_load.cpp(note forfuture backports: upstream hunks touching
PopulateAndValidateSnapshot/MaybeCompleteSnapshotValidationinvalidation.cppmust be retargetedthere).
cross-checking, and rotated/non-rotated
GetAllQuorumMembersreconstruction with block data unavailable, using an independent manager
oracle; removing a seed trips the fail-closed NORMAL-state barrier
(also covers
ScanQuorumsand recovered-signature verification).How Has This Been Tested?
make check: exit 0, 0 failures (rerun on the final post-refactor tree).feature_assumeutxo_dash,feature_dip3×2,feature_llmq_signing×2,feature_llmq_rotation,feature_llmq_chainlocks,feature_mnehf,feature_asset_locks,feature_init,feature_reindex,feature_pruning— all passed.Breaking Changes
Snapshot format is new/versioned (v3) and unreleased; no compatibility
surface exists yet.
loadtxoutsetremains unexposed to end users until M5.Checklist: