Skip to content
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

doc: adding migration doc for v7.1 localhost client #3210

Merged
merged 11 commits into from
Mar 7, 2023
5 changes: 5 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
],
},
{
Expand Down
40 changes: 34 additions & 6 deletions docs/migrations/v7-to-v7_1.md
Original file line number Diff line number Diff line change
@@ -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.

<!-- TODO: Update the links to use release version instead of feat branch -->
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked with @womensrights and she is fine with this approach, but she suggested to add a line here advising/encouraging chains to enable it. So maybe something like "We strongly recommend chains to perform this action".

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

Expand Down
2 changes: 1 addition & 1 deletion testing/simapp/upgrades/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down