Skip to content

dgb: route consensus get_desired_version_weights clamp onto chain_walk_window SSOT (#450 follow-on) - #527

Merged
frstrtr merged 1 commit into
masterfrom
dgb/desired-version-weights-clamp-ssot
Jun 26, 2026
Merged

dgb: route consensus get_desired_version_weights clamp onto chain_walk_window SSOT (#450 follow-on)#527
frstrtr merged 1 commit into
masterfrom
dgb/desired-version-weights-clamp-ssot

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 26, 2026

Copy link
Copy Markdown
Owner

What

Routes the consensus get_desired_version_weights lookbehind clamp onto the chain_walk_window SSOT (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 existing DgbChainWalkWindow.DelegationMatchesPreDelegationInline KAT — a dense (height,lookbehind) matrix re-deriving std::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_test 5/5 green
  • dgb_desired_version_tally_test 6/6 green

Both targets already in BOTH build.yml --target allowlists.

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.

…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.
@frstrtr
frstrtr merged commit c1ba7b3 into master Jun 26, 2026
32 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