Skip to content

Commit

Permalink
quietly ignore nil validator updates, without erroring, to avoid bloc…
Browse files Browse the repository at this point in the history
…king icq (#488)
  • Loading branch information
Joe Bowman authored Jul 7, 2023
1 parent bf94d79 commit 4897461
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions x/interchainstaking/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,13 @@ func (k *Keeper) SetValidatorsForZone(ctx sdk.Context, data []byte, icqQuery icq
}

func (k *Keeper) SetValidatorForZone(ctx sdk.Context, zone *types.Zone, data []byte) error {
if data == nil {
k.Logger(ctx).Error("expected validator state, got nil")
// return nil here, as if we receive nil we fail to unmarshal (as nil validators are invalid),
// so we can never hope to resolve this query. Possibly received a valset update from a
// different chain.
return nil
}
validator, err := k.UnmarshalValidator(data)
if err != nil {
k.Logger(ctx).Error("unable to unmarshal validator info for zone", "zone", zone.ChainId, "err", err)
Expand Down

0 comments on commit 4897461

Please sign in to comment.