Skip to content

dgb: runtime min-protocol-version 95%-ratchet (1400->3500) conforming to oracle [step-2] - #602

Merged
frstrtr merged 1 commit into
masterfrom
dgb/proto-floor-ratchet-step2
Jun 28, 2026
Merged

dgb: runtime min-protocol-version 95%-ratchet (1400->3500) conforming to oracle [step-2]#602
frstrtr merged 1 commit into
masterfrom
dgb/proto-floor-ratchet-step2

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 28, 2026

Copy link
Copy Markdown
Owner

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-scrypt update_min_protocol_version (data.py:857-863):

best-VERSION work-weight >= floor(total_weight * 95 / 100)  =>  lift MINIMUM_PROTOCOL_VERSION 1400 -> 3500

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.

… 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
frstrtr merged commit 3a44551 into master Jun 28, 2026
32 checks passed
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)
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