dgb(phase-b): delegate generate_share_transaction payout split to PPLNS SSOT helper - #329
Merged
Merged
Conversation
…T helper Replace the inline steps 2-3 of the share verification SSOT generate_share_transaction() (PPLNS amount math + consensus output ordering) with a call to coin/pplns_payout_split.hpp compute_pplns_payout_split(). The helper is a verbatim lift of that inline math; delegating collapses the two copies into a single consensus implementation so the per-connection Stratum coinbase assembler and the verifier can never diverge on a payout satoshi. Behavior-neutral by construction (same formulae, finder fee, >=1-sat V36 donation floor + (amount, script) tiebreak, ascending sort truncated to [-4000:]). The helper oracle-vector KAT (dgb_pplns_payout_split_test) pins the values against p2pool-merged-v36; the verifier-path framing tests (dgb_gentx_share_path_test, dgb_gentx_coinbase_test) stay green, proving the share path still emits identical coinbase framing. Stacked on dgb/pplns-payout-split (helper extraction).
frstrtr
force-pushed
the
dgb/pplns-payout-split
branch
from
June 22, 2026 14:17
34726f1 to
fb543dc
Compare
frstrtr
force-pushed
the
dgb/pplns-delegate-verifier
branch
from
June 22, 2026 14:17
57cb51d to
a27a9a8
Compare
frstrtr
added a commit
that referenced
this pull request
Jun 22, 2026
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.
Owner
Author
frstrtr
added a commit
that referenced
this pull request
Jun 23, 2026
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.
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.
Follow-on (1) to #328. Replaces the inline steps 2-3 of the share-verification SSOT generate_share_transaction() (PPLNS amount math + consensus output ordering) with a call to compute_pplns_payout_split(), collapsing the two payout-split copies into ONE consensus implementation.
WHY (per integrator guidance): a parallel reimplementation feeding the per-connection Stratum coinbase is the exact divergence risk to avoid. Delegation makes the helper the single source the verifier itself uses, so emission and verification cannot diverge on a payout satoshi — the byte-identity guarantee is by construction, not by a second test of a second impl.
PROOF:
SCOPE: src/impl/dgb/ only, behavior-neutral (verbatim formulae: V36/pre-V36, 0.5% finder fee, >=1-sat V36 donation floor + (amount,script) tiebreak, ascending sort truncated to [-4000:]).
CONSENSUS-BEARING — touches the verification SSOT. Surface-for-tap; NOT auto-merge. Stacked on #328; retarget to master after #328 lands.
NO wiring into the connection-coinbase path here — that is the separately-tappable follow-on (2).