dash(#357): v36-native mint-side accept-floor auto-ratchet (FENCED/UNWIRED) - #643
Merged
Conversation
…WIRED) Close the single gap the #357 AutoRatchet mint-gate weighting audit found: DASH defines the weighted desired-version tally (get_desired_version_weights) and the 60/95 accept gates consume it, but had NO mint-side consumer that lifts MINIMUM_PROTOCOL_VERSION off the same weighted window. Add src/impl/dash/auto_ratchet.hpp mirroring dgb::apply_min_protocol_ratchet_decision: ratchet_min_protocol_version (pure, floor-divided 95% work-weighted gate, oracle update_min_protocol_version dict-branch) + the full-window call-site guard (no lift until parent_height >= CHAIN_LENGTH over the same window the 60% switch gate reads). Purely additive, no node.cpp call site -- the live consumer is consensus-bearing and rides the S8 wire-up. KAT test_dash_auto_ratchet (14/14): floor-div boundary, empty-window dict-branch, consensus-magnitude no-overflow, full-window guard, and the gap-closing weighted-vs-plain-count divergence assert on a crafted window (v36 work-dominant but count-minority -> weighted ratchets, flat count does not). Registered in test/CMakeLists.txt and both build.yml --target allowlists. Fence: src/impl/dash/ + test/ only; no bitcoin_family/src/core/other-coin touch.
frstrtr
added a commit
that referenced
this pull request
Jul 7, 2026
dash: parameterized min-protocol-version ratchet gate + KAT (#643, option a)
frstrtr
added a commit
that referenced
this pull request
Jul 7, 2026
…to gate) (#649) * dash: parameterized min-protocol-version ratchet gate + KAT (#643) Add dash::MinProtocolGate, a per-instance reject-if-proto<floor policy for the version handshake. Floor defaults to SharechainConfig::MINIMUM_PROTOCOL_VERSION (1700, oracle accept-all) so the leaf is a NO-OP at default and commits no premature v36 constant; the ratchet value stays a one-line operator knob set at G2-migration time. Fenced to src/impl/dash/ (no shared bitcoin_family/core handshake types touched). Live wiring into handle_version rides reception slice B. KAT (test_dash_min_protocol_gate, 3/3) pins: peer at floor=1700 MUST be accepted (no-op), below-floor rejected at the >= boundary, and the floor is a settable per-instance member (ratchet mechanism works while default stays inert). * dash: S8 node slice-B version-handshake reception (fires #646 min-proto gate) Replace the slice-A no-op handle_version stub in dash::NodeImpl with the real version-handshake reception, mirroring the ltc::NodeImpl reference reconciled to DASH s header-only pool node. Parses message_version, guards self- and duplicate connections, and fires the #646 min-protocol ratchet gate as a LIVE per-instance discrimination (default floor 1700 = oracle accept-all no-op; operator lifts it at G2-migration). Registers the peer and returns the negotiated legacy/actual connection type for the G2 dual-pool. This flips the G2 dual-pool from a dormant seam to a live cross-peer reception. test_dash_node 9/9. * dash: wire NodeImpl::handle() version routing so slice-B reception is reachable The slice-A handle() was a no-op that dropped all inbound messages, leaving the new handle_version() reception (and its live #646 min-protocol gate) unreachable -- a dormant seam. Route the unknown-peer version handshake into handle_version() (mirrors pool::NodeBridge), close on self/dup, and mark the peer stable on the negotiated type. Full Legacy/Actual established-peer dispatch rides a later slice. This makes the #646 discrimination genuinely live on the handshake path. test_dash_node 9/9. --------- Co-authored-by: frstrtr <frstrtr@users.noreply.github.com>
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.
Closes the single gap the #357 AutoRatchet mint-gate weighting audit found: DASH already defines the weighted desired-version tally (
get_desired_version_weights) and the 60/95 accept gates consume it, but had NO mint-side consumer that liftsMINIMUM_PROTOCOL_VERSIONoff the same weighted window.What
src/impl/dash/auto_ratchet.hpp(FENCED / ADDITIVE / UNWIRED — no node.cpp call site). Mirrorsdgb::apply_min_protocol_ratchet_decision:ratchet_min_protocol_version— pure, floor-divided 95% work-weighted gate (oracleupdate_min_protocol_versiondict-branch).apply_min_protocol_ratchet_decision— adds the full-window call-site guard (no lift untilparent_height >= CHAIN_LENGTH, sampling the SAME window the 60% switch gate reads).test/test_dash_auto_ratchet.cpp— 14/14 KAT incl. the gap-closing weighted-vs-plain-count divergence assert (v36 work-dominant but count-minority → weighted ratchets, flat count does not). Registered in test/CMakeLists.txt + both build.yml --target allowlists.Fence
src/impl/dash/ + test/ only. No bitcoin_family / src/core / other-coin touch (verified).
Oracle note (honest)
The DASH oracle frstrtr/p2pool-dash (older-than-v35) has no
NEW_MINIMUM_PROTOCOL_VERSION—MINIMUM_PROTOCOL_VERSIONis the static 1700 net constant. The decision math is oracle-faithful to the dgb-scryptupdate_min_protocol_version; the concrete ratchet target floor is a c2pool v36-native (bucket-2 standardization) choice, intentionally NOT baked in — every function takescurrent_floor/target_flooras params, and the live wire-up (consensus-bearing) rides S8.Held for integrator merge tap per audit-thread follow-up #4.