This document is intended to highlight significant changes which may require more information than presented in the CHANGELOG. Any changes that must be done by a user of ibc-go should be documented here.
Use this file to discover all available pages before exploring further.
This document is intended to highlight significant changes which may require more information than presented in the CHANGELOG.
Any changes that must be done by a user of ibc-go should be documented here.There are four sections based on the four potential user groups of this document:
The AnteDecorator type in core/ante has been renamed to RedundantRelayDecorator (and the corresponding constructor function to NewRedundantRelayDecorator). Therefore in the function that creates the instance of the sdk.AnteHandler type (e.g. NewAnteHandler) the change would be like this:
The key parameter of the NewKeeper function in modules/core/keeper is now of type storetypes.StoreKey (where storetypes is an import alias for "github.com/cosmos/cosmos-sdk/store/types"):
The key parameter of the NewKeeper function in modules/core/03-connection/keeper is now of type storetypes.StoreKey (where storetypes is an import alias for "github.com/cosmos/cosmos-sdk/store/types"):
The key parameter of the NewKeeper function in modules/core/04-channel/keeper is now of type storetypes.StoreKey (where storetypes is an import alias for "github.com/cosmos/cosmos-sdk/store/types"):
The key parameter of the NewKeeper function in modules/apps/transfer/keeper is now of type storetypes.StoreKey (where storetypes is an import alias for "github.com/cosmos/cosmos-sdk/store/types"):
and modules/apps/27-interchain-accounts/host/keeper
have changed type. The key parameter is now of type storetypes.StoreKey (where storetypes is an import alias for "github.com/cosmos/cosmos-sdk/store/types"), and the msgRouter parameter is now of type *icatypes.MessageRouter (where icatypes is an import alias for "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types"):
type MessageRouter interface { Handler(msg sdk.Msg)baseapp.MsgServiceHandler}
The RegisterRESTRoutes function in modules/apps/27-interchain-accounts has been removed.An additional parameter, ics4Wrapper has been added to the host submodule NewKeeper function in modules/apps/27-interchain-accounts/host/keeper.
This allows the host submodule to correctly unwrap the channel version for channel reopening handshakes in the OnChanOpenTry callback.
Cosmos SDK message handler responses in packet acknowledgement
The construction of the transaction response of a message execution on the host chain has changed. The Data field in the sdk.TxMsgData has been deprecated and since Cosmos SDK 0.46 the MsgResponses field contains the message handler responses packed into Anys.For chains on Cosmos SDK 0.45 and below, the message response was constructed like this:
txMsgData := &sdk.TxMsgData{ Data: make([]*sdk.MsgData, len(msgs)),} for i, msg := range msgs { / message validation msgResponse, err := k.executeMsg(cacheCtx, msg) / return if err != nil txMsgData.Data[i] = &sdk.MsgData{ MsgType: sdk.MsgTypeURL(msg), Data: msgResponse,}}/ emit eventstxResponse, err := proto.Marshal(txMsgData)/ return if err != nilreturn txResponse, nil
And for chains on Cosmos SDK 0.46 and above, it is now done like this:
txMsgData := &sdk.TxMsgData{ MsgResponses: make([]*codectypes.Any, len(msgs)),} for i, msg := range msgs { / message validation protoAny, err := k.executeMsg(cacheCtx, msg) / return if err != nil txMsgData.MsgResponses[i] = protoAny}/ emit eventstxResponse, err := proto.Marshal(txMsgData)/ return if err != nilreturn txResponse, nil
When handling the acknowledgement in the OnAcknowledgementPacket callback of a custom ICA controller module, then depending on whether txMsgData.Data is empty or not, the logic to handle the message handler response will be different. Only controller chains on Cosmos SDK 0.46 or above will be able to write the logic needed to handle the response from a host chain on Cosmos SDK 0.46 or above.
var ack channeltypes.Acknowledgement if err := channeltypes.SubModuleCdc.UnmarshalJSON(acknowledgement, &ack); err != nil { return err}var txMsgData sdk.TxMsgData if err := proto.Unmarshal(ack.GetResult(), txMsgData); err != nil { return err} switch len(txMsgData.Data) { case 0: / for SDK 0.46 and above for _, msgResponse := range txMsgData.MsgResponses { / unmarshall msgResponse and execute logic based on the response}return nildefault: / for SDK 0.45 and below for _, msgData := range txMsgData.Data { / unmarshall msgData and execute logic based on the response}}
See the corresponding documentation about authentication modules for more information.
The key parameter of the NewKeeper function in modules/apps/29-fee is now of type storetypes.StoreKey (where storetypes is an import alias for "github.com/cosmos/cosmos-sdk/store/types"):
The MockIBCApp type has been renamed to IBCApp (and the corresponding constructor function to NewIBCApp). This has resulted therefore in:
The IBCApp field of the *IBCModule in testing/mock to change its type as well to *IBCApp:
type IBCModule struct { appModule *AppModule- IBCApp *MockIBCApp / base application of an IBC middleware stack+ IBCApp *IBCApp / base application of an IBC middleware stack}
The app parameter to *NewIBCModule in testing/mock to change its type as well to *IBCApp:
The MockEmptyAcknowledgement type has been renamed to EmptyAcknowledgement (and the corresponding constructor function to NewEmptyAcknowledgement).The TestingApp interface in testing has gone through some modifications:
The return type of the function GetStakingKeeper is not the concrete type stakingkeeper.Keeper anymore (where stakingkeeper is an import alias for "github.com/cosmos/cosmos-sdk/x/staking/keeper"), but it has been changed to the interface ibctestingtypes.StakingKeeper (where ibctestingtypes is an import alias for ""github.com/cosmos/ibc-go/v5/testing/types"). See this PR for more details. The StakingKeeper interface is defined as:
type StakingKeeper interface { GetHistoricalInfo(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool)}
The return type of the function LastCommitID has changed to storetypes.CommitID (where storetypes is an import alias for "github.com/cosmos/cosmos-sdk/store/types").
The key parameter of the NewKeeper function in modules/core/02-client/keeper is now of type storetypes.StoreKey (where storetypes is an import alias for "github.com/cosmos/cosmos-sdk/store/types"):
func NewKeeper( cdc codec.BinaryCodec,- key sdk.StoreKey,+ key storetypes.StoreKey, paramSpace paramtypes.Subspace, sk types.StakingKeeper, uk types.UpgradeKeeper) Keeper