Skip to content

dgb(phase-b): wire per-connection coinbase payout split to PPLNS SSOT (#327-gated follow-on) - #330

Merged
frstrtr merged 1 commit into
dgb/pplns-delegate-verifierfrom
dgb/pplns-conn-coinbase-wire
Jun 22, 2026
Merged

dgb(phase-b): wire per-connection coinbase payout split to PPLNS SSOT (#327-gated follow-on)#330
frstrtr merged 1 commit into
dgb/pplns-delegate-verifierfrom
dgb/pplns-conn-coinbase-wire

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 22, 2026

Copy link
Copy Markdown
Owner

What

Wires the per-connection Stratum coinbase assembler (build_connection_coinbase_parts, #327) to the PPLNS payout-split SSOT (compute_pplns_payout_split, #328/#329).

New build_connection_coinbase_from_pplns takes the raw PPLNS weight map + subsidy and delegates the amount split to compute_pplns_payout_split() — the SAME helper generate_share_transaction (the share verification path, #329) calls — instead of accepting pre-resolved payout_outputs/donation_amount.

Why

The coinbase a miner hashes per-connection and the coinbase the share check enforces now draw from one payout implementation. Byte-identity on every payout satoshi is a property of the code, not a second test of a second implementation. No inline payout arithmetic reintroduced; pure delegation + field forwarding.

Scope / safety

  • dgb-tree-only (src/impl/dgb/) — per-coin isolation preserved; dgb smoke gate suffices.
  • Consensus path (payout VALUES) → surface-for-tap, no self-merge.
  • 4 delegation-identity KATs added (V36, pre-V36 finder fee, segwit/ref field forwarding, value anchor); dgb_connection_coinbase_test 8/8 green, dgb_pplns_payout_split_test 4/4 green.

Stacking

Stacks on #328#329. Base retargets to master once #329 lands. Ready the instant the stack lands (#327 already on master).

build_connection_coinbase_from_pplns delegates the payout split to
compute_pplns_payout_split() -- the same helper generate_share_transaction
(the share verification path, #329) calls -- instead of taking pre-resolved
payout_outputs/donation_amount. The coinbase a miner hashes per-connection and
the coinbase the share check enforces are now byte-identical on every payout
satoshi by construction: one payout implementation, not two kept in agreement.

Pure delegation + field forwarding into build_connection_coinbase_parts; no
inline payout arithmetic. dgb-tree-only. 4 delegation-identity KATs
(V36, pre-V36 finder fee, segwit/ref forwarding, value anchor); 8/8 green.
Stacks on the #328/#329 PPLNS SSOT stack.
@frstrtr
frstrtr force-pushed the dgb/pplns-delegate-verifier branch from 57cb51d to a27a9a8 Compare June 22, 2026 14:17
@frstrtr
frstrtr force-pushed the dgb/pplns-conn-coinbase-wire branch from 9cea8b7 to 9d1eac2 Compare June 22, 2026 14:17
@frstrtr
frstrtr merged commit 2d9a351 into dgb/pplns-delegate-verifier Jun 22, 2026
23 checks passed
frstrtr added a commit that referenced this pull request Jun 22, 2026
…via producer seam

Replace the empty build_connection_coinbase() stub with a delegation to
build_connection_coinbase_from_pplns (the #330 SSOT that itself routes through
the single compute_pplns_payout_split the verifier calls). A new
set_pplns_inputs_fn producer seam supplies the PPLNS weight map (walked from the
ShareTracker), ref_hash, subsidy and donation script; the tracker walk stays in
main_dgb where the ShareTracker + CoinParams are in scope, so no sharechain logic
leaks into the work source.

Fenced: while the seam is UNBOUND (or returns nullopt) the method is
byte-identical to the pre-wire stub (empty job, no work pushed) -- runtime
behavior is unchanged until main_dgb binds the producer (follow-on slice). The
emitted coinb1/coinb2 are byte-identical to the verifier per a KAT comparing the
wired output to the SSOT called directly with the same inputs.

3 KATs added (empty-until-wired, byte-identical delegation, nullopt->empty);
dgb_work_source_test 26/26 green.
@frstrtr

frstrtr commented Jun 22, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #333 (consolidated to master). This PR merged into an intermediate stacked base that did not reach master; #333 carries the full PPLNS delegation end-state rebased on current master as one auditable diff.

frstrtr added a commit that referenced this pull request Jun 23, 2026
…via producer seam

Replace the empty build_connection_coinbase() stub with a delegation to
build_connection_coinbase_from_pplns (the #330 SSOT that itself routes through
the single compute_pplns_payout_split the verifier calls). A new
set_pplns_inputs_fn producer seam supplies the PPLNS weight map (walked from the
ShareTracker), ref_hash, subsidy and donation script; the tracker walk stays in
main_dgb where the ShareTracker + CoinParams are in scope, so no sharechain logic
leaks into the work source.

Fenced: while the seam is UNBOUND (or returns nullopt) the method is
byte-identical to the pre-wire stub (empty job, no work pushed) -- runtime
behavior is unchanged until main_dgb binds the producer (follow-on slice). The
emitted coinb1/coinb2 are byte-identical to the verifier per a KAT comparing the
wired output to the SSOT called directly with the same inputs.

3 KATs added (empty-until-wired, byte-identical delegation, nullopt->empty);
dgb_work_source_test 26/26 green.
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