dgb(phase-b): delegate get_desired_version_{weights,counts} into tally SSOT (#429 follow-on) - #433
Merged
Merged
Conversation
frstrtr
force-pushed
the
dgb/desired-version-tally-delegate
branch
from
June 24, 2026 16:25
ae3bb52 to
919f842
Compare
…y SSOT Rewire ShareTracker::get_desired_version_weights() (the CONSENSUS 60%-by-work version-switch gate input) and its flat-count diagnostic sibling get_desired_version_counts() to delegate the per-version accumulation into the desired_version_tally SSOT introduced in #429 (accumulate_version_weights / accumulate_version_counts). The chain-walk and the lookbehind clamp stay inline in ShareTracker (the clamp is the separate chain_walk_window SSOT); only the map accumulation moves. Shares with an absent ShareIndex are skipped exactly as before, so the resulting map is byte-identical. Value-identity is proven NON-CIRCULARLY by a new KAT (DesiredVersionTallyDelegationByteIdentity) over chains of 2/4/8 shares whose expected maps are derived from first principles (production chain::target_to_average_attempts over the input bits, plus a hand-counted flat tally) rather than from the SSOT under test, plus a lookbehind-clamp check; and by the pre-existing real-chain weight tests (DesiredVersionWeightsByAttempts, WeightWalkValueInvarianceBattery, AutoRatchet*) which now route through the delegated accessor and remain green. Stacked on #429 (dgb/desired-version-tally-ssot).
frstrtr
force-pushed
the
dgb/desired-version-tally-delegate
branch
from
June 24, 2026 19:50
919f842 to
67cf54c
Compare
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.
Stacked on #429. Rewires ShareTracker::get_desired_version_weights() (the CONSENSUS 60%-by-work version-switch gate input) + its flat-count diagnostic sibling get_desired_version_counts() to delegate the per-version accumulation into the desired_version_tally SSOT (#429). Chain-walk + lookbehind clamp stay inline; only the map accumulation moves; absent-ShareIndex shares skipped exactly as before => byte-identical.
PROOF (non-circular): new KAT DesiredVersionTallyDelegationByteIdentity over {2,4,8}-share chains, expected maps derived from production chain::target_to_average_attempts (NOT the SSOT under test) + hand-counted flat tally + lookbehind-clamp check. Pre-existing real-chain weight tests (DesiredVersionWeightsByAttempts / WeightWalkValueInvarianceBattery / AutoRatchet*) now route through the delegated accessor and stay green. Local: dgb_share_test 10/10, dgb_desired_version_tally_test 6/6.
Consensus-bearing (version-tally feeds version voting) -> NOT a fenced auto-merge; operator tap. Retarget base to master after #429 lands.