Skip to content

dgb(phase-b): node-local Redistribute V2 policy port + conformance KAT#307

Merged
frstrtr merged 1 commit into
masterfrom
dgb/phase-b-pool-share
Jun 22, 2026
Merged

dgb(phase-b): node-local Redistribute V2 policy port + conformance KAT#307
frstrtr merged 1 commit into
masterfrom
dgb/phase-b-pool-share

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

Phase B pool/share slice. Ports src/impl/ltc/redistribute.hpp into src/impl/dgb/ (namespace flip only; zero internal ltc:: qualifiers) so the DGB node gains the same --redistribute pubkey-stamping policy as the LTC reference: pplns/fee/boost/donate modes, hybrid weighting, graduated/threshold boost, stratum-password opt-in.

Consensus-safe / node-local: redistribute only chooses the pubkey_hash THIS node stamps into its own shares. Sharechain validation, share codec, and PPLNS math are untouched. No divergence from p2pool-merged-v36 / the frstrtr/p2pool-dgb-scrypt oracle.

3-bucket classification: bucket-2 (v36-native SHARED STRUCTURE). The redistribution policy is cross-coin shared structure ported toward the unified v37 shape, not re-invented per coin.

Scope (fence)

No shared-base / bitcoin_family / ltc / doge / btc touch.

Tests

dgb_redistribute_test 5/5 green locally (Release, COIN_DGB=ON): mode/spec parse, hybrid format round-trip, stratum-password options, FEE/DONATE/empty-PPLNS deterministic pick branches vs documented work.py --redistribute spec (de76224a).

Follow-up (not in this slice)

main_dgb --redistribute arg parsing + Redistributor wiring into the won-block coinbase pubkey selection (mirrors c2pool_refactored.cpp for the ltc binary).

HOLD merge — surfaced for review; integrator merges on operator push approval.

…rmance KAT

Ports src/impl/ltc/redistribute.hpp into src/impl/dgb/ (namespace flip
only; zero internal ltc:: qualifiers) so the DGB node gains the same
--redistribute pubkey-stamping policy as the LTC reference: pplns/fee/
boost/donate modes, hybrid weighting, graduated/threshold boost, and
stratum-password opt-in. Consensus-safe -- only chooses the pubkey_hash
this node stamps into its own shares; sharechain validation is untouched.

This is a bucket-2 v36-native standardization slice: the redistribution
policy is shared cross-coin structure, ported toward the unified v37
shape rather than re-invented per coin. Header surfaced; main_dgb arg
wiring is a follow-up slice.

Adds dgb_redistribute_test (5 KATs) pinning the deterministic surface
-- mode/spec parse, hybrid format round-trip, stratum-password options,
and the FEE/DONATE/empty-PPLNS deterministic pick branches -- vs the
documented p2pool-v36 work.py --redistribute spec. Registered in the
dgb test CMakeLists and BOTH build.yml --target allowlists (#143 trap).
@frstrtr frstrtr merged commit 3326b94 into master Jun 22, 2026
9 checks passed
@frstrtr frstrtr deleted the dgb/phase-b-pool-share branch June 22, 2026 08:28
frstrtr added a commit that referenced this pull request Jun 22, 2026
…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.
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