Skip to content

feat(bch): author shares at V36 from genesis + fail-loud V35 hash_link tripwire - #652

Merged
frstrtr merged 1 commit into
masterfrom
bch/v36-author-verify-preimage
Jul 9, 2026
Merged

feat(bch): author shares at V36 from genesis + fail-loud V35 hash_link tripwire#652
frstrtr merged 1 commit into
masterfrom
bch/v36-author-verify-preimage

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

Standalone V36-native authoring slice, split out of the verify-preimage reroot per integrator guidance (two distinct root causes → two commits). Fenced entirely to src/impl/bch/.

(a) Author BCH shares at V36 from genesis (closes the deferred ratchet slice). The prior V35 authoring used FixedStrType(0) hash_link, whose empty extra_data cannot carry a coinbase where bufsize (55) exceeds const_ending (47); V36 v36_hash_link_type carries non-empty extra_data and is oracle-confirmed to represent the coinbase.

(b) Fail-loud tripwire: harden check_hash_link to throw on the V35 representability class instead of silently miscomputing, guarding the latent FixedStrType(0) case early.

Orthogonality

Grind evidence shows the still-open generate_share_transaction verify-preimage residual is IDENTICAL with and without (a) — V36 authoring does not interact with that root cause. This PR is proven, green, and signed; it is split to keep clean bisect/attribution from the eventual verify-time fix (separate PR).

Fence

  • src/impl/bch/pool_entrypoint.hpp
  • src/impl/bch/share_check.hpp

No shared / other-coin trees touched. Consensus-bearing (changes authored share version) → surface-for-operator-merge-tap, NOT auto-merge.

Verification

  • Dual-version coinbase_author KAT: PASS
  • Regtest grind 13/13 accepted, 0 rejected; bad-coinbase throws 0
  • GPG-signed 285EFE76 (good sig)

…k guard

Flip the create-version selection to V36 (three sites in pool_entrypoint.hpp:
ref_hash genesis version, ref-param default, create_ver) so the BCH v36-native
sharechain is authored uniformly at V36. BCH v36 is a brand-new sharechain with
no legacy V35 shares, so share_ver==parent_version on every share and the
60%-by-work upgrade accept-gate never fires -- closing the deferred ratchet slice
the create-block comment flagged as follow-up.

Harden prefix_to_hash_link_v35: throw when the V35 FixedStrType(0) hash_link
would silently drop non-empty extra_data (partial SHA-256 block exceeds the
const_ending tail), which would make check_hash_link recompute a different
coinbase txid than the author committed. Refuse to forge an unrepresentable V35
hash_link instead of emitting a mismatching preimage.

Fenced to src/impl/bch/ only (no src/core / bitcoin_family). Regtest grind:
shares now author ver=36 (was 35), 13/13 accepted, zero create-share throws,
guard dormant (correctly never fires at V36). NOTE: verify-preimage recompute
residual persists version-independently -- rerooted to the generate_share_transaction
rebuild path, tracked separately.
@frstrtr
frstrtr merged commit 1626cf1 into master Jul 9, 2026
26 checks passed
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