diff --git a/CHANGELOG.md b/CHANGELOG.md index b0e7844fdf25..3326cf0798a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,14 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog +## v0.47.15-ics-lsm + +This is a special cosmos-sdk release with support for both ICS and LSM. + +### Bugfixes + +* (staking) [#20548](https://github.com/cosmos/cosmos-sdk/pull/20548) Remove panic from GetLastValidators. + ## v0.47.14-ics-lsm This is a special cosmos-sdk release with support for both ICS and LSM. diff --git a/x/staking/keeper/validator.go b/x/staking/keeper/validator.go index d1315ed7793f..7eb19e6833a2 100644 --- a/x/staking/keeper/validator.go +++ b/x/staking/keeper/validator.go @@ -323,7 +323,8 @@ func (k Keeper) GetLastValidators(ctx sdk.Context) (validators []types.Validator for ; iterator.Valid(); iterator.Next() { // sanity check if i >= int(maxValidators) { - panic("more validators than maxValidators found") + k.Logger(ctx).Info("more validators than maxValidators found") + break } address := types.AddressFromLastValidatorPowerKey(iterator.Key())