[BCH] G2 ratchet gate-logic KAT — fenced rig-free SIM pinning the 60%-by-work version-switch accept gate - #577
Merged
Merged
Conversation
Fenced, additive, rig-free known-answer test for the BCH G2 staged 1-by-1
miner-migration gate. Pins the canonical 60%-by-WORK version-switch ACCEPT
gate that bch::check_share enforces inline (src/impl/bch/share_check.hpp:1774):
if (new_ver_weight * 100 < total_weight * 60)
throw "switch without enough hash power upgraded";
via a verbatim replica of the live tail-guard (same non-circular localisation
btc/DGB use; guard stays inline, no lifted SSOT). Arms the staged-migration
rows without a SHA256d bitaxe rig.
Properties pinned (15 asserts, all green):
- 60%-by-WORK boundary at the exact crossing (59 hold / 60-100 pass / 0 hold)
- mint-cannot-outrun-accept (#288): 95%-by-COUNT under heterogeneous hashrate
can NOT outrun the 60%-by-work gate -> a minted V36 boundary share its peers
would reject is prevented
- work-weighted NOT flat-count (#290/#326 regression guard): gate diverges
from a head-count in both directions; #326 dropped the 95%-flat-count punish
- monotonic staged migration: 5 equal-work miners, tally advances monotone,
accept gate crosses at stage 3/5 (60%) and stays on
- downgrade asymmetry: V35-after-V36 (AutoRatchet deactivation) is un-gated
Test-only, bch-tree-local: pure int main()+assert over <core/pack_types.hpp>
uint288, no consensus / shared-base / CMake-shared surface. Registered in the
bch test CMakeLists foreach and BOTH build.yml COIN_BCH --target allowlists.
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.
G2 ratchet gate-logic KAT (fenced, rig-free)
Adds a fenced, rig-free simulation KAT that pins the live 60%-by-WORK
version-switch accept gate. The test replicates the inline tail-guard at
src/impl/bch/share_check.hpp:1774verbatim (non-circular — no liftedSSOT) and exercises staged 1-by-1 miner migration over a synthetic
work-weighted vote distribution.
Scope
int main()+assertoverpack_types.hpp.CMakeListsforeach + BOTHbuild.ymlCOIN_BCH test lists.Verification
macOS + bch smoke + attribution-gate + drift-guard) runs on head 66d0730.
Branch:
bch/g2-ratchet-gate-kat@ 66d0730