feat(bch): author shares at V36 from genesis + fail-loud V35 hash_link tripwire - #652
Merged
Merged
Conversation
…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.
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.
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); V36v36_hash_link_typecarries non-empty extra_data and is oracle-confirmed to represent the coinbase.(b) Fail-loud tripwire: harden
check_hash_linkto throw on the V35 representability class instead of silently miscomputing, guarding the latentFixedStrType(0)case early.Orthogonality
Grind evidence shows the still-open
generate_share_transactionverify-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.hppsrc/impl/bch/share_check.hppNo shared / other-coin trees touched. Consensus-bearing (changes authored share version) → surface-for-operator-merge-tap, NOT auto-merge.
Verification