From 919ea9d2dfdc6880a9a09b7cc9a047c55b195b7f Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Fri, 24 Feb 2023 14:34:18 +0100 Subject: [PATCH 1/9] adding migration doc for v7.1 localhost addition --- docs/migrations/v7-to-v7_1.md | 71 +++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 docs/migrations/v7-to-v7_1.md diff --git a/docs/migrations/v7-to-v7_1.md b/docs/migrations/v7-to-v7_1.md new file mode 100644 index 00000000000..a97a3f787cd --- /dev/null +++ b/docs/migrations/v7-to-v7_1.md @@ -0,0 +1,71 @@ +# Migrating from v7 to v7.1 + +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: + +- [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 + +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. + +Chain developers must register the 09-localhost `AppModuleBasic` in `app.go`. + +```go +import ( + // ... + localhost "github.com/cosmos/ibc-go/v7/modules/light-clients/09-localhost" +) +// ... +ModuleBasics = module.NewBasicManager( + ... + ibc.AppModuleBasic{}, + localhost.AppModuleBasic{}, + ... +) +``` + + +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. + +```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 with the new default allowed clients + params := clienttypes.NewParams(clienttypes.DefaultAllowedClients...) + clientKeeper.SetParams(ctx, params) + + return mm.RunMigrations(ctx, configurator, vm) + } +} +``` + + + + +## IBC Apps + +- No relevant changes were made in this release. + +## Relayers + +The event attribute `packet_connection` (`connectiontypes.AttributeKeyConnection`) has been deprecated. +Please use the `connection_id` attribute (`connectiontypes.AttributeKeyConnectionID`) which is emitted by all channel events. +Only send packet, receive packet, write acknowledgement, and acknowledge packet events used `packet_connection` previously. + +## IBC Light Clients + +- No relevant changes were made in this release. \ No newline at end of file From 47712f0d533eca43f76c63c569e388915ab3c1e6 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Fri, 24 Feb 2023 14:36:13 +0100 Subject: [PATCH 2/9] adding todo for reminder --- docs/migrations/v7-to-v7_1.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/migrations/v7-to-v7_1.md b/docs/migrations/v7-to-v7_1.md index a97a3f787cd..748ec0f0dce 100644 --- a/docs/migrations/v7-to-v7_1.md +++ b/docs/migrations/v7-to-v7_1.md @@ -37,6 +37,8 @@ An [automatic migration handler](https://github.com/cosmos/ibc-go/blob/09-localh 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. + + ```go func CreateV7LocalhostUpgradeHandler( mm *module.Manager, From 1978080969fbc6ac6513dec9d2bbd38c08966914 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Mon, 27 Feb 2023 15:26:48 +0100 Subject: [PATCH 3/9] update upgrade handler in migration doc --- docs/migrations/v7-to-v7_1.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/migrations/v7-to-v7_1.md b/docs/migrations/v7-to-v7_1.md index 748ec0f0dce..0a45c1a7f8f 100644 --- a/docs/migrations/v7-to-v7_1.md +++ b/docs/migrations/v7-to-v7_1.md @@ -47,7 +47,8 @@ func CreateV7LocalhostUpgradeHandler( ) 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 - params := clienttypes.NewParams(clienttypes.DefaultAllowedClients...) + params := clientKeeper.GetParams(ctx) + params.AllowedClients = append(params.AllowedClients, exported.Localhost) clientKeeper.SetParams(ctx, params) return mm.RunMigrations(ctx, configurator, vm) From 3f2d0f35fef6661a903c0c3107cb23d237e528f3 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Mon, 27 Feb 2023 17:09:55 +0100 Subject: [PATCH 4/9] update client id const in upgrade handler code snippet --- docs/migrations/v7-to-v7_1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/migrations/v7-to-v7_1.md b/docs/migrations/v7-to-v7_1.md index 0a45c1a7f8f..d2c06069255 100644 --- a/docs/migrations/v7-to-v7_1.md +++ b/docs/migrations/v7-to-v7_1.md @@ -48,7 +48,7 @@ func CreateV7LocalhostUpgradeHandler( 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 params := clientKeeper.GetParams(ctx) - params.AllowedClients = append(params.AllowedClients, exported.Localhost) + params.AllowedClients = append(params.AllowedClients, exported.LocalhostClientID) clientKeeper.SetParams(ctx, params) return mm.RunMigrations(ctx, configurator, vm) From 2404200d3e2012147cd019385744702a56168ee4 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Mon, 27 Feb 2023 17:27:14 +0100 Subject: [PATCH 5/9] Update docs/migrations/v7-to-v7_1.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> --- docs/migrations/v7-to-v7_1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/migrations/v7-to-v7_1.md b/docs/migrations/v7-to-v7_1.md index d2c06069255..0a45c1a7f8f 100644 --- a/docs/migrations/v7-to-v7_1.md +++ b/docs/migrations/v7-to-v7_1.md @@ -48,7 +48,7 @@ func CreateV7LocalhostUpgradeHandler( 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 params := clientKeeper.GetParams(ctx) - params.AllowedClients = append(params.AllowedClients, exported.LocalhostClientID) + params.AllowedClients = append(params.AllowedClients, exported.Localhost) clientKeeper.SetParams(ctx, params) return mm.RunMigrations(ctx, configurator, vm) From 6439f5e5d7eaa47dcba86ca8cbfbee1b9f2b14de Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Wed, 1 Mar 2023 11:30:16 +0100 Subject: [PATCH 6/9] remove app module basic registration --- docs/migrations/v7-to-v7_1.md | 22 +++------------------- testing/simapp/upgrades/upgrades.go | 2 +- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/docs/migrations/v7-to-v7_1.md b/docs/migrations/v7-to-v7_1.md index 348b32ebbd6..2b3954d9a41 100644 --- a/docs/migrations/v7-to-v7_1.md +++ b/docs/migrations/v7-to-v7_1.md @@ -16,28 +16,12 @@ There are four sections based on the four potential user groups of this document 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. -Chain developers must register the 09-localhost `AppModuleBasic` in `app.go`. - -```go -import ( - // ... - localhost "github.com/cosmos/ibc-go/v7/modules/light-clients/09-localhost" -) -// ... -ModuleBasics = module.NewBasicManager( - ... - ibc.AppModuleBasic{}, - localhost.AppModuleBasic{}, - ... -) -``` - - + 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. - +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( @@ -46,7 +30,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) 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) From b19cd70a61e6d52c86bff5892b0d47ac432dce65 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Wed, 1 Mar 2023 16:25:04 +0100 Subject: [PATCH 7/9] adding migration doc to vuepress config. Uncommenting link to localhost docs --- docs/.vuepress/config.js | 5 +++++ docs/migrations/v7-to-v7_1.md | 11 +++++------ 2 files changed, 10 insertions(+), 6 deletions(-) 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 2b3954d9a41..34c4e6a69ef 100644 --- a/docs/migrations/v7-to-v7_1.md +++ b/docs/migrations/v7-to-v7_1.md @@ -5,10 +5,10 @@ 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: - [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) + - [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. @@ -40,8 +40,7 @@ func CreateV7LocalhostUpgradeHandler( } ``` - - +[For more information please refer to the 09-localhost light client module documentation](../ibc/light-clients/localhost/overview.md). ## IBC Apps From b4345aa329ecc650dfcfa9102b7a3d1fcadfdcad Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Date: Mon, 6 Mar 2023 09:16:26 +0100 Subject: [PATCH 8/9] code indentation --- docs/migrations/v7-to-v7_1.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/migrations/v7-to-v7_1.md b/docs/migrations/v7-to-v7_1.md index 34c4e6a69ef..8c5958012b1 100644 --- a/docs/migrations/v7-to-v7_1.md +++ b/docs/migrations/v7-to-v7_1.md @@ -5,10 +5,10 @@ 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: - [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) + - [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. @@ -25,18 +25,18 @@ See the upgrade handler code sample provided below or [follow this link](https:/ ```go func CreateV7LocalhostUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, - clientKeeper clientkeeper.Keeper, + 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) - } + 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) + } } ``` From 8ef3c59d6d12a8d6dcd3335ff13f816211a5fe49 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Mon, 6 Mar 2023 12:39:24 +0100 Subject: [PATCH 9/9] updating as per review suggestions --- docs/migrations/v7-to-v7_1.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/migrations/v7-to-v7_1.md b/docs/migrations/v7-to-v7_1.md index 8c5958012b1..c01c8a05375 100644 --- a/docs/migrations/v7-to-v7_1.md +++ b/docs/migrations/v7-to-v7_1.md @@ -20,6 +20,7 @@ In the previous release of ibc-go, the localhost `v1` light client module was de 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.