Skip to content

dash(F10): D-series version-gate standardization (D1+D2+D5) - #147

Merged
frstrtr merged 3 commits into
masterfrom
dash/d1-version-gate-weighted
Jun 18, 2026
Merged

dash(F10): D-series version-gate standardization (D1+D2+D5)#147
frstrtr merged 3 commits into
masterfrom
dash/d1-version-gate-weighted

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 18, 2026

Copy link
Copy Markdown
Owner

DASH F10 version-gate standardization. Single-coin (DASH/X11 only), no cross-coin surface.

  • D1 (d7c2e0a): route the weighted version tally into the 60% version-switch gate.
  • D2 (9d3e718): unified 5-case version-switch classifier (F10 step 2).
  • D5 (700309f): source the weighted version tally from the cached ShareIndex::work.

D3/D4 are aligned-invariants, no-code. Local ctest 24/24 green on Linux x86_64. All commits GPG-signed. Stacked on master @3e8ba8ef (#138).

Note: the cached-vs-live work equivalence holds in production; a synthetic harness that mutates m_bits post-add can diverge — not a production path.

frstrtr added 3 commits June 17, 2026 21:53
successor_switch_allowed() now consumes the PPLNS-weighted desired-version
tally (get_desired_version_weights) via the exact rational
new_ver_weight*100 >= total_weight*60, matching the canonical v36-native
shape (F10 685669e share_check step 2; p2pool data.py 1396-1414). Replaces
the prior plain-count floor gate (have >= floor(total*60/100)), which
diverged at non-round totals — 4/7 cleared under floor, rejects under the
canonical rational form.

The plain count (get_desired_version_counts) is retained unchanged for
AutoRatchet + the VOTING tail guard (D4). The 95% activation gate stays
signal-only; should_punish_version is NOT reintroduced (D3).

Scaffolding-only: no live DASH share_check caller; zero merged-consensus
risk. test_dash_conformance 23/23 green on Linux x86_64.
classify_switch() + switch_accepted() fold the canonical v36-native
share_check step-2 transition logic into the DASH scaffolding. D1 wired only
the 60% upgrade threshold (successor_switch_allowed); the canonical shape
(F10 share_check.hpp step 2; p2pool-dash data.py Share.check) classifies a
predecessor->desired transition into five cases, of which the threshold gate
is the body of just one:

  Same                desired == prev      -> allow (continuation)
  SuccessorGated      desired == prev + 1  -> allow IFF the 60% weighted gate clears
  PredecessorAllowed  desired == prev - 1  -> allow (downgrade-by-one rollback)
  InvalidJump         |delta| > 1          -> reject (no version skipping)
  NoHistory           +1 switch, < CHAIN_LENGTH ancestors -> reject (no support window)

no-history applies ONLY to the +1 successor -- the one transition needing the
support window; Same/Predecessor need none, an InvalidJump rejects on
structure regardless. switch_accepted() defers SuccessorGated to the D1 gate
and decides the rest structurally, mirroring F10 step 2 exactly.

Additive scaffolding: classify_switch / switch_accepted / SwitchClass are NEW;
the D1 successor_switch_allowed and v36_active functions are untouched. KAT
pins all five classification cases + the full switch_accepted decision table,
and cross-checks the SuccessorGated body against the live successor_switch_allowed
so the classifier can never diverge from the D1 gate it composes with. No live
DASH share_check caller -- zero merged-consensus risk.

test_dash_conformance 24/24 green on Linux x86_64 (SwitchClassifier5CaseKat
added; real nonzero-count run from build/).
…x::work

get_desired_version_weights() recomputed target_to_average_attempts(
bits_to_target(m_bits)) live per share. Consume the cached per-share
ShareIndex::work instead (set at add() to the identical value,
share_chain.hpp:227), standardizing on the shared F10 work accessor and
removing recompute-drift risk. Behavior-identical in production where a
shares bits are immutable once it enters the chain.

Test harness: SyntheticChain::add now sets the final bits/version BEFORE
chain.add() so the cached index work reflects them, mirroring the
production invariant; add_versioned no longer mutates m_bits post-add.
KAT expected values unchanged; test_dash_conformance 24/24 green.
@frstrtr
frstrtr merged commit e36c04f into master Jun 18, 2026
16 checks passed
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