apollo_staking: bound next-epoch resolution window by the epoch length (#14689)#14760
Conversation
#14689) Heights were resolved to "current epoch + 1" for up to MIN_EPOCH_LENGTH blocks past the current epoch's end. When epochs are shorter than MIN_EPOCH_LENGTH, this attributed heights of later epochs to a stale epoch ID, so epoch-gated committee changes took effect at a different height on each node. Bound the window by min(MIN_EPOCH_LENGTH, epoch_length) so the resolved epoch is always exact; behavior is unchanged for epochs of at least MIN_EPOCH_LENGTH. Co-authored-by: Claude Fable 5 <noreply@anthropic.com> (cherry picked from commit 86e00e8)
PR SummaryMedium Risk Overview
Tests add short-epoch fixtures, assert the last in-bounds height before Reviewed by Cursor Bugbot for commit b95564f. Bugbot is set up for automated code reviews on this repo. Configure here. |
Backport of #14689 to
main-v0.14.3.Clean
git cherry-pick -xofb95564ff15. Nostarknet_versionchange (V0_14_3preserved).Stacked on
matanl/bp-14528-validate-staker-set— merge that first.