diff --git a/CHANGELOG.md b/CHANGELOG.md index c5cf8818544..0394dbfd699 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking +* (modules) [\#166](https://github.com/cosmos/ibc-go/pull/166) Remove GetHeight from the misbehaviour interface. The `consensus_height` attribute has been removed from Misbehaviour events. * (modules) [\#162](https://github.com/cosmos/ibc-go/pull/162) Remove deprecated Handler types in core IBC and the ICS 20 transfer module. * (modules/core) [\#161](https://github.com/cosmos/ibc-go/pull/161) Remove Type(), Route(), GetSignBytes() from 02-client, 03-connection, and 04-channel messages. * (modules) [\#140](https://github.com/cosmos/ibc-go/pull/140) IsFrozen() client state interface changed to Status(). gRPC `ClientStatus` route added. diff --git a/docs/migrations/ibc-migration-043.md b/docs/migrations/ibc-migration-043.md index f2d209663af..7ac0c292d68 100644 --- a/docs/migrations/ibc-migration-043.md +++ b/docs/migrations/ibc-migration-043.md @@ -108,6 +108,8 @@ The `OnRecvPacket` callback has been modified to only return the acknowledgement The `packet_data` attribute has been deprecated in favor of `packet_data_hex`, in order to provide standardized encoding/decoding of packet data in events. While the `packet_data` event still exists, all relayers and IBC Event consumers are strongly encouraged to switch over to using `packet_data_hex` as soon as possible. +The `consensus_height` attribute has been removed in the Misbehaviour event emitted. IBC clients no longer have a frozen height and misbehaviour does not necessarily have an associated height. + ## Relevant SDK changes * (codec) [\#9226](https://github.com/cosmos/cosmos-sdk/pull/9226) Rename codec interfaces and methods, to follow a general Go interfaces: diff --git a/modules/core/02-client/keeper/client.go b/modules/core/02-client/keeper/client.go index ddb9aab9f16..1ebcceadc4f 100644 --- a/modules/core/02-client/keeper/client.go +++ b/modules/core/02-client/keeper/client.go @@ -122,7 +122,7 @@ func (k Keeper) UpdateClient(ctx sdk.Context, clientID string, header exported.H // set eventType to SubmitMisbehaviour eventType = types.EventTypeSubmitMisbehaviour - k.Logger(ctx).Info("client frozen due to misbehaviour", "client-id", clientID, "height", header.GetHeight().String()) + k.Logger(ctx).Info("client frozen due to misbehaviour", "client-id", clientID) defer func() { telemetry.IncrCounterWithLabels( @@ -224,7 +224,7 @@ func (k Keeper) CheckMisbehaviourAndUpdateState(ctx sdk.Context, misbehaviour ex } k.SetClientState(ctx, misbehaviour.GetClientID(), clientState) - k.Logger(ctx).Info("client frozen due to misbehaviour", "client-id", misbehaviour.GetClientID(), "height", misbehaviour.GetHeight().String()) + k.Logger(ctx).Info("client frozen due to misbehaviour", "client-id", misbehaviour.GetClientID()) defer func() { telemetry.IncrCounterWithLabels( diff --git a/modules/core/exported/client.go b/modules/core/exported/client.go index b79106c174a..5879bc9fac2 100644 --- a/modules/core/exported/client.go +++ b/modules/core/exported/client.go @@ -201,9 +201,6 @@ type Misbehaviour interface { ClientType() string GetClientID() string ValidateBasic() error - - // Height at which the infraction occurred - GetHeight() Height } // Header is the consensus state update information diff --git a/modules/core/keeper/msg_server.go b/modules/core/keeper/msg_server.go index 8c3d879acd3..2edcdd157c2 100644 --- a/modules/core/keeper/msg_server.go +++ b/modules/core/keeper/msg_server.go @@ -123,7 +123,6 @@ func (k Keeper) SubmitMisbehaviour(goCtx context.Context, msg *clienttypes.MsgSu clienttypes.EventTypeSubmitMisbehaviour, sdk.NewAttribute(clienttypes.AttributeKeyClientID, msg.ClientId), sdk.NewAttribute(clienttypes.AttributeKeyClientType, misbehaviour.ClientType()), - sdk.NewAttribute(clienttypes.AttributeKeyConsensusHeight, misbehaviour.GetHeight().String()), ), ) diff --git a/modules/light-clients/06-solomachine/types/misbehaviour.go b/modules/light-clients/06-solomachine/types/misbehaviour.go index 7a870ad49bf..9fea2fb1195 100644 --- a/modules/light-clients/06-solomachine/types/misbehaviour.go +++ b/modules/light-clients/06-solomachine/types/misbehaviour.go @@ -26,13 +26,6 @@ func (misbehaviour Misbehaviour) Type() string { return exported.TypeClientMisbehaviour } -// GetHeight returns the sequence at which misbehaviour occurred. -// Return exported.Height to satisfy interface -// Revision number is always 0 for a solo-machine -func (misbehaviour Misbehaviour) GetHeight() exported.Height { - return clienttypes.NewHeight(0, misbehaviour.Sequence) -} - // ValidateBasic implements Evidence interface. func (misbehaviour Misbehaviour) ValidateBasic() error { if err := host.ClientIdentifierValidator(misbehaviour.ClientId); err != nil { diff --git a/modules/light-clients/06-solomachine/types/misbehaviour_test.go b/modules/light-clients/06-solomachine/types/misbehaviour_test.go index 00f97219009..77acd2c2071 100644 --- a/modules/light-clients/06-solomachine/types/misbehaviour_test.go +++ b/modules/light-clients/06-solomachine/types/misbehaviour_test.go @@ -11,8 +11,6 @@ func (suite *SoloMachineTestSuite) TestMisbehaviour() { suite.Require().Equal(exported.Solomachine, misbehaviour.ClientType()) suite.Require().Equal(suite.solomachine.ClientID, misbehaviour.GetClientID()) - suite.Require().Equal(uint64(0), misbehaviour.GetHeight().GetRevisionNumber()) - suite.Require().Equal(suite.solomachine.Sequence, misbehaviour.GetHeight().GetRevisionHeight()) } func (suite *SoloMachineTestSuite) TestMisbehaviourValidateBasic() { diff --git a/modules/light-clients/07-tendermint/types/misbehaviour.go b/modules/light-clients/07-tendermint/types/misbehaviour.go index 9a5ef74c948..6c82d9afd02 100644 --- a/modules/light-clients/07-tendermint/types/misbehaviour.go +++ b/modules/light-clients/07-tendermint/types/misbehaviour.go @@ -36,11 +36,6 @@ func (misbehaviour Misbehaviour) GetClientID() string { return misbehaviour.ClientId } -// GetHeight returns the height at which misbehaviour occurred -func (misbehaviour Misbehaviour) GetHeight() exported.Height { - return misbehaviour.Header1.GetHeight() -} - // GetTime returns the timestamp at which misbehaviour occurred. It uses the // maximum value from both headers to prevent producing an invalid header outside // of the misbehaviour age range. diff --git a/modules/light-clients/07-tendermint/types/misbehaviour_test.go b/modules/light-clients/07-tendermint/types/misbehaviour_test.go index 30deec2cb90..d3bb7bc626c 100644 --- a/modules/light-clients/07-tendermint/types/misbehaviour_test.go +++ b/modules/light-clients/07-tendermint/types/misbehaviour_test.go @@ -26,7 +26,6 @@ func (suite *TendermintTestSuite) TestMisbehaviour() { suite.Require().Equal(exported.Tendermint, misbehaviour.ClientType()) suite.Require().Equal(clientID, misbehaviour.GetClientID()) - suite.Require().Equal(height, misbehaviour.GetHeight()) } func (suite *TendermintTestSuite) TestMisbehaviourValidateBasic() {