Skip to content

dgb(phase-b): wire --redistribute selector into the won-block payout path (follow-up to #307)#308

Closed
frstrtr wants to merge 1 commit into
dgb/phase-b-pool-sharefrom
dgb/redistribute-arg-wire
Closed

dgb(phase-b): wire --redistribute selector into the won-block payout path (follow-up to #307)#308
frstrtr wants to merge 1 commit into
dgb/phase-b-pool-sharefrom
dgb/redistribute-arg-wire

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Follow-up slice to #307 (Redistribute V2 policy port), per integrator direction: arg parsing + selector into the DGB won-block coinbase pubkey path. Stacked on #307 (consumes src/impl/dgb/redistribute.hpp); retarget to master once #307 lands.

What

  • main_dgb: parse --redistribute SPEC (opt-in), build a configured dgb::Redistributor, bind DGBWorkSource::set_fallback_payout_fn (new producer seam, parallel to set_mint_share_fn). Threaded through run_node().
  • work_source: FallbackPayoutFn seam consumed at the ShareAccept mint branch only when address_to_script(username) yields empty (empty/broken stratum creds). Unbound => byte-identical to before (default run unchanged).
  • donate identity resolves byte-for-byte to the canonical V36 combined-donation P2SH. scriptPubKey is built from the raw 20-byte hash160 — explicitly NOT uint160::GetHex(), which reverses byte order and would stamp a reversed hash (caught by KAT during bring-up).
  • redistribute_test: +3 KAT (arg-spec -> hybrid weights; donate -> byte-identical combined-donation P2SH; fee-without-operator -> fail-safe null). 8/8 green; c2pool-dgb links + --selftest OK.

Safety

  • Node-local, consensus-safe: sharechain validation/codec/PPLNS untouched — only the locally-stamped pubkey on shares this node mints.
  • Fail-safe: empty fallback left empty; unconfigured (null-hash) identity yields no script — never a burn output to the all-zero hash.
  • Per-coin isolation holds: src/impl/dgb/ + src/c2pool/main_dgb.cpp only; no ltc/doge/btc/shared-base touch.
  • Bucket-2 (cross-coin standardization). Payout-adjacent -> surface-for-tap, no self-merge.

Deferred (next slice)

  • pplns/boost/fee script derivation through the generic pick() path (raw-byte conversion already in place; needs identity plumbing + live tracker-walk threading review). Operator payout identity for fee not yet plumbed -> fail-safe null today.

…path

Follow-up to #307 (Redistribute V2 policy port). Threads an opt-in
--redistribute SPEC arg into the DGB run-loop and binds a node-local
fallback payout selector so a share minted from a submission whose
stratum username carries no valid payout address gets its stamped
pubkey chosen by the operator policy instead of being left empty.

- main_dgb: parse --redistribute, build a configured Redistributor,
  bind DGBWorkSource::set_fallback_payout_fn (new producer seam,
  parallel to set_mint_share_fn). Threaded through run_node().
- work_source: FallbackPayoutFn seam consumed at the ShareAccept mint
  branch only when address_to_script(username) yields empty; unbound =
  byte-identical to before (default run unchanged). Fail-safe: an empty
  fallback is left empty; an unconfigured (null-hash) identity yields no
  script -- never a burn output to the all-zero hash.
- donate identity resolves to the canonical V36 combined-donation P2SH;
  scriptPubKey built from the RAW 20-byte hash160 (NOT uint160::GetHex,
  which reverses byte order and would stamp a reversed hash).
- redistribute_test: +3 KAT (arg-spec -> hybrid weights, donate ->
  byte-identical combined-donation P2SH, fee-without-operator fail-safe
  null). 8/8 green; c2pool-dgb links.

Node-local, consensus-safe (sharechain validation/codec/PPLNS
untouched); bucket-2 cross-coin standardization. Payout-adjacent ->
surface-for-tap. pplns/boost/fee script derivation: follow-up slice.
@frstrtr frstrtr marked this pull request as draft June 22, 2026 02:48
@frstrtr frstrtr deleted the branch dgb/phase-b-pool-share June 22, 2026 08:28
@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