dash(S8): CoinStateMaintainer populates NodeCoinState off tip/MN/mempool updates (stacks on #673)#674
Merged
Merged
Conversation
…ool updates (stacks on #673) The maintainer that flips the node-held embedded coin-state bundle live off the async reception + think update path, replacing the set_tip-on-demand pattern (#673 left publication to whoever poked NodeCoinState::set_tip). - src/impl/dash/coin/coin_state_maintainer.hpp: on_mn_list_update / on_mempool_tx / on_new_tip / on_invalidate event methods over a node-owned NodeCoinState&. Readiness gate: republish (set_tip) ONLY when a non-empty MN list AND a tip are both present, in either order. Empty mnlistdiff (gap) and reorg demote to the retained dashd fallback; a reorg drops the tip so a fresh tip is required to re-arm (no stale-prev auto-republish). Mempool is optional for viability (empty => valid coinbase-only template). - test/test_dash_coin_state_maintainer.cpp: 4 KATs proving the bundle flips has_state=true only on a live tip+MN update (both orders), byte-equal to a direct build_embedded_workdata() incl. a routed mempool tx, and demotes on empty-MN gap / reorg. Registered in both build.yml --target allowlists. STRICTLY single-coin: impl/dash/coin/ only, no bitcoin_family / src/core reach. dashd RPC fallback retained as the always-reachable [GBT-XCHECK] safety path.
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.
Slice 7 of the S8 embedded_gbt live-wire lane; stacks on #673 (which stacks on #672). Merge order: #672 -> #673 -> #674.
What
The maintainer that POPULATES the node-held
NodeCoinStateoff the async reception + think update path, replacing the set_tip-on-demand pattern where a caller pokedNodeCoinState::set_tip()directly.src/impl/dash/coin/coin_state_maintainer.hpp:on_mn_list_update/on_mempool_tx/on_new_tip/on_invalidateevent methods over a node-ownedNodeCoinState&. Readiness gate: republish (set_tip) ONLY when a non-empty MN list AND a tip are both present, in either order. Empty mnlistdiff (gap) and reorg demote to the retained dashd fallback; a reorg drops the tip so a fresh tip is required to re-arm (no stale-prev auto-republish). Mempool optional for viability (empty => valid coinbase-only template).test/test_dash_coin_state_maintainer.cpp: 4 KATs.Constraints (per integrator, this thread)
src/impl/dash/coin/only; the src header includes onlyimpl/dash/coin/*+core/uint256. Nobitcoin_family/src/corereach.gh pr diff 674 --name-only= 4 files (src header, test, test/CMakeLists.txt, build.yml).has_state=trueon a live tip+MN update in BOTH orders, byte-equal to a directbuild_embedded_workdata()incl. a routed mempool tx (fee 10000 confirmed reaching the template), and demotes on empty-MN gap / reorg.populated()==falsealways routes there.Test
test_dash_coin_state_maintainer4/4 PASS (run directly from build/; registered in BOTH build.yml --target allowlists). Reconfig cmake rc=0, target builds+links clean.No self-merge — integrator verify (diff scope + oracle parity pin: embedded_gbt.hpp untouched, test_dash_embedded_gbt 8/8) + operator tap for anything consensus-bearing.