Skip to content

dgb(phase-b): delegate generate_share_transaction payout split to PPLNS SSOT helper - #329

Merged
frstrtr merged 1 commit into
dgb/pplns-payout-splitfrom
dgb/pplns-delegate-verifier
Jun 22, 2026
Merged

dgb(phase-b): delegate generate_share_transaction payout split to PPLNS SSOT helper#329
frstrtr merged 1 commit into
dgb/pplns-payout-splitfrom
dgb/pplns-delegate-verifier

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 22, 2026

Copy link
Copy Markdown
Owner

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:

  • helper oracle KAT dgb_pplns_payout_split_test (4/4) pins values vs p2pool-merged-v36 data.py.
  • verifier-path framing tests dgb_gentx_share_path_test (4/4) + dgb_gentx_coinbase_test (3/3) stay green => share path still emits identical coinbase framing.
  • dgb_share_test 26/26. Build EXIT=0.

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

…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
frstrtr force-pushed the dgb/pplns-payout-split branch from 34726f1 to fb543dc Compare June 22, 2026 14:17
@frstrtr
frstrtr force-pushed the dgb/pplns-delegate-verifier branch from 57cb51d to a27a9a8 Compare June 22, 2026 14:17
@frstrtr
frstrtr merged commit 45bee7b into dgb/pplns-payout-split Jun 22, 2026
23 checks passed
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.
@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
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.
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