Skip to content

ltc(v36): re-apply F11 canonical donation fold + value-invariance KAT - #349

Merged
frstrtr merged 1 commit into
masterfrom
ltc-doge/f11-reapply-value-invariance-kat
Jun 23, 2026
Merged

ltc(v36): re-apply F11 canonical donation fold + value-invariance KAT#349
frstrtr merged 1 commit into
masterfrom
ltc-doge/f11-reapply-value-invariance-kat

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 23, 2026

Copy link
Copy Markdown
Owner

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 naive payout_outputs(amounts.begin(), amounts.end()). No test guarded the parity arithmetic, so the regression shipped unnoticed — exactly the coverage gap this KAT closes.

What

  • Re-apply F11, factored into build_payout_outputs_excluding_donation(), at generate_share_transaction / create_local_share_v35 / create_local_share. Uses the post-PR-0 params.donation_script_func(36|35) SSOT accessor (not the old PoolConfig:: constants).
  • New KAT src/impl/ltc/test/f11_donation_invariance_test.cpp (5 cases, wired into existing share_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

  • ltc OBJECT lib + share_test build 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-v36 data.py generate_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.

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
frstrtr merged commit b534c85 into master Jun 23, 2026
20 checks passed
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.
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