dgb: end-to-end GBT-parity KAT for embedded coinbasevalue - #274
Merged
Conversation
Pin the assembled embedded coinbase-value path: a populated Mempool driven
through the production make_mempool_tx_source -> EmbeddedCoinNode ->
build_work_template wiring (main_dgb.cpp:233) must emit
coinbasevalue == subsidy(next_height) + sum(included-tx fees)
at every DGB reward era -- bit-for-bit the figure digibyted getblocktemplate
reports. The prior tests pinned each link in isolation (tx-select shaping,
stub-source fee fold, work-source era subsidy); none pinned the assembled
chain equals GBT. Also pins behaviour-preserving displacement (embedded ==
GBT-present path when they agree) and the HARD INVARIANT that a present GBT
coinbasevalue stays authoritative verbatim.
Test-only, non-consensus: subsidy oracle is dgb::CoinParams::subsidy
(p2pool-dgb-scrypt replica). Links the full dgb_coin codec like
dgb_embedded_tx_select_test; added to CMake + both build.yml --target
allowlists (#143 NOT_BUILT trap). 4/4 PASS.
frstrtr
force-pushed
the
dgb/coinbasevalue-gbt-parity-kat
branch
from
June 20, 2026 17:10
5ce02f5 to
fd1e407
Compare
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.
What
End-to-end GBT-parity KAT for the embedded coinbasevalue. Drives a populated embedded
Mempoolthrough the productionmake_mempool_tx_source -> EmbeddedCoinNode -> build_work_templatewiring (exactlysrc/c2pool/main_dgb.cpp:233) and asserts the emitted template coinbasevalue is bit-for-bit the figure digibytedgetblocktemplatereports:across every DGB reward era (the captured p2pool-dgb-scrypt oracle vectors).
Why this slice
The existing tests pin each link in isolation:
dgb_embedded_tx_select_test—make_mempool_tx_sourceshaping + fee sumdgb_embedded_coin_node_test— a stub tx source folds fees into coinbasevaluedgb_work_source_test— stratum path era subsidy + GBT-verbatimNone pinned the assembled chain equals GBT. Per integrator (2026-06-20), before the embedded subsidy+fees derivation may stand in for the external-daemon GBT
coinbasevalue, parity must be KAT'd as EXACTLY equal.GBT-parity verified: for every era boundary the populated-mempool embedded coinbasevalue equals
oracle_subsidy + total_fees— the digibyted GBT figure — bit-for-bit. The KAT also pins:resolve_coinbase_valuewith the GBT figure present, when they agree;Scope / safety
src/impl/dgb/test/. Auto-mergeable per fenced-slice rules.dgb::CoinParams::subsidy(bit-for-bit p2pool-dgb-scrypt replica).dgb_coincodec likedgb_embedded_tx_select_test; new target added to CMake + bothbuild.yml --targetallowlists (ci: build test_dgb_subsidy in both Linux test jobs (fix master-red NOT_BUILT) #143 NOT_BUILT trap).