dgb: route consensus get_desired_version_weights clamp onto chain_walk_window SSOT (#450 follow-on) - #527
Merged
Conversation
…k_window SSOT The 60%-by-work version-switch gate input (get_desired_version_weights) was the last consensus-surface accessor still clamping the lookbehind window inline (std::min(lookbehind, height) + actual<=0). Its diagnostic counts sibling already delegates to dgb::chain_walk_window_count/_active; this routes the consensus accessor through the same SSOT. Byte-identical (min(lookbehind, height) / >0), value-invariant by construction. Pinned non-circularly by the existing DgbChainWalkWindow.DelegationMatchesPreDelegationInline matrix KAT, which re-derives std::min/(<=0) verbatim and already cites this call site. KATs green: dgb_chain_walk_window_test 5/5, dgb_desired_version_tally_test 6/6. Fenced to src/impl/dgb/. No self-merge.
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.
What
Routes the consensus
get_desired_version_weightslookbehind clamp onto thechain_walk_windowSSOT (chain_walk_window_count/chain_walk_window_active). This accessor is the 60%-by-work version-switch gate input (share_check step 2) and was the last consensus-surface call site still clamping inline (std::min(lookbehind, height)+actual<=0). Its diagnostic counts sibling already delegates; this brings the consensus accessor onto the same SSOT.Value-invariance (gated merge — NO self-merge)
Byte-identical:
chain_walk_window_count(h,lb) == std::min(lb,h),chain_walk_window_active(a) == a>0. Pinned non-circularly by the existingDgbChainWalkWindow.DelegationMatchesPreDelegationInlineKAT — a dense (height,lookbehind) matrix re-derivingstd::min/(<=0) verbatim with zero reference to the header, whose comment already cites this call site (share_tracker.hpp:2149-2153). Accumulation was already on the desired_version_tally SSOT (#429), so this completes the consensus path delegation.Tests (Linux x86_64)
dgb_chain_walk_window_test5/5 greendgb_desired_version_tally_test6/6 greenBoth targets already in BOTH build.yml
--targetallowlists.Scope
Fenced to
src/impl/dgb/only (share_tracker.hpp 4 lines + chain_walk_window.hpp comment). DGB-tree, single-coin smoke is the bar. Sits on the version-switch surface → operator-tap gated, not fenced auto-merge.