dgb: runtime min-protocol-version 95%-ratchet (1400->3500) conforming to oracle [step-2] - #602
Merged
Merged
Conversation
… to oracle Step-2 of the proto-floor conformance (step-1 #599 landed the cold floor 1400 + ratchet TARGET const 3500). Adds the pure SSOT free function dgb::ratchet_min_protocol_version (coin/desired_version_tally.hpp) mirroring p2pool-dgb-scrypt update_min_protocol_version (data.py:857-863): best-VERSION work-weight >= floor(total_weight * 95 / 100) => lift MINIMUM_PROTOCOL_VERSION 1400 -> 3500. Reads the same work-weighted desired-version map (get_desired_version_weights) over the same window [CHAIN_LENGTH*9//10, CHAIN_LENGTH//10] as the 60% switch gate (share_check step 2); this is its runtime sibling, lifting the inbound P2P handshake floor instead of rejecting a share. Integer math floor-divides exactly like the oracle (NOT cross-multiply -- the two differ at the boundary). KAT dgb_min_protocol_ratchet_test (9 cases, all hand-derived): guard, unanimous, exactly-95%, just-below, floor-div boundary (sum=101/best=95: ratchets under floor-div, would not under cross-mult), best-absent, empty-window oracle dict branch, work-weighted-not-flat-count, and consensus-magnitude (2^256-scale, no overflow). Registered in test CMakeLists + build.yml allowlist. Pure/additive: no production call-site rewired this slice (runtime wiring into the per-best-share loop is the follow-on, mirroring step-1 ship-core-then-wire). Consensus-bearing accept-floor value -> surface for operator merge-tap.
frstrtr
added a commit
that referenced
this pull request
Jul 1, 2026
dgb: wire runtime min-protocol 95%-ratchet into per-best-share loop (#602 follow-on)
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.
Step-2 of the DGB proto-floor conformance (step-1 = #599, cold floor 1400 + ratchet TARGET const 3500).
What
Pure SSOT free function
dgb::ratchet_min_protocol_version(coin/desired_version_tally.hpp) mirroring oracle frstrtr/p2pool-dgb-scryptupdate_min_protocol_version(data.py:857-863):Consumes the same work-weighted desired-version map (
get_desired_version_weights) over the same window[CHAIN_LENGTH*9//10, CHAIN_LENGTH//10]as the 60% version-switch gate (share_check step 2) — this is its runtime sibling, lifting the inbound P2P handshake floor instead of rejecting a share. Oracle call-site: data.py:562 / main.py:216.Integer math floor-divides exactly like the oracle (
sum*95//100), NOT cross-multiply — the two differ at the boundary; the KAT pins this.Test
dgb_min_protocol_ratchet_test— 9 hand-derived KATs, all green locally on .198: guard / unanimous / exactly-95% / just-below / floor-div boundary (sum=101,best=95 ratchets under floor-div, would NOT under cross-mult) / best-absent / empty-window oracle dict-branch / work-weighted-not-flat-count / consensus-magnitude (2^256-scale, no overflow). Registered in test CMakeLists + build.yml allowlist (no #143 NOT_BUILT trap).Scope
Pure/additive, fenced to src/impl/dgb/ + build.yml. No production call-site rewired this slice (runtime wiring into the per-best-share loop is the follow-on, mirroring step-1 ship-core-then-wire). Consensus-bearing accept-floor value — does NOT auto-merge; surface for operator merge-tap once full CI rollup green.