Skip to content

dash(S8): node-held coin-state flips select_dash_work hot arm (stacks on #672)#673

Merged
frstrtr merged 2 commits into
masterfrom
dash/s8-node-coin-state
Jul 11, 2026
Merged

dash(S8): node-held coin-state flips select_dash_work hot arm (stacks on #672)#673
frstrtr merged 2 commits into
masterfrom
dash/s8-node-coin-state

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 11, 2026

Copy link
Copy Markdown
Owner

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() EmbeddedWorkInputs so #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

  • HOT arm (dash(S8): embedded_gbt live-wire selector + retained dashd fallback #672 could not exercise): populated bundle → WorkSource::Embedded, DashWorkData byte-equal to a direct build_embedded_workdata() over the same inputs; dashd fallback closure NOT invoked.
  • Retained fallback: unpopulated → DashdFallback (closure runs, sentinel returned).
  • invalidate() → reverts to fallback.
    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.

frstrtr added 2 commits July 11, 2026 15:39
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.
@frstrtr frstrtr merged commit cfe240b into master Jul 11, 2026
26 checks passed
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.

1 participant