Skip to content

dash(S8): reception-wire legs 1+3 -- new_tx/block_connected -> CoinStateMaintainer (rebased on master) - #693

Merged
frstrtr merged 2 commits into
masterfrom
dash/s8-reception-wire-block-connect-leg
Jul 13, 2026
Merged

dash(S8): reception-wire legs 1+3 -- new_tx/block_connected -> CoinStateMaintainer (rebased on master)#693
frstrtr merged 2 commits into
masterfrom
dash/s8-reception-wire-block-connect-leg

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 13, 2026

Copy link
Copy Markdown
Owner

S8 reception-wire, self-contained slice. Wires the live interfaces::Node event bus into the node-held CoinStateMaintainer so the embedded-template arm can flip on real reception (leg 2, new_tip, already on master @4854d02a).

Legs in this slice:

  • Leg 1 (mempool_ingest.hpp): interfaces::Node::new_tx -> CoinStateMaintainer::on_mempool_tx
  • Leg 3 (block_connect_ingest.hpp): interfaces::Node::block_connected -> CoinStateMaintainer::on_block_connected (drives MnStateMachine::apply_block; no-special-tx preserves readiness; reorg/empty demotes to dashd fallback)
  • node_interface.hpp: additive event surface (new_tx, full_block/block_connected)
  • KAT test_dash_node_reception_wire (suite DashReceptionWire): 8/8 green incl dispose lifecycle for each leg

REBASE NOTE: branch was cut from an older master; rebased clean onto d37e776 so ONLY dash reception files come forward -- no regression of #690 (dgb_arith256 portable), dashboard doc, or bch/abla. Diff is dash-only + test/CMakeLists + both build.yml --target allowlists.

SAFE-ADDITIVE: new headers + additive interface events; dashd RPC fallback preserved (select_work demotes when bundle empty). Single-coin (src/impl/dash/ only). GPG-signed (f76a948, a1db112).

Leg 4 (mnlistdiff -> on_mn_list_update) needs an mnlistdiff event added to interfaces::Node -- follow-on slice.

Requesting integrator diff + full-rollup CI verify (oracle-clean, no false-green) -> operator tap. No self-merge.

frstrtr added 2 commits July 13, 2026 15:55
…ained slice)

The reception-wire leg-1 header (wire_mempool_ingest) and the
test_dash_node_reception_wire CMake registration were authored in the worktree
but never committed to master -- this PR carries the FULL reception wire
(legs 1+2), so a fresh checkout builds the KAT target and its mempool_ingest
include. No file here is on master; purely additive, dash-only.
…> CoinStateMaintainer::on_block_connected

Legs 1 (mempool) + 2 (tip) subscribed the mempool-relay and header/think TIP-
ADVANCE events to the node-held embedded coin-state bundle. Nothing yet wired
the BLOCK-CONNECT event, so in a live node the DMN set the embedded coinbase
pays could only be seeded by a full mnlistdiff snapshot (on_mn_list_update) and
never auto-maintained forward between snapshots. This leg closes that gap:

- interfaces::Node gains an additive BlockConnected payload + Event<BlockConnected>
  block_connected. A bare full_block carries the block body but NOT the height
  on_block_connected -> MnStateMachine::apply_block needs (DIP3 special-tx chain
  position); block_connected pairs (block, height), exactly as leg 2 added
  TipAdvance for params best_block_hash could not carry. Purely additive, dash
  interface only (single-coin).
- block_connect_ingest.hpp::wire_block_connect_ingest subscribes on_block_connected
  to block_connected, mirroring wire_mempool_ingest / wire_tip_ingest contract
  (by-ref capture, explicit-teardown disposable; dashd GBT arm retained as the
  fallback when the post-apply set can no longer back a payee).
- test_dash_node_reception_wire gains leg-3 KATs off the real Event (no direct
  poke): a connected block that spends the sole MN collateral empties the DMN
  set and demotes the armed bundle to the dashd fallback; a no-special-tx block
  preserves readiness; dispose() stops ingest.

Also carries the leg-1 recovery (mempool_ingest.hpp + test registration) that
was authored in-worktree but never reached master via #686 -- without it the
shared reception-wire KAT does not build. Additive, src/impl/dash/ only, dashd
GBT fallback retained.
@frstrtr
frstrtr merged commit a20c558 into master Jul 13, 2026
26 of 27 checks passed
frstrtr added a commit that referenced this pull request Jul 13, 2026
…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 added a commit that referenced this pull request Jul 14, 2026
…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.
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