dgb(phase-b): node-local Redistribute V2 policy port + conformance KAT#307
Merged
Conversation
…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
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.
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.
Summary
Phase B pool/share slice. Ports
src/impl/ltc/redistribute.hppintosrc/impl/dgb/(namespace flip only; zero internalltc::qualifiers) so the DGB node gains the same--redistributepubkey-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_hashTHIS node stamps into its own shares. Sharechain validation, share codec, and PPLNS math are untouched. No divergence fromp2pool-merged-v36/ thefrstrtr/p2pool-dgb-scryptoracle.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)
src/impl/dgb/redistribute.hpp(new, ported)src/impl/dgb/test/redistribute_test.cpp(new, 5 KATs)src/impl/dgb/test/CMakeLists.txt(registerdgb_redistribute_test).github/workflows/build.yml(BOTH --target allowlists, ci: build test_dgb_subsidy in both Linux test jobs (fix master-red NOT_BUILT) #143 trap)No shared-base / bitcoin_family / ltc / doge / btc touch.
Tests
dgb_redistribute_test5/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--redistributearg parsing + Redistributor wiring into the won-block coinbase pubkey selection (mirrorsc2pool_refactored.cppfor the ltc binary).HOLD merge — surfaced for review; integrator merges on operator push approval.