Skip to content

bch: gate work-source donation script on v36 (P2SH) — close recompute/GENTX residual - #653

Closed
frstrtr wants to merge 1 commit into
bch/v36-author-verify-preimagefrom
bch/v36-worksource-donation-gate
Closed

bch: gate work-source donation script on v36 (P2SH) — close recompute/GENTX residual#653
frstrtr wants to merge 1 commit into
bch/v36-author-verify-preimagefrom
bch/v36-worksource-donation-gate

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Stacks on #652 (bch/v36-author-verify-preimage). Fences to src/impl/bch/pool_entrypoint.hpp only.

Root (byte-diff)

Shares author v36-native (result.share_version=36), and generate_share_transaction rebuilds the coinbase donation with get_donation_script(36) -> 23-byte COMBINED P2SH. The work source still served get_donation_script(35) -> 67-byte forrestv P2PK. The miner-hashed template coinbase and the verify-side rebuild therefore diverged at the donation output:

  • First diverging byte offset 104 (donation scriptPubKey length byte)
  • author/miner cb: 0x43 -> P2PK 4104..ac (67B, forrestv legacy)
  • verify rebuild: 0x17 -> P2SH a9148c6272..87 (23B, v36 COMBINED)

=> 100 percent recompute/GENTX mismatch on every non-genesis share (genesis is 100-percent-donation single-output, structurally different).

Fix

One line: work_source->set_donation_script(get_donation_script(36)) to match authored version.

Evidence (regtest grind, demo floors 207fffff/1d00ffff)

  • 12/12 accepted, 0 rejected
  • GENTX-MISMATCH 10 -> 0
  • HASHLINK-CMP 11 YES / 1 NO (the NO is genesis, expected)
  • chain==verified 12/12 (1:1)
  • author [ACTUAL-CB] now byte-matches verify [COINBASE-HEX] (both P2SH donation)

Attribution-clean, GPG-signed 285EFE76. NOT self-merged — operator merge-tap.

… version

Shares are authored v36-native (pool_entrypoint result.share_version=36),
and generate_share_transaction rebuilds the coinbase donation with
get_donation_script(36) -> 23-byte COMBINED P2SH. The work source still
served get_donation_script(35) -> 67-byte forrestv P2PK, so the
miner-hashed template coinbase and the verify-side rebuild diverged at the
donation output (first diverging byte offset 104: script-len 0x43 P2PK vs
0x17 P2SH) on every non-genesis share -> 100 percent recompute/GENTX
mismatch. Gate the work-source donation on 36 to match.

Regtest grind 12/12 accepted, GENTX-MISMATCH 10->0, chain==verified 12/12,
author coinbase now byte-matches verify rebuild.
@frstrtr

frstrtr commented Jul 10, 2026

Copy link
Copy Markdown
Owner Author

Closing: sole commit f049bd7 is already in origin/master (landed via the #652/#654 stack merge 2026-07-09 16:00). Base ref bch/v36-author-verify-preimage is an orphaned feature branch, not master; merging here would not touch master. Content confirmed present — redundant PR. Reopen if this analysis is wrong.

@frstrtr frstrtr closed this Jul 10, 2026
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