diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index ee649dd9a81..90e172b6cf4 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -545,6 +545,11 @@ module.exports = { directory: false, path: "/migrations/v6-to-v7.html", }, + { + title: "IBC-Go v7 to v7.1", + directory: false, + path: "/migrations/v7-to-v7_1.html", + }, ], }, { diff --git a/docs/migrations/v7-to-v7_1.md b/docs/migrations/v7-to-v7_1.md index 00a233a0ac4..c01c8a05375 100644 --- a/docs/migrations/v7-to-v7_1.md +++ b/docs/migrations/v7-to-v7_1.md @@ -1,19 +1,47 @@ # Migrating from v7 to v7.1 -This guide provides instructions for migrating to a new version of ibc-go. +This guide provides instructions for migrating to version `v7.1.0` of ibc-go. There are four sections based on the four potential user groups of this document: -- [Chains](#chains) -- [IBC Apps](#ibc-apps) -- [Relayers](#relayers) -- [IBC Light Clients](#ibc-light-clients) +- [Migrating from v7 to v7.1](#migrating-from-v7-to-v71) + - [Chains](#chains) + - [IBC Apps](#ibc-apps) + - [Relayers](#relayers) + - [IBC Light Clients](#ibc-light-clients) **Note:** ibc-go supports golang semantic versioning and therefore all imports must be updated on major version releases. ## Chains -- No relevant changes were made in this release. +In the previous release of ibc-go, the localhost `v1` light client module was deprecated and removed. The ibc-go `v7.1.0` release introduces `v2` of the 09-localhost light client module. + + +An [automatic migration handler](https://github.com/cosmos/ibc-go/blob/09-localhost/modules/core/module.go#L133-L145) is configured in the core IBC module to set the localhost `ClientState` and sentintel `ConnectionEnd` in state. + +In order to use the 09-localhost client chains must update the `AllowedClients` parameter in the 02-client submodule of core IBC. This can be configured directly in the application upgrade handler or alternatively updated via the legacy governance parameter change proposal. +We __strongly__ recommend chains to perform this action. + +See the upgrade handler code sample provided below or [follow this link](https://github.com/cosmos/ibc-go/blob/09-localhost/testing/simapp/upgrades/upgrades.go#L85) for the upgrade handler used by the ibc-go simapp. + +```go +func CreateV7LocalhostUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + clientKeeper clientkeeper.Keeper, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + // explicitly update the IBC 02-client params, adding the localhost client type + params := clientKeeper.GetParams(ctx) + params.AllowedClients = append(params.AllowedClients, exported.Localhost) + clientKeeper.SetParams(ctx, params) + + return mm.RunMigrations(ctx, configurator, vm) + } +} +``` + +[For more information please refer to the 09-localhost light client module documentation](../ibc/light-clients/localhost/overview.md). ## IBC Apps diff --git a/testing/simapp/upgrades/upgrades.go b/testing/simapp/upgrades/upgrades.go index 40535eba24a..1adf5eb3e68 100644 --- a/testing/simapp/upgrades/upgrades.go +++ b/testing/simapp/upgrades/upgrades.go @@ -88,7 +88,7 @@ func CreateV7LocalhostUpgradeHandler( clientKeeper clientkeeper.Keeper, ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - // explicitly update the IBC 02-client params with the new default allowed clients + // explicitly update the IBC 02-client params, adding the localhost client type params := clientKeeper.GetParams(ctx) params.AllowedClients = append(params.AllowedClients, exported.Localhost) clientKeeper.SetParams(ctx, params)