dgb: embedded template transactions[] as caller-supplied SSOT input (Option 1 seam) - #241
Merged
Merged
Conversation
…SOT seam) build_work_template() hardcoded transactions[] to an empty array, baking the "no tx source wired" state into the SSOT itself. Lift it to a WorkTemplateInputs field (default empty json array) and pass it through verbatim, mirroring the truthful-conditional shape previousblockhash already holds. Behaviour is byte-identical today: the embedded node and stratum work source both construct WorkTemplateInputs without setting transactions, so an empty array is still emitted and nothing is fabricated. The fee total those txs carry is folded into coinbasevalue UPSTREAM via resolve_coinbase_value (#207 SSOT) -- the builder never derives the reward, so this field is display-only shape. This opens the seam for the follow-up mempool-source slice (get_sorted_txs_with_fees -> transactions[] + fee->coinbasevalue) without re-touching the SSOT. Fenced to src/impl/dgb/ only; no shared base, no other-coin tree, no build.yml. +1 KAT (TransactionsPassThroughVerbatim): a shaped array round-trips verbatim, an unset input stays an empty array. dgb_template_builder_test 8/8, dgb_embedded_coin_node_test 5/5 (default-empty preserved).
This was referenced Jun 19, 2026
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
build_work_template()hardcodedtransactions[]to an empty array, baking the "no tx source wired" state into the SSOT. This lifts it to aWorkTemplateInputsfield (default empty json array), passed through verbatim — the same truthful-conditional shapepreviousblockhashalready holds.Why
This is the SSOT seam for Option 1 (embedded mempool tx selection). The DGB mempool already exposes
get_sorted_txs_with_fees(max_weight); the only missing piece is a layer that feeds its output into the template. Doing the seam first (here) keeps that follow-up from re-touching the pure SSOT and isolates the consensus-value change (fees → coinbasevalue) into its own slice.Behaviour
Byte-identical today: the embedded node and stratum work source both build
WorkTemplateInputswithout settingtransactions, so an empty array is still emitted and nothing is fabricated. The fee total is folded intocoinbasevalueUPSTREAM viaresolve_coinbase_value(#207 SSOT) — the builder never derives the reward.Fence / posture
src/impl/dgb/only — no shared base, no other-coin tree, nobuild.yml.Tests
dgb_template_builder_test8/8 (+1 KATTransactionsPassThroughVerbatim: shaped array round-trips verbatim, unset stays empty),dgb_embedded_coin_node_test5/5 (default-empty preserved). Both built viabuild_dgbreconfigure, EXIT=0.