dash(s8): live-wire MnStateMachine::apply_block via on_block_connected - #675
Merged
Conversation
…er::on_block_connected Drive the DMN state machine incrementally per connected block. Prior to this the masternode set was populated ONLY by the bulk mnlistdiff snapshot (on_mn_list_update -> mnstates().load()); MnStateMachine::apply_block had no live caller outside its KAT. on_block_connected() folds each connected block s special txs into the set (RebuildListFromBlock semantics), keeping the payee the embedded coinbase pays current BETWEEN full snapshots. The bulk snapshot path is unchanged and stays the authoritative resync. MN-readiness is refreshed from the post-apply size: a block that empties the set (all collateral spent) drops the bundle to the dashd RPC fallback rather than backing a template with a phantom payee -- the external-daemon fallback path is preserved (hard V36 requirement). Scope: src/impl/dash/ only, single-coin, additive. KAT: test_dash_coin_state_maintainer +2 (no-op block preserves readiness; collateral-spend empties set -> DashdFallback); 6/6 green.
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.
Scope:
src/impl/dash/only — single-coin, additiveBase SHA:
48e93de4(master tip = #674 merge commit).What
Wires the S8
mn_state_machineleaf into the live path.MnStateMachine::apply_block(RebuildListFromBlock semantics, 668 LOC, KATtest_dash_mn_state— both already on master) previously had no live caller outside its own KAT. The DMN set was populated ONLY by the bulk mnlistdiff snapshot (on_mn_list_update -> mnstates().load()).CoinStateMaintainer::on_block_connected(block, height)now folds each connected block's special txs into the set incrementally, keeping the masternode payee the embedded coinbase pays current between full snapshots.Invariants preserved
size(): a block that empties the set (all collateral spent) drops the bundle to the dashd RPC fallback rather than backing a phantom payee. External-daemon fallback preserved (hard V36 requirement).bitcoin_family/orcore/touch. No build.yml change (target already in both allowlists).Test
test_dash_coin_state_maintainer+2 KATs (no-op block preserves readiness; collateral-spend empties set ->DashdFallback). Local: 6/6 green, built--target test_dash_coin_state_maintainer, ctest from build/.Oracle: apply_block semantics conform to frstrtr/p2pool-dash-derived MnStateMachine (dashcore
specialtxman.cpp::RebuildListFromBlock), unchanged here.