Skip to content

dgb(phase-b): wire build_connection_coinbase to PPLNS->coinbase SSOT (producer seam) - #331

Closed
frstrtr wants to merge 1 commit into
dgb/pplns-conn-coinbase-wirefrom
dgb/conn-coinbase-live-wire
Closed

dgb(phase-b): wire build_connection_coinbase to PPLNS->coinbase SSOT (producer seam)#331
frstrtr wants to merge 1 commit into
dgb/pplns-conn-coinbase-wirefrom
dgb/conn-coinbase-live-wire

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Stacked on #330 (dgb/pplns-conn-coinbase-wire). Replaces the empty build_connection_coinbase() stub in DGBWorkSource with a delegation to build_connection_coinbase_from_pplns — the #330 SSOT that itself routes through the single compute_pplns_payout_split() the verifier (generate_share_transaction) uses. A new set_pplns_inputs_fn producer seam supplies the PPLNS weight map (walked from the ShareTracker), ref_hash, subsidy and donation script.

Design:

  • Tracker walk lives in main_dgb (ShareTracker + CoinParams in scope); no sharechain logic leaks into the work source, mirroring set_best_share_hash_fn / set_mint_share_fn.
  • 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).
  • Byte-identity to the verifier holds BY CONSTRUCTION — one payout implementation, not two to keep in sync.

Tests: 3 KATs (empty-until-wired; coinb1/coinb2 byte-identical to the SSOT called directly; nullopt->empty). dgb_work_source_test 26/26 green.

NEXT (follow-on): bind set_pplns_inputs_fn in main_dgb to a tracker-sourced lambda (get_v36_decayed_cumulative_weights / get_cumulative_weights under the tracker lock) + freeze merkle_branches/segwit onto the snapshot.

…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). #329/#330/#331 merged into intermediate stacked bases that never reached master; #333 now carries the full PPLNS delegation end-state (step-1 walk + steps 2-3 verifier + per-connection coinbase + producer seam) as one auditable diff rebased on current master.

@frstrtr frstrtr closed this Jun 22, 2026
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