Use this file to discover all available pages before exploring further.
This guide provides instructions for migrating to a new version of ibc-go.Note: ibc-go supports golang semantic versioning and therefore all imports must be updated on major version releases. In addition, for this release, the 08-wasm module has been released as v10, and the callbacks middleware has been moved into the ibc-go module itself.Diff examples are shown after the list of overall changes:
To add support for IBC v2, Chains will need to wire up a new IBC v2 Transfer stack
Chains will need to wire up the new light client modules
Chains will need to update Keeper construction calls to comply with the new signatures
Chains will need to remove the route for the legacy proposal handler for 02-client from their app/app.go
Chains will need to remove the capability keeper and all related setup, including the scoped keepers from their app/app.go
Chains will need to remove ibc fee middleware (29-fee)
Chains will need, if using this module, to update their imports and usage of github.com/cosmos/ibc-go/modules/light-clients/08-wasm/ to github.com/cosmos/ibc-go/modules/light-clients/08-wasm/v10
Chains will need, if using this module, to update their imports and usage of github.com/cosmos/ibc-go/modules/apps/callbacks to github.com/cosmos/ibc-go/v10/modules/apps/callbacks
To add IBC v2 support, wire up a new transfer stack. Example below showing wired up with IBC Callbacks module:
Update ICA Host keeper constructor, notice the removal of the WithQueryRouter call in particular:
app.ICAHostKeeper = icahostkeeper.NewKeeper( appCodec,- keys[icahosttypes.StoreKey],+ runtime.NewKVStoreService(keys[icahosttypes.StoreKey]), app.GetSubspace(icahosttypes.SubModuleName),- app.IBCFeeKeeper, / use ics29 fee as ics4Wrapper in middleware stack app.IBCKeeper.ChannelKeeper,- app.IBCKeeper.PortKeeper,+ app.IBCKeeper.ChannelKeeper, app.AccountKeeper,- scopedICAHostKeeper, app.MsgServiceRouter(),+ app.GRPCQueryRouter(), authtypes.NewModuleAddress(govtypes.ModuleName).String(), )- app.ICAHostKeeper.WithQueryRouter(app.GRPCQueryRouter())
Remove IBC Fee Module keeper:
- app.IBCFeeKeeper = ibcfeekeeper.NewKeeper(- appCodec, keys[ibcfeetypes.StoreKey],- app.IBCKeeper.ChannelKeeper, / may be replaced with IBC middleware- app.IBCKeeper.ChannelKeeper,- app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper,- )
Update Transfer stack to remove the fee middleware. The example below shows the correct way to wire up a middleware stack with the IBC callbacks middleware:
/ Create Transfer Stack var transferStack porttypes.IBCModule transferStack = transfer.NewIBCModule(app.TransferKeeper)- transferStack = ibccallbacks.NewIBCMiddleware(transferStack, app.IBCFeeKeeper, wasmStackIBCHandler, maxCallbackGas)- transferStack = ibcfee.NewIBCMiddleware(transferStack, app.IBCFeeKeeper)+ / callbacks wraps the transfer stack as its base app, and uses PacketForwardKeeper as the ICS4Wrapper+ / i.e. packet-forward-middleware is higher on the stack and sits between callbacks and the ibc channel keeper+ / Since this is the lowest level middleware of the transfer stack, it should be the first entrypoint for transfer keeper's+ / WriteAcknowledgement.+ cbStack := ibccallbacks.NewIBCMiddleware(transferStack, app.PacketForwardKeeper, wasmStackIBCHandler, maxCallbackGas)transferStack = packetforward.NewIBCMiddleware(- transferStack,+ cbStack, app.PacketForwardKeeper, 0, packetforwardkeeper.DefaultForwardTransferPacketTimeoutTimestamp, )+ app.TransferKeeper.WithICS4Wrapper(cbStack)
Remove ibc fee middleware and any empty IBCModule (often dubbed noAuthzModule) from the ICA Controller stack creation: