Skip to content

dash(S8): get_work() consumer capstone — fuse NodeCoinState::select_work() + assemble_work_job_targets() - #695

Closed
frstrtr wants to merge 1 commit into
dash/s8-reception-wire-mnlist-legfrom
dash/s8-getwork-consumer-capstone
Closed

dash(S8): get_work() consumer capstone — fuse NodeCoinState::select_work() + assemble_work_job_targets()#695
frstrtr wants to merge 1 commit into
dash/s8-reception-wire-mnlist-legfrom
dash/s8-getwork-consumer-capstone

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 13, 2026

Copy link
Copy Markdown
Owner

S8 get_work() consumer capstone — the first production caller of the embedded arm

Stacks on #694 (reception-wire leg 4). Base = dash/s8-reception-wire-mnlist-leg so the diff is this one commit; rebases clean to master once #693#694 land.

What was missing

The embedded get_work chain was fully wired but had no production consumer. Both halves existed and were unit-tested in isolation:

Nothing fused them. Only the test suites ever called select_work().

This slice

dash::stratum::get_work() (src/impl/dash/stratum/get_work.hpp) — the single miner-facing entry, the first non-test caller of the embedded arm:

  • sources the base template off the node-held NodeCoinStateno direct dashd poll on the hot path when the bundle is populated;
  • assembles the job targets over whichever template arm ran;
  • dashd_fallback stays REQUIRED, invoked only on a set-gap (unpopulated / invalidated bundle) — the always-reachable safety + [GBT-XCHECK] cross-check arm, never removed.

Evidence

test_dash_get_work4/4 green (seeding mirrored exactly from test_dash_node_embedded_wire, no fabricated oracle values):

  1. set-gap → DashdFallback (fallback invoked once) and targets still assembled;
  2. populated → Embedded, fallback not invoked, byte-equal to a direct build_embedded_workdata() over the node's own held state;
  3. job targets identical across both template sources;
  4. on_invalidate() (reorg) demotes back to the fallback.

Local: dash object lib builds rc=0; ctest -R ^DashGetWork → 4/4 (out of 4). Registered in both build.yml --target allowlists.

Safety posture

STRICTLY single-coin (src/impl/dash/ + test only), SAFE-ADDITIVE — no bitcoin_family / src/core / other-coin reach, per-coin isolation intact. dashd RPC fallback preserved. No self-merge — integrator verify (oracle + full CI) → operator tap.

…work() template source + assemble_work_job_targets()

The embedded get_work chain was fully wired but had NO production consumer:
NodeCoinState::select_work() (embedded template when the 4-leg reception wire
(#693/#694) has populated the node bundle, else the retained dashd
getblocktemplate fallback) and assemble_work_job_targets() (per-miner job-target
arithmetic) each existed and were unit-tested, but nothing fused them into a
single miner-facing entry. Only the test suites ever called select_work().

Add dash::stratum::get_work() (src/impl/dash/stratum/get_work.hpp): the first
non-test caller of the embedded arm. It sources the base block template off the
node-held NodeCoinState -- NO direct dashd poll on the hot path when the bundle
is populated -- and assembles the job targets over whichever template arm ran.
dashd_fallback stays REQUIRED and is invoked ONLY on a set-gap (unpopulated /
invalidated bundle): the always-reachable safety + [GBT-XCHECK] cross-check arm,
never removed.

test_dash_get_work (4/4) pins the fused contract, seeding mirrored exactly from
test_dash_node_embedded_wire (no fabricated oracle values):
  * set-gap routes DashdFallback (invoked once) and still assembles targets;
  * populated routes Embedded WITHOUT invoking the fallback, byte-equal to a
    direct build_embedded_workdata() over the node's own held state;
  * job targets are identical across both template sources;
  * on_invalidate (reorg) demotes back to the fallback.

Registered in both build.yml --target allowlists. STRICTLY single-coin
(src/impl/dash/ + test only), SAFE-ADDITIVE.
@frstrtr
frstrtr deleted the branch dash/s8-reception-wire-mnlist-leg July 13, 2026 20:41
@frstrtr frstrtr closed this Jul 13, 2026
frstrtr added a commit that referenced this pull request Jul 14, 2026
…roved #695)

dash(S8): get_work() consumer capstone — fuse NodeCoinState::select_work() + assemble_work_job_targets()
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