diff --git a/modules/light-clients/07-tendermint/types/misbehaviour.go b/modules/light-clients/07-tendermint/types/misbehaviour.go index b14593e1635..9a5ef74c948 100644 --- a/modules/light-clients/07-tendermint/types/misbehaviour.go +++ b/modules/light-clients/07-tendermint/types/misbehaviour.go @@ -14,6 +14,9 @@ import ( var _ exported.Misbehaviour = &Misbehaviour{} +// Use the same FrozenHeight for all misbehaviour +var FrozenHeight = clienttypes.NewHeight(0, 1) + // NewMisbehaviour creates a new Misbehaviour instance. func NewMisbehaviour(clientID string, header1, header2 *Header) *Misbehaviour { return &Misbehaviour{ diff --git a/modules/light-clients/07-tendermint/types/misbehaviour_handle.go b/modules/light-clients/07-tendermint/types/misbehaviour_handle.go index dd347f2aa4b..f86ca12a093 100644 --- a/modules/light-clients/07-tendermint/types/misbehaviour_handle.go +++ b/modules/light-clients/07-tendermint/types/misbehaviour_handle.go @@ -89,7 +89,7 @@ func (cs ClientState) CheckMisbehaviourAndUpdateState( return nil, sdkerrors.Wrap(err, "verifying Header2 in Misbehaviour failed") } - cs.FrozenHeight = clienttypes.NewHeight(0, 1) + cs.FrozenHeight = FrozenHeight return &cs, nil } diff --git a/modules/light-clients/07-tendermint/types/update.go b/modules/light-clients/07-tendermint/types/update.go index d637cae04a1..6333a9998d6 100644 --- a/modules/light-clients/07-tendermint/types/update.go +++ b/modules/light-clients/07-tendermint/types/update.go @@ -91,7 +91,7 @@ func (cs ClientState) CheckHeaderAndUpdateState( consState := tmHeader.ConsensusState() // Header is different from existing consensus state and also valid, so freeze the client and return if conflictingHeader { - cs.FrozenHeight = clienttypes.NewHeight(0, 1) + cs.FrozenHeight = FrozenHeight return &cs, consState, nil } // Check that consensus state timestamps are monotonic @@ -100,13 +100,13 @@ func (cs ClientState) CheckHeaderAndUpdateState( // if previous consensus state exists, check consensus state time is greater than previous consensus state time // if previous consensus state is not before current consensus state, freeze the client and return. if prevOk && !prevCons.Timestamp.Before(consState.Timestamp) { - cs.FrozenHeight = clienttypes.NewHeight(0, 1) + cs.FrozenHeight = FrozenHeight return &cs, consState, nil } // if next consensus state exists, check consensus state time is less than next consensus state time // if next consensus state is not after current consensus state, freeze the client and return. if nextOk && !nextCons.Timestamp.After(consState.Timestamp) { - cs.FrozenHeight = clienttypes.NewHeight(0, 1) + cs.FrozenHeight = FrozenHeight return &cs, consState, nil }