Skip to content

backport: assumeutxo M2 — EvoDB isolation and chainstate roles (bitcoin#25494, partial #27596)#7457

Closed
thepastaclaw wants to merge 10 commits into
dashpay:developfrom
thepastaclaw:assumeutxo/m2-evodb-roles
Closed

backport: assumeutxo M2 — EvoDB isolation and chainstate roles (bitcoin#25494, partial #27596)#7457
thepastaclaw wants to merge 10 commits into
dashpay:developfrom
thepastaclaw:assumeutxo/m2-evodb-roles

Conversation

@thepastaclaw

Copy link
Copy Markdown

Issue being fixed or feature implemented

This is milestone 2 of 7 in the stacked assumeutxo backport series, building on the snapshot-initialization groundwork merged in #7451. It introduces the chainstate roles and Dash-specific state separation needed for active snapshot and background validation chainstates to coexist safely.

What was done?

  • Partially backported bitcoin#25494 by adding interfaces::BlockInfo, kernel::MakeBlockInfo, and the associated block-notification plumbing. The remaining index refactoring commits are intentionally excluded.
  • Partially backported bitcoin#27596 by adding ChainstateRole. The remainder of that upstream assumeutxo PR stays in later milestones.
  • Made EvoDB consistency markers and transactions chainstate-specific, with dual-chainstate restart and reorg coverage. Reads outside scoped transactions follow the active chainstate, while explicit background-validation transactions select the normal chainstate overlay.
  • Removed persisted snapshot chainstates during explicit -reindex and -reindex-chainstate, restoring the normal chainstate before block import while continuing to require the snapshot EvoDB marker on normal startup.
  • Bound Dash special-transaction and quorum processing to the chainstate performing validation instead of borrowing the active chainstate.
  • Suppressed active-chain notifications from background validation while retaining BlockChecked behavior.
  • Guarded masternode-list and quorum-history serving when requested endpoints or derived quorum work blocks are not locally available.
  • Disabled DKG participation and quorum share production until snapshot background validation completes.
  • Canonicalized serialization of block-derived EvoDB payloads.

The temporary M1 manager-rebuild workaround is not present. M2's structural ChainstateManager ownership makes that workaround, its test-only accessor, and its M1-specific regression test unnecessary.

How Has This Been Tested?

  • Built the unit test binary with make -C src test/test_dash.
  • Passed validation_chainstatemanager_tests, evo_db_tests, llmq_commitment_tests, llmq_snapshot_tests, evo_cbtx_tests, and miner_tests.
  • Passed the whitespace, circular-dependency, include-guard, include-order, and file lints.
  • Passed per-commit and cumulative git diff --check validation.
  • Range-diffed the ten-commit restack against the previously reviewed M2 series. Original order and authorship are preserved; logical commits 3–6 and 8 contain the focused EvoDB, reindex, and unavailable-history corrections described above, while the remaining commits are patch-equivalent.

Breaking Changes

None. This remains unreleased assumeutxo groundwork; snapshot loading is introduced by a later milestone.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone

ryanofsky and others added 3 commits July 13, 2026 16:19
This backports the first commit of bitcoin#25494, which introduces kernel/chain.{h,cpp}, interfaces::BlockInfo, and kernel::MakeBlockInfo. The remaining index refactoring commits are intentionally excluded.

Upstream commit: a0b5b4a
This is an early partial pick of bitcoin#27596; the remainder will be backported later.

Upstream commit: c6af23c
@thepastaclaw

Copy link
Copy Markdown
Author

CI diagnosis

These failures are unrelated to this PR's EvoDB/chainstate-role changes, so the branch is proper as-is and has not been modified:

  • mac-build / Build source never reached the build step. Restore SDKs cache failed because depends-sdks-3b862087... was absent; the preceding cache job downloaded the SDK but GitHub denied saving it because its token had no writable cache scope.
  • win64-build / Build source compiled successfully, then the shuffled unit suite page-faulted in validation_chainstate_tests/chainstate_update_tip at CreateAndActivateUTXOSnapshot(..., reset_chainstate=true). The PR does not modify src/test/validation_chainstate_tests.cpp, and a fresh rebuild of current develop (2406ebcb959) reproduces the same isolated crash at line 83.

Filed #7458 with the baseline reproduction and CI evidence. No commit, push, rebase, empty retrigger commit, or CI rerun was made for these unrelated failures.

@thepastaclaw
thepastaclaw force-pushed the assumeutxo/m2-evodb-roles branch from a616e17 to a181f51 Compare July 14, 2026 00:52
Pass the validating chainstate through special transaction and quorum commitment processing instead of borrowing the active chainstate.

Interpret mined-commitment records and quorum resolution relative to the caller's chain. The cached values remain reusable, but chain membership is reevaluated across reorgs and chainstates while public non-validation callers retain active-chain semantics. This prevents snapshot-seeded records from suppressing commitments or satisfying MNHF and asset-unlock quorum lookups during background validation.

Add dual-chainstate coverage for a commitment seeded at a block not yet contained by the background chain, including HasQuorum and GetQuorum cache-order checks.
Emit block, tip, deterministic masternode-list, UI, and flush notifications only for the active chainstate. In particular, suppressing background ChainStateFlushed prevents a background locator from regressing wallet best-block state.

Keep BlockChecked ungated because its subscribers are mining/block-submit and peer validation/relay accounting; it does not reach CMNAuth. Document all 21 B3 call-site dispositions and extend the dual-chainstate test with validation-interface and UI counters.
Check local block-data availability before building masternode-list diffs and quorum rotation info. Treat failures caused by pruning or an unvalidated snapshot base like pruned getdata: log and silently drop the plausible request without increasing the peer's misbehavior score.

Malformed and implausible requests retain the pre-existing penalties.
Disable DKG participation and quorum signing until snapshot background validation completes. Enforce the refusal at CreateSigShare, the actual share-production boundary, so direct RPC, async, and queued signing paths cannot bypass it.

The quorum sign RPC now returns a clear JSON-RPC error for both submit modes, and masternode status exposes the disabled participation state. Add unit coverage for the shared production-gate predicate across snapshot activation.
@thepastaclaw
thepastaclaw force-pushed the assumeutxo/m2-evodb-roles branch from a181f51 to 47dac03 Compare July 14, 2026 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants