dash(launcher): block PRODUCER -- won-block to dashd submitblock arm (regtest crossing PROVEN) - #428
Closed
frstrtr wants to merge 4 commits into
Closed
dash(launcher): block PRODUCER -- won-block to dashd submitblock arm (regtest crossing PROVEN)#428frstrtr wants to merge 4 commits into
frstrtr wants to merge 4 commits into
Conversation
frstrtr
force-pushed
the
dash/launcher-mineblock-slice5
branch
from
June 24, 2026 13:09
17be1f4 to
daf64b8
Compare
…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
force-pushed
the
dash/launcher-mineblock-slice5
branch
from
June 24, 2026 19:29
daf64b8 to
fa2c6d4
Compare
Owner
Author
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.
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:
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.