BTC v36: chain-agnostic core::donation SSOT (delegate BTC) - #139
Merged
Conversation
The donation script bytes are coin-invariant (no network version byte; uniform v36 redeem hash160) yet were duplicated in every per-coin PoolConfig. Per operator FLAG6 re-scope (2026-06-17), the v36 donation must be bitcoin-agnostic. Introduce src/core/donation.hpp as the single source of truth and delegate btc::PoolConfig::get_donation_script() to it, removing the per-coin DONATION_SCRIPT / COMBINED_DONATION_SCRIPT arrays. Pure refactor: identical bytes, all call sites unchanged (they route via get_donation_script). c2pool-btc builds green. Cross-coin follow-up will migrate ltc/doge/bch/dgb to the same delegate.
frstrtr
added a commit
that referenced
this pull request
Jun 23, 2026
Mirror of LTC v36 commit 18dd945 onto the BTC variant. All three gentx sites (generate_share_transaction / create_local_share_v35 / create_local_share) now exclude BOTH donation scripts (COMBINED + P2PK) from per-miner payout dests and fold the COMBINED_DONATION_SCRIPT-keyed weight into the single donation-last output. Rides core/donation.hpp SSOT (FLAG6 #139). No F1 entanglement (F11 touches only the payout-sort path). Prep-branch staging; PR stays unopened until integrator dispatches the F-mirror post crossing-soak (#97). +51/-6, matches LTC F11 line counts.
frstrtr
added a commit
that referenced
this pull request
Jun 23, 2026
Mirror of LTC v36 commit 18dd945 onto the BTC variant. All three gentx sites (generate_share_transaction / create_local_share_v35 / create_local_share) now exclude BOTH donation scripts (COMBINED + P2PK) from per-miner payout dests and fold the COMBINED_DONATION_SCRIPT-keyed weight into the single donation-last output. Rides core/donation.hpp SSOT (FLAG6 #139). No F1 entanglement (F11 touches only the payout-sort path). Prep-branch staging; PR stays unopened until integrator dispatches the F-mirror post crossing-soak (#97). +51/-6, matches LTC F11 line counts.
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.
What
Introduces
src/core/donation.hppas the chain-agnostic single source of truth for the c2pool donation script, and delegatesbtc::PoolConfig::get_donation_script()to it. Removes the per-coinDONATION_SCRIPT/COMBINED_DONATION_SCRIPTarrays from the BTC PoolConfig.Why
The donation script bytes are coin-invariant — no network version byte, and the v36 P2SH redeem hash160 (8c627262..8e85) is uniform across btc/ltc/bch/dgb. Only the base58 rendering differs per coin prefix, never the committed script. They were nonetheless duplicated in each per-coin PoolConfig. Per the operator FLAG6 re-scope (2026-06-17), the v36 donation must be bitcoin-agnostic; the defect was ownership living in a per-coin namespace, not the content.
Scope / safety
get_donation_script(); the only external references to the array names are comments.c2pool-btcbuilds green.Follow-up (cross-coin, separate PR)
Migrate ltc/doge/bch/dgb PoolConfigs to delegate to
core::donationand delete their duplicate arrays. BTC-first here to keep the diff reviewable; cross-coin touches LTC namespace (ltc-doge lane).