本文档旨在突出显示一些重要变更,这些变更可能需要比 CHANGELOG 中提供的更多信息。 任何需要由 ibc-go 用户执行的变更都应记录在此。 根据本文档面向的四类潜在用户群体,内容分为四个部分:
  • 链
  • IBC 应用
  • 中继器
  • IBC 轻客户端
注意: ibc-go 遵循 Golang 语义化版本控制,因此在主版本发布时,所有导入路径都必须更新以提升版本号。
github.com/cosmos/ibc-go -> github.com/cosmos/ibc-go/v2

链

  • 此版本没有相关变更。

IBC 应用

应用模块接口中新增了一个函数:
/ NegotiateAppVersion performs application version negotiation given the provided channel ordering, connectionID, portID, counterparty and proposed version.
/ An error is returned if version negotiation cannot be performed. For example, an application module implementing this interface
/ may decide to return an error in the event of the proposed version being incompatible with it's own
NegotiateAppVersion(
  ctx sdk.Context,
  order channeltypes.Order,
  connectionID string,
  portID string,
  counterparty channeltypes.Counterparty,
  proposedVersion string,
) (version string, err error)
该函数应执行应用版本协商并返回协商后的版本。如果无法协商出版本,则应返回错误。该函数仅在客户端侧使用。

sdk.Result 已移除

在应用回调中,sdk.Result 已不再作为返回值。此前核心 IBC 会将其丢弃,因此实际上未被使用。

中继器

05-port 新增了一个 gRPC:AppVersion。它会返回协商后的应用版本。此函数应在 ChanOpenTry 通道握手步骤中使用,以决定应在通道中设置的应用版本。

IBC 轻客户端

  • 此版本没有相关变更。

This document is intended to highlight significant changes which may require more information than presented in the CHANGELOG. Any changes that must be done by a user of ibc-go should be documented here. There are four sections based on the four potential user groups of this document:
  • Chains
  • IBC Apps
  • Relayers
  • IBC Light Clients
Note: ibc-go supports golang semantic versioning and therefore all imports must be updated to bump the version number on major releases.
github.com/cosmos/ibc-go -> github.com/cosmos/ibc-go/v2

Chains

  • No relevant changes were made in this release.

IBC Apps

A new function has been added to the app module interface:
/ NegotiateAppVersion performs application version negotiation given the provided channel ordering, connectionID, portID, counterparty and proposed version.
/ An error is returned if version negotiation cannot be performed. For example, an application module implementing this interface
/ may decide to return an error in the event of the proposed version being incompatible with it's own
NegotiateAppVersion(
  ctx sdk.Context,
  order channeltypes.Order,
  connectionID string,
  portID string,
  counterparty channeltypes.Counterparty,
  proposedVersion string,
) (version string, err error)
This function should perform application version negotiation and return the negotiated version. If the version cannot be negotiated, an error should be returned. This function is only used on the client side.

sdk.Result removed

sdk.Result has been removed as a return value in the application callbacks. Previously it was being discarded by core IBC and was thus unused.

Relayers

A new gRPC has been added to 05-port, AppVersion. It returns the negotiated app version. This function should be used for the ChanOpenTry channel handshake step to decide upon the application version which should be set in the channel.

IBC Light Clients

  • No relevant changes were made in this release.