-
Notifications
You must be signed in to change notification settings - Fork 768
docs: v11.1 migration docs #8958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| --- | ||
| title: IBC-Go v11.0 to v11.1 | ||
| sidebar_label: IBC-Go v11.0 to v11.1 | ||
| sidebar_position: 16 | ||
| slug: /migrations/v11-to-v11_1 | ||
| --- | ||
|
|
||
| # Migrating from v11.0 to v11.1 | ||
|
|
||
| This guide provides instructions for migrating to a new version of ibc-go. | ||
|
|
||
| This guide assumes that your chain is already using ibc-go v11.0 and is upgrading to ibc-go v11.1. If you are upgrading directly from ibc-go v10 to ibc-go v11.1, see the [migration guide for v10 to v11.1](./17-v10-to-v11_1.md). | ||
|
|
||
| ## Packet Forward Middleware | ||
|
|
||
| Packet Forward Middleware (PFM) has been moved from [cosmos/ibc-apps](https://github.com/cosmos/ibc-apps) to ibc-go in this release. PFM is now available under `modules/apps/packet-forward-middleware`. | ||
|
|
||
| This guide assumes that your chain has not previously integrated PFM from ibc-apps. If your chain already uses PFM from ibc-apps, follow the [migration guide for v10 to v11.1](./17-v10-to-v11_1.md), which includes guidance for preserving existing PFM state. | ||
|
|
||
| If you want to enable PFM, first follow the [integration instructions](../04-middleware/02-packet-forward-middleware/02-integration.md). | ||
|
|
||
| ### Add `StoreUpgrades` for the PFM module | ||
|
|
||
| If PFM is being added to an existing chain, you must [manually add store upgrades](https://docs.cosmos.network/sdk/latest/guides/upgrades/upgrade#adding-new-modules-during-an-upgrade) for the new PFM module and configure the store loader to apply those upgrades in `app.go`: | ||
|
|
||
| ```go | ||
| if upgradeInfo.Name == "v11_1" && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { | ||
| storeUpgrades := store.StoreUpgrades{ | ||
| Added: []string{packetforwardtypes.StoreKey}, | ||
| } | ||
|
|
||
| app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) | ||
| } | ||
| ``` | ||
|
|
||
| This ensures that the new module's stores are added to the multistore before the migrations begin. | ||
| If a chain does not integrate PFM, it does not need to add the PFM key to the `Added` field. | ||
|
|
||
| :::note | ||
| The PFM module name and store key intentionally preserve the original `packetfowardmiddleware` spelling for compatibility with the legacy implementation. | ||
| ::: | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| --- | ||
| title: IBC-Go v10 to v11.1 | ||
| sidebar_label: IBC-Go v10 to v11.1 | ||
| sidebar_position: 17 | ||
| slug: /migrations/v10-to-v11_1 | ||
| --- | ||
|
|
||
| # Migrating from v10 to v11.1 | ||
|
|
||
| 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. | ||
|
|
||
| This guide is for chains upgrading directly from ibc-go v10 to ibc-go v11.1. It includes the changes from the ibc-go v11.0 migration and the Packet Forward Middleware changes introduced in ibc-go v11.1. | ||
|
|
||
| The following changes from v10 to v11 are relevant to this upgrade: | ||
|
|
||
| - Chains will need to remove the `ParamSubspace` arg from all calls to `Keeper` constructors | ||
|
|
||
| ```diff | ||
| app.IBCKeeper = ibckeeper.NewKeeper( | ||
| appCodec, | ||
| runtime.NewKVStoreService(keys[ibcexported.StoreKey]), | ||
| - app.GetSubspace(ibcexported.ModuleName), | ||
| app.UpgradeKeeper, | ||
| authtypes.NewModuleAddress(govtypes.ModuleName).String(), | ||
| ) | ||
| ``` | ||
|
|
||
| The transfer module, the packet forward middleware, and the rate limiting middleware support custom address codecs. This feature is primarily added to support Cosmos EVM for IBC transfers. In a standard Cosmos SDK app, they are wired as follows: | ||
|
|
||
| ```diff | ||
| app.TransferKeeper = ibctransferkeeper.NewKeeper( | ||
| appCodec, | ||
| + app.AccountKeeper.AddressCodec(), | ||
| runtime.NewKVStoreService(keys[ibctransfertypes.StoreKey]), | ||
| app.IBCKeeper.ChannelKeeper, | ||
| app.MsgServiceRouter(), | ||
| app.AccountKeeper, app.BankKeeper, | ||
| authtypes.NewModuleAddress(govtypes.ModuleName).String(), | ||
| ) | ||
| ``` | ||
|
|
||
| ```diff | ||
| app.RateLimitKeeper = ratelimitkeeper.NewKeeper( | ||
| appCodec, | ||
| + app.AccountKeeper.AddressCodec(), | ||
| runtime.NewKVStoreService(keys[ratelimittypes.StoreKey]), | ||
| app.IBCKeeper.ChannelKeeper, | ||
| app.IBCKeeper.ClientKeeper, | ||
| app.BankKeeper, | ||
| authtypes.NewModuleAddress(govtypes.ModuleName).String() | ||
| ) | ||
| ``` | ||
|
|
||
| ```diff | ||
| app.PFMKeeper = packetforwardkeeper.NewKeeper( | ||
| appCodec, | ||
| + app.AccountKeeper.AddressCodec(), | ||
| runtime.NewKVStoreService(keys[packetforwardtypes.StoreKey]), | ||
| app.TransferKeeper, | ||
| app.IBCKeeper.ChannelKeeper, | ||
| app.BankKeeper, | ||
| authtypes.NewModuleAddress(govtypes.ModuleName).String() | ||
| ) | ||
| ``` | ||
|
|
||
| ## ICS27-GMP | ||
|
|
||
| ICS27 General Message Passing (GMP) has been added as a supported IBC application of ibc-go. It has no parameters. | ||
|
|
||
| ### Add `StoreUpgrades` for ICS27-GMP module | ||
|
|
||
| If ICS27-GMP is being added to an existing chain, you must [manually add store upgrades](https://docs.cosmos.network/sdk/v0.53/learn/advanced/upgrade#add-storeupgrades-for-new-modules) for the new GMP module and configure the store loader to apply those upgrades in `app.go`: | ||
|
|
||
| ```go | ||
| if upgradeInfo.Name == "v11_1" && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { | ||
| storeUpgrades := store.StoreUpgrades{ | ||
| Added: []string{gmptypes.StoreKey}, | ||
| } | ||
|
|
||
| app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) | ||
| } | ||
| ``` | ||
|
|
||
| This ensures that the new module's stores are added to the multistore before the migrations begin. | ||
| If a chain does not integrate ICS27-GMP, it does not need to add the GMP key to the `Added` field. | ||
|
|
||
| ## Packet Forward Middleware (New in v11.1) | ||
|
|
||
| Packet Forward Middleware (PFM) has been moved from [cosmos/ibc-apps](https://github.com/cosmos/ibc-apps) to ibc-go in this release. PFM is now available under `modules/apps/packet-forward-middleware`. | ||
|
|
||
| Your migration path depends on whether your chain already uses PFM from ibc-apps. | ||
|
|
||
| ### If your chain already uses PFM from ibc-apps | ||
|
|
||
| Replace all ibc-apps PFM imports with the new ibc-go imports and review the [integration instructions](../04-middleware/02-packet-forward-middleware/02-integration.md). | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This step sends users to Useful? React with 👍 / 👎. |
||
|
|
||
| If your chain already has a PFM store from a previous upgrade, do not add `packetforwardtypes.StoreKey` as a new store in this upgrade. The ibc-go PFM module intentionally preserves the original module name and store key, including the `packetfowardmiddleware` spelling, for compatibility with the legacy implementation. | ||
|
|
||
| The PFM module includes in-place migrations for existing PFM state. Before upgrading, ensure there are no non-refundable in-flight packets. The v3-to-v4 PFM migration removes the deprecated `nonrefundable` field from in-flight packet state and aborts if any stored in-flight packet has `nonrefundable=true`. | ||
|
|
||
| ### If your chain is adding PFM for the first time | ||
|
|
||
| First follow the [integration instructions](../04-middleware/02-packet-forward-middleware/02-integration.md). | ||
|
|
||
| If PFM is being added to an existing chain, you must [manually add store upgrades](https://docs.cosmos.network/sdk/latest/guides/upgrades/upgrade#adding-new-modules-during-an-upgrade) for the new PFM module and configure the store loader to apply those upgrades in `app.go`. | ||
|
|
||
| If your upgrade also introduces ICS27-GMP, include both store keys: | ||
|
|
||
| ```go | ||
| if upgradeInfo.Name == "v11_1" && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { | ||
| storeUpgrades := store.StoreUpgrades{ | ||
| Added: []string{gmptypes.StoreKey, packetforwardtypes.StoreKey}, | ||
| } | ||
|
|
||
| app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) | ||
| } | ||
| ``` | ||
|
|
||
| This ensures that the new module's stores are added to the multistore before the migrations begin. | ||
| If your chain already added the ICS27-GMP store key in a previous upgrade, do not add `gmptypes.StoreKey` again. If your chain does not integrate PFM, it does not need to add the PFM key to the `Added` field. | ||
|
srdtrk marked this conversation as resolved.
Outdated
|
||
Uh oh!
There was an error while loading. Please reload this page.