ltc(v36): re-apply F11 canonical donation fold + value-invariance KAT - #349
Merged
Merged
Conversation
PR-0 S1 (133ae6b) overwrote the original F11 (18dd945) on a stale base, silently reverting the canonical exclude-then-append donation handling in all three LTC gentx sites back to the naive payout_outputs(amounts...) form. No test guarded the parity arithmetic, so the regression shipped unnoticed. - Factor the fold into build_payout_outputs_excluding_donation() and re-apply at generate_share_transaction / create_local_share_v35 / create_local_share, via the params.donation_script_func SSOT (post-PR-0 accessor). - Add test/f11_donation_invariance_test.cpp: value invariance (per-miner outputs + donation-last == subsidy), COMBINED weight folds into the donation output, both donation scripts excluded from per-miner dests, the P2PK-drop boundary, and pins the real consensus donation bytes. Behavior-restoring for LTC v36 payouts; matches p2pool-merged-v36 data.py generate_transaction. Held for operator merge-tap.
frstrtr
added a commit
that referenced
this pull request
Jun 23, 2026
Mirror ltc-doge #349 (31a0c2e): factor the canonical exclude-then-append donation handling at the three gentx sites into build_payout_outputs_excluding_donation(), and guard the parity arithmetic with a 5-case value-invariance KAT (BTC_F11_DonationInvariance) — the test shape that backfills the coverage gap which let PR-0 S1 silently revert LTC F11. KAT over core::donation SSOT constants: (a) value invariance, (b) COMBINED weight folds into donation-last, (c) both donation scripts excluded from per-miner dests, (d) P2PK-drop boundary (value-neutral iff P2PK weight==0), (e) real-consensus-bytes pin (23B P2SH / 67B P2PK). Wire share_test.cpp as btc_share_test (twin of ltc share_test, uniquely named to avoid the CMP0002 collision; btc had no live share_test - B0-deferred). Add btc_share_test to build.yml --target allowlist; drift-guard green (67). 5/5 KAT + 6/6 btc_share_test suite local-green.
frstrtr
added a commit
that referenced
this pull request
Jun 23, 2026
Mirror ltc-doge #349 (31a0c2e): factor the canonical exclude-then-append donation handling at the three gentx sites into build_payout_outputs_excluding_donation(), and guard the parity arithmetic with a 5-case value-invariance KAT (BTC_F11_DonationInvariance) — the test shape that backfills the coverage gap which let PR-0 S1 silently revert LTC F11. KAT over core::donation SSOT constants: (a) value invariance, (b) COMBINED weight folds into donation-last, (c) both donation scripts excluded from per-miner dests, (d) P2PK-drop boundary (value-neutral iff P2PK weight==0), (e) real-consensus-bytes pin (23B P2SH / 67B P2PK). Wire share_test.cpp as btc_share_test (twin of ltc share_test, uniquely named to avoid the CMP0002 collision; btc had no live share_test - B0-deferred). Add btc_share_test to build.yml --target allowlist; drift-guard green (67). 5/5 KAT + 6/6 btc_share_test suite local-green.
frstrtr
added a commit
that referenced
this pull request
Jun 23, 2026
…iance-kat ltc(v36): re-apply F11 canonical donation fold + value-invariance KAT
frstrtr
added a commit
that referenced
this pull request
Jun 23, 2026
Mirror ltc-doge #349 (31a0c2e): factor the canonical exclude-then-append donation handling at the three gentx sites into build_payout_outputs_excluding_donation(), and guard the parity arithmetic with a 5-case value-invariance KAT (BTC_F11_DonationInvariance) — the test shape that backfills the coverage gap which let PR-0 S1 silently revert LTC F11. KAT over core::donation SSOT constants: (a) value invariance, (b) COMBINED weight folds into donation-last, (c) both donation scripts excluded from per-miner dests, (d) P2PK-drop boundary (value-neutral iff P2PK weight==0), (e) real-consensus-bytes pin (23B P2SH / 67B P2PK). Wire share_test.cpp as btc_share_test (twin of ltc share_test, uniquely named to avoid the CMP0002 collision; btc had no live share_test - B0-deferred). Add btc_share_test to build.yml --target allowlist; drift-guard green (67). 5/5 KAT + 6/6 btc_share_test suite local-green.
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.
Why
While backfilling the F11 value-invariance KAT (integrator task, parity with the BTC F11 mirror), I found the F11 code is no longer on master. PR-0 S1 (
133ae6bc, CoinParams parameterization) merged after F11 (18dd9457) and, on a stale base, silently reverted the canonical exclude-then-append donation handling at all three LTC gentx sites back to the naivepayout_outputs(amounts.begin(), amounts.end()). No test guarded the parity arithmetic, so the regression shipped unnoticed — exactly the coverage gap this KAT closes.What
build_payout_outputs_excluding_donation(), atgenerate_share_transaction/create_local_share_v35/create_local_share. Uses the post-PR-0params.donation_script_func(36|35)SSOT accessor (not the oldPoolConfig::constants).src/impl/ltc/test/f11_donation_invariance_test.cpp(5 cases, wired into existingshare_test— no new build.yml target): value invariance (per-miner outputs + donation-last == subsidy), COMBINED weight folds into the donation-last output, both donation scripts excluded from per-miner dests, the P2PK-drop boundary proof, and pins the real consensus donation bytes.Verification
ltcOBJECT lib +share_testbuild clean (Linux x86_64).share_test: 6/6 pass (existing Init + 5 F11 KAT). The KAT fails by construction if the fold is absent (size 3 vs 4, donation 575 vs 535).Behavior-restoring for LTC v36 payouts; matches
p2pool-merged-v36data.pygenerate_transaction. Consensus payout path — held for operator merge-tap; no self-merge. Source of truth for the BTC F11 mirror (btc/f11-donation-exclude); portable KAT shape coordinated with btc-heap-opt.