本指南提供了迁移到 ibc-go v7.1.0 版本的说明。 本文档根据四类潜在用户群体分为四个部分: 注意: ibc-go 遵循 golang 语义化版本控制,因此所有导入路径都必须在主版本发布时更新。

链

在上一个 ibc-go 版本中,localhost v1 轻客户端模块已被弃用并移除。ibc-go v7.1.0 版本引入了 09-localhost 轻客户端模块的 v2 版本。 核心 IBC 模块中已配置自动迁移处理器,用于在状态中设置 localhost ClientState 和哨兵 ConnectionEnd。 为了使用 09-localhost 客户端,各链必须更新核心 IBC 的 02-client 子模块中的 AllowedClients 参数。该配置可以直接在应用升级处理器中完成,也可以通过旧版治理参数变更提案进行更新。 我们强烈建议各链执行此操作,以便能够通过熟悉的 IBC 接口进行账本内通信。 请参阅下方提供的升级处理器代码示例,或访问此链接查看 ibc-go simapp 使用的升级处理器。
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)
}
}

Transfer 模块迁移

transfer 模块中已配置自动迁移处理器,用于为所有已转出的各币种设置托管中的总金额。对每个币种都会新增一条状态记录,记录该币种处于托管中的代币总量,而不区分其经由哪个通道转出。

IBC 应用

  • 本次发布没有相关变更。

中继器

事件属性 packet_connection (connectiontypes.AttributeKeyConnection) 已被弃用。 请改用所有通道事件都会发出的 connection_id 属性 (connectiontypes.AttributeKeyConnectionID)。 此前只有 send packet、receive packet、write acknowledgement 和 acknowledge packet 事件会使用 packet_connection。

IBC 轻客户端

  • 本次发布没有相关变更。

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: 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. An automatic migration handler is configured in the core IBC module to set the localhost ClientState and sentinel 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 so that intra-ledger communication can be carried out using the familiar IBC interfaces. See the upgrade handler code sample provided below or follow this link for the upgrade handler used by the ibc-go simapp.
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)
}
}

Transfer migration

An automatic migration handler is configured in the transfer module to set the total amount in escrow for all denominations of coins that have been sent out. For each denomination a state entry is added with the total amount of coins in escrow regardless of the channel from which they were transferred.

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.