Skip to content

dgb: embedded template transactions[] as caller-supplied SSOT input (Option 1 seam) - #241

Merged
frstrtr merged 1 commit into
masterfrom
dgb/embedded-template-tx-passthrough
Jun 19, 2026
Merged

dgb: embedded template transactions[] as caller-supplied SSOT input (Option 1 seam)#241
frstrtr merged 1 commit into
masterfrom
dgb/embedded-template-tx-passthrough

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 19, 2026

Copy link
Copy Markdown
Owner

What

build_work_template() hardcoded transactions[] to an empty array, baking the "no tx source wired" state into the SSOT. This lifts it to a WorkTemplateInputs field (default empty json array), passed through verbatim — the same truthful-conditional shape previousblockhash already 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 WorkTemplateInputs without setting transactions, so an empty array is still emitted and nothing is fabricated. The fee total is folded into coinbasevalue UPSTREAM via resolve_coinbase_value (#207 SSOT) — the builder never derives the reward.

Fence / posture

  • Fenced to src/impl/dgb/ only — no shared base, no other-coin tree, no build.yml.
  • No consensus VALUE choice in this PR (transactions[] stays empty by default; coinbasevalue unchanged). The fee→coinbasevalue wiring is the NEXT fenced PR, flagged surface-for-tap.
  • p2pool-merged-v36 surface: none.

Tests

dgb_template_builder_test 8/8 (+1 KAT TransactionsPassThroughVerbatim: shaped array round-trips verbatim, unset stays empty), dgb_embedded_coin_node_test 5/5 (default-empty preserved). Both built via build_dgb reconfigure, EXIT=0.

…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).
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