Skip to content

dash(launcher): block PRODUCER -- won-block to dashd submitblock arm (regtest crossing PROVEN) - #428

Closed
frstrtr wants to merge 4 commits into
masterfrom
dash/launcher-mineblock-slice5
Closed

dash(launcher): block PRODUCER -- won-block to dashd submitblock arm (regtest crossing PROVEN)#428
frstrtr wants to merge 4 commits into
masterfrom
dash/launcher-mineblock-slice5

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

Launcher slices 3/4/5 for the DASH lane, rebased clean onto master (rebase --onto origin/master f2fb646 -- slices 1/2 superseded by merged #398, so replaying only 3/4/5 avoids dragging stale diff + main_dash.cpp conflicts). Resolved main_dash.cpp toward the #398 launcher run-loop; node_interface.hpp toward master #401 seam (SSOT, already carries known_txs); build.yml + test/CMakeLists target-lists are additive unions.

Delivers the dashd submitblock fallback arm of the won-block path:

  • slice 3: external-dashd-RPC NodeRPC client (rpc.cpp/hpp, rpc_conf.hpp, rpc_request.hpp) + request-shape KAT
  • slice 4: submitblock wired into main_dash --run run-loop; creds from dash.conf; --submit-block one-shot lever + rpc_conf KAT
  • slice 5: block PRODUCER -- merkle fold + X11-mine + full-block serialize -> submitblock
  • fixup (17be1f4): BIP34 height OP_N form (0->OP_0, 1..16->OP_1..OP_16) for low regtest heights -- regtest blocks 1-16 were rejected bad-cb-height before this. Plus a height<=16 KAT (Bip34HeightOpNForm) so the OP_N path cannot silently regress (per integrator review).

Crossing evidence -- regtest submitblock ACCEPTED

c2pool-dash serialized+submitted a real X11-mined block; dashd ACCEPTED it: getbestblockhash = 28e1b366... equals the submitted block, getblockcount 6->7, confirmations 1. Accepting-daemon ack, not a self-reported green.

Scope / gate

Single-coin DASH: src/impl/dash/ + src/c2pool/main_dash.cpp only -- no src/core, no bitcoin_family -> DASH smoke gate suffices.

NOT block-viable yet

This proves the submitblock-RPC arm ONLY. Per the dual-path gate, DASH is NOT block-viable until the embedded-P2P on_block_found->broadcast leg (S8 broadcaster) is also wired+verified. dashd-RPC fallback is kept, never removed.

Tests

ctest -R DashBlockProducer 9/9 green on Linux x86_64 (incl. new BIP34 KAT), non-hollow. Full CI rollup deferred to integrator verify.

Held for integrator full-rollup verify -> operator merge tap. No self-merge.

frstrtr added 4 commits June 24, 2026 19:26
…lback (launcher slice 3)

Ports a real boost::beast + jsonrpccxx HTTP JSON-RPC client to an external
dashd into src/impl/dash/coin/rpc.{hpp,cpp}, modeled on the ltc/bch/dgb
NodeRPC and conformed to DASH: X11 with no segwit, so getblocktemplate
carries a plain body (NO algo param, NO injected segwit rule -- the key
DASH<->DGB divergence); rich DashWorkData getwork(); DASH mainnet/testnet
genesis-hash identity probe in check(); submit_block_hex() is the dashd
submitblock fallback leg of the won-block dual-path broadcaster.

SAFE-ADDITIVE: dash_rpc is an additive static lib linked ONLY by
c2pool-dash; ltc/btc/doge/dgb build + ctest surfaces untouched. Per-coin
isolation held (src/impl/dash only, no shared/core source edit, dashd RPC
fallback preserved). test_dash_rpc_request pins the RPC request-shape SSOT
(version floor, no-segwit GBT body, genesis identity) and is added to both
build.yml --target lists. Embedded-P2P relay leg of the broadcaster stays
DEFERRED to a later slice.
…er slice 4)

Replace the run_node deferral stub with a real run-loop that ARMs the
external-dashd NodeRPC submitblock fallback (slice-3 rpc.cpp). Creds come
from dash.conf (rpcpassword never on argv); --coin-rpc carries only the
endpoint. --submit-block[-file] drives one real submitblock then exits --
the G2 won-block-reaches-network evidence lever against VM200/201 dashd.
Embedded P2P relay leg stays S8. New rpc_conf KAT (5/5) covers creds parse,
endpoint override, and armed() gating. dashd-RPC fallback preserved.
…serialize -> submitblock arm

The c2pool-dash-builds-and-wins-the-block-itself lever. Slice 3/4 only
re-submitted a pre-built hex; slice 5 is the net-new producer:
block_producer.hpp folds the merkle root over [coinbase_txid]+gbt_txs,
serializes the 80-byte X11 header, mines the nonce to the compact-bits
target, serializes the FULL block (header || CompactSize(ntx) || coinbase
|| txs), and feeds the hex into the EXISTING NodeRPC::submit_block_hex arm.

main_dash.cpp gains --mine-block (one-shot producer): getwork -> coinbase
build -> X11-mine -> submitblock, creds from dash.conf (never argv).

Scope: header-only, src/impl/dash + main_dash.cpp only; no src/core or
bitcoin_family edit. Exercises the submitblock-RPC arm (one of two
block-viability legs; embedded P2P broadcast is the other). dashd-RPC
fallback untouched. test_dash_block_producer 8/8 (network-free, merkle
KATs use an independent in-test reference fold), wired into both build.yml
--target lists.
push_bip34_height encoded heights 1..16 as a CScriptNum data push, but
dashd ContextualCheckBlock expects the canonical CScript()<<nHeight form:
0->OP_0, 1..16->OP_1..OP_16 (single opcode), else minimal data push. The
data-push branch only matched for heights >16 (why realistic-height KATs
passed); regtest blocks 1-16 were rejected bad-cb-height. Proven: c2pool-dash
mined+submitted regtest block 7, dashd ACCEPTED, tip 6->7.
@frstrtr
frstrtr force-pushed the dash/launcher-mineblock-slice5 branch from daf64b8 to fa2c6d4 Compare June 24, 2026 19:29
@frstrtr

frstrtr commented Jun 24, 2026

Copy link
Copy Markdown
Owner Author

Closing as duplicate. #453 is the canonical G3a POPULATED block-producer deliverable (integrator-adjudicated 2026-06-24): freshest base, slice-granular, GPG-good, 24/24 non-hollow KATs, scope grep-verified single-coin. #428 is a byte-identical dup on a stale base.

@frstrtr frstrtr closed this Jun 24, 2026
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