diff --git a/x/staking/keeper/validator.go b/x/staking/keeper/validator.go index 7d92d65a00e9..ee0505d9a24b 100644 --- a/x/staking/keeper/validator.go +++ b/x/staking/keeper/validator.go @@ -428,7 +428,7 @@ func (k Keeper) GetLastValidators(ctx context.Context) (validators []types.Valid for ; iterator.Valid(); iterator.Next() { // sanity check if i >= int(maxValidators) { - panic("more validators than maxValidators found") + return validators[:i], nil // trim } address := types.AddressFromLastValidatorPowerKey(iterator.Key())