dash(S8): node-held coin-state flips select_dash_work hot arm (stacks on #672)#673
Merged
Conversation
Add dash::coin::select_dash_work (work_source.hpp): the get_work branch point that prefers the locally-assembled embedded template (build_embedded_workdata) and falls back to dashd getblocktemplate when the embedded coin-state bundle is not viable. The dashd RPC arm is retained as fallback + [GBT-XCHECK] cross-check, never removed. Wire it into main_dash run_mine_block as the live consumer; NodeImpl does not yet hold embedded coin-state (MN list + mempool + header tip), so emb.has_state=false routes to the dashd fallback today (flagged next sub-slice). test_dash_work_source: 4/4 routing + retained-fallback KAT (harness-free; embedded oracle-parity already pinned by test_dash_embedded_gbt). Registered in both build.yml target allowlists.
NodeCoinState (node_coin_state.hpp): the in-process masternode-list + mempool + header-tip holder the running DASH node maintains, stacking on #672 select_dash_work(). make_embedded_work_inputs() presents it as a viable() EmbeddedWorkInputs so a populated bundle routes WorkSource:: Embedded (build_embedded_workdata, oracle-parity vs frstrtr/p2pool-dash), while populated()==false / invalidate() keep the retained dashd getblocktemplate fallback -- never removed, still the [GBT-XCHECK] arm. Strictly single-coin (src/impl/dash/ only; no bitcoin_family/src/core). test_dash_node_coin_state (3/3): the HOT arm #672 could not exercise -- populated -> Embedded byte-equal to a direct build_embedded_workdata over the same inputs (fallback closure NOT invoked); plus retained-fallback and invalidate()->fallback. Registered in both build.yml target allowlists.
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.
Stacks on #672 (dash/s8-embedded-gbt-worksource @15520dd7) — merge #672 first.
What
Adds
NodeCoinState(src/impl/dash/coin/node_coin_state.hpp): the in-process masternode-list + mempool + header-tip bundle the running DASH node maintains.make_embedded_work_inputs()presents it as a viable()EmbeddedWorkInputsso #672 select_dash_work() takes the embedded (oracle-parity) arm when populated, and the retained dashd getblocktemplate fallback when not. This is the live consumer that flips has_state=true — the real weight of the embedded_gbt capstone.Scope
Strictly single-coin: src/impl/dash/ only. No bitcoin_family / src/core reach. dashd RPC arm never removed (fallback + [GBT-XCHECK]).
Test — test_dash_node_coin_state, 3/3 local
Registered in both build.yml --target allowlists. embedded_gbt.hpp untouched (oracle parity stays pinned by test_dash_embedded_gbt 8/8).
Integrator: per your 2026-07-11T19:40 note — folds into the same #672 review pass.