dgb(#82): DGBWorkSource IWorkSource Stage-4a skeleton — miner-facing path - #186
Merged
Conversation
…path Concrete dgb::stratum::DGBWorkSource bridges the coin-agnostic core::StratumServer to DGB-Scrypt work generation + share validation, mirroring btc::stratum::BTCWorkSource's 4a landing. Skeleton compiles, instantiates over the live coin deps, and pins the full IWorkSource contract so the StratumServer wiring in main_dgb.cpp can be validated end-to-end before the substantive logic lands. All work-generation getters return documented empty/default forms; mining_submit rejects every submission as low-difficulty WITHOUT reaching the won-block broadcaster; compute_share_difficulty returns the 0.0 not-yet sentinel (vardiff hard-reject — no garbage diff leaks). The real scrypt_1024_1_1_256 assembly + share-classification hot path land in 4b/4c/4d. dgb_work_source_test: 10/10 PASS (IWorkSource contract + atomics + worker registry + stub-safety + sentinel). Wired into dgb_dgb CMake + BOTH build.yml --target allowlists (#143 NOT_BUILT trap avoided). Single-coin, no shared-base/bitcoin_family touch, no -DAUX_DOGE.
frstrtr
force-pushed
the
dgb/stratum-work-source-skeleton
branch
from
June 19, 2026 08:03
4d51798 to
93c105b
Compare
frstrtr
added a commit
that referenced
this pull request
Jun 19, 2026
…RPC arm wired Stacks on the run-loop (#182 spine + node-construct) and the DGBWorkSource 4a skeleton (#186): closes the SEAM both left for "stand the Stratum work source up + bind the won-block broadcaster." --run now constructs the miner-facing path on the run-loop io_context: - c2pool::dgb::HeaderChain + dgb::coin::Mempool (MVP-unwired this slice — the 4a work source returns default work; mining_submit low-diff-rejects via the 0.0 compute_share_difficulty sentinel BEFORE the broadcaster, so no garbage block is ever emitted) - dgb::coin::CoinNode(nullptr,nullptr) + a SubmitBlockFn bridging block_bytes -> hex -> submit_block_hex (rpc.cpp:387, REAL not a stub): the submitblock-RPC arm of the #82 dual-path broadcaster. has_rpc()==false => returns false LOUDLY (the #163 seam guard: no silent drop). - dgb::stratum::DGBWorkSource + core::StratumServer, gated on a new --stratum [HOST:]PORT flag (mirrors main_btc.cpp). Acceptor lifecycle is wired into the signal_set handler: stratum stop() runs BEFORE ioc.stop() so live miner sessions close cleanly. CMake: link c2pool-dgb against dgb_stratum. Single-coin (no bitcoin_family / src/core touch); core::StratumServer consumed, not modified. No -DAUX_DOGE. Remaining for the #82 closer (NEXT slice): the embedded P2P-relay arm (m_on_block_found -> reconstruct_won_block -> broadcast_won_block) needs the reconstructor stack (#163/#166/#167/#177), HELD off master. Two-arm independent broadcast evidence captured once both arms are live. Build EXIT=0; --run --stratum 127.0.0.1:5022 smoke: StratumServer started, sharechain peer on 5024, SIGINT -> ordered graceful shutdown (stratum stop then clean exit), EXIT=0.
frstrtr
added a commit
that referenced
this pull request
Jun 19, 2026
…RPC arm wired Stacks on the run-loop (#182 spine + node-construct) and the DGBWorkSource 4a skeleton (#186): closes the SEAM both left for "stand the Stratum work source up + bind the won-block broadcaster." --run now constructs the miner-facing path on the run-loop io_context: - c2pool::dgb::HeaderChain + dgb::coin::Mempool (MVP-unwired this slice — the 4a work source returns default work; mining_submit low-diff-rejects via the 0.0 compute_share_difficulty sentinel BEFORE the broadcaster, so no garbage block is ever emitted) - dgb::coin::CoinNode(nullptr,nullptr) + a SubmitBlockFn bridging block_bytes -> hex -> submit_block_hex (rpc.cpp:387, REAL not a stub): the submitblock-RPC arm of the #82 dual-path broadcaster. has_rpc()==false => returns false LOUDLY (the #163 seam guard: no silent drop). - dgb::stratum::DGBWorkSource + core::StratumServer, gated on a new --stratum [HOST:]PORT flag (mirrors main_btc.cpp). Acceptor lifecycle is wired into the signal_set handler: stratum stop() runs BEFORE ioc.stop() so live miner sessions close cleanly. CMake: link c2pool-dgb against dgb_stratum. Single-coin (no bitcoin_family / src/core touch); core::StratumServer consumed, not modified. No -DAUX_DOGE. Remaining for the #82 closer (NEXT slice): the embedded P2P-relay arm (m_on_block_found -> reconstruct_won_block -> broadcast_won_block) needs the reconstructor stack (#163/#166/#167/#177), HELD off master. Two-arm independent broadcast evidence captured once both arms are live. Build EXIT=0; --run --stratum 127.0.0.1:5022 smoke: StratumServer started, sharechain peer on 5024, SIGINT -> ordered graceful shutdown (stratum stop then clean exit), EXIT=0.
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.
#82 miner-facing path — DGBWorkSource (IWorkSource) Stage 4a skeleton
Concrete
dgb::stratum::DGBWorkSource : core::stratum::IWorkSourcebridging the coin-agnosticcore::StratumServerto DGB-Scrypt work generation + share validation. 1:1 mirror ofbtc::stratum::BTCWorkSource's own 4a landing.Scope (skeleton — intentionally non-functional but real-compiling):
mining_submitrejects every submission as low-difficulty WITHOUT reaching the won-block broadcaster (4d).compute_share_difficultyreturns the 0.0 not-yet sentinel — vardiff gate hard-rejects, no garbage diff leaks into the rate monitor before the realscrypt_1024_1_1_256assembly (4b/4c).Tests:
dgb_work_source_test10/10 PASS — IWorkSource contract, work-generation atomics, worker registry round-trip, stub-safety (broadcaster not reached), and the diff sentinel. Wired intodgbCMake + BOTHbuild.yml --targetallowlists (#143 NOT_BUILT trap avoided).Isolation: single-coin (
src/impl/dgb/only), no shared-base /bitcoin_familytouch, no-DAUX_DOGE.Sequencing: next stacked slice = stand the StratumServer up in
main_dgb.cppover this work source, then bindmake_on_block_found(reconstruct_won_block, p2p_sink)intom_on_block_foundAND wire the RPC arm (rpc.cpp:387) — closing #82's dual-path gate (won-block-reaches-network on BOTH embedded P2P relay + submitblock RPC fallback).HOLD merge — integrator merges on operator
push approved. Land #183 (storage net_name conform) first per the per-coin isolation invariant.