Status 方法
Status 必须返回客户端的状态。
Active状态表示客户端允许处理数据包。Frozen状态表示在对手链上检测到了误行为,因此该客户端不允许被使用。Expired状态表示客户端由于超过信任期未更新,因此不允许被使用。Unknown状态表示在确定客户端状态时发生了错误。
Status 类型可在此处找到。
该字段会在 gRPC ibc.core.client.v1.Query/ClientStatus 端点的响应中返回。
TimestampAtHeight 方法
TimestampAtHeight 必须返回与所提供高度关联的共识状态时间戳。
该值用于通过将数据包超时时间戳与返回值进行比较来支持超时检查。
LatestHeight 方法
LatestHeight 应返回客户端状态所表示的最新区块高度。
Initialize 方法
客户端必须验证初始共识状态,并在提供的客户端存储中设置初始客户端状态和共识状态。
客户端也可以存储任何必要的客户端专属元数据。
当创建客户端时,会调用 Initialize。
UpdateState 方法
UpdateState 会根据需要更新并存储 IBC 客户端的相关信息,例如 ClientState 及其对应的 ConsensusState。更多信息请参见UpdateState一节。
UpdateStateOnMisbehaviour 方法
UpdateStateOnMisbehaviour 应在检测并验证到误行为后,对客户端状态执行适当的状态变更。更多信息请参见UpdateStateOnMisbehaviour一节。
VerifyMembership 方法
VerifyMembership 必须验证在指定高度的给定承诺路径上某个值的存在性。有关成员证明的更多信息,请参见存在性与不存在性证明一节。
VerifyNonMembership 方法
VerifyNonMembership 必须验证在指定高度的给定承诺路径上某个值的不存在性。有关非成员证明的更多信息,请参见存在性与不存在性证明一节。
VerifyClientMessage 方法
VerifyClientMessage 必须验证 ClientMessage。ClientMessage 可以是 Header、Misbehaviour 或批量更新。
它必须适当地处理每一种 ClientMessage 类型。对 CheckForMisbehaviour、UpdateState 和 UpdateStateOnMisbehaviour
的调用都会假定 ClientMessage 的内容已经通过验证且可以被信任。如果 ClientMessage 验证失败,
则应返回错误。更多信息请参见VerifyClientMessage一节。
CheckForMisbehaviour 方法
检查 Header 或 Misbehaviour 类型中是否存在误行为证据。它假定 ClientMessage
已经完成验证。更多信息请参见CheckForMisbehaviour一节。
RecoverClient 方法
RecoverClient 用于通过使用替代客户端的状态更新目标客户端,从而恢复已过期或已冻结的客户端。该方法必须验证所提供的替代客户端可用于更新目标客户端。更多信息请参见实现 RecoverClient一节。
VerifyUpgradeAndUpdateState 方法
VerifyUpgradeAndUpdateState 提供了一条客户端升级路径,给定升级后的 ClientState、升级后的 ConsensusState 以及各自的证明即可完成升级。更多信息请参见实现 VerifyUpgradeAndUpdateState一节。
Status method
Status must return the status of the client.
- An
Activestatus indicates that clients are allowed to process packets. - A
Frozenstatus indicates that misbehaviour was detected in the counterparty chain and the client is not allowed to be used. - An
Expiredstatus indicates that a client is not allowed to be used because it was not updated for longer than the trusting period. - An
Unknownstatus indicates that there was an error in determining the status of a client.
Status types can be found here.
This field is returned in the response of the gRPC ibc.core.client.v1.Query/ClientStatus endpoint.
TimestampAtHeight method
TimestampAtHeight must return the timestamp for the consensus state associated with the provided height.
This value is used to facilitate timeouts by checking the packet timeout timestamp against the returned value.
LatestHeight method
LatestHeight should return the latest block height that the client state represents.
Initialize method
Clients must validate the initial consensus state, and set the initial client state and consensus state in the provided client store.
Clients may also store any necessary client-specific metadata.
Initialize is called when a client is created.
UpdateState method
UpdateState updates and stores as necessary any associated information for an IBC client, such as the ClientState and corresponding ConsensusState. See section UpdateState for more information.
UpdateStateOnMisbehaviour method
UpdateStateOnMisbehaviour should perform appropriate state changes on a client state given that misbehaviour has been detected and verified. See section UpdateStateOnMisbehaviour for more information.
VerifyMembership method
VerifyMembership must verify the existence of a value at a given commitment path at the specified height. For more information about membership proofs
see the Existence and non-existence proofs section.
VerifyNonMembership method
VerifyNonMembership must verify the absence of a value at a given commitment path at a specified height. For more information about non-membership proofs
see the Existence and non-existence proofs section.
VerifyClientMessage method
VerifyClientMessage must verify a ClientMessage. A ClientMessage could be a Header, Misbehaviour, or batch update.
It must handle each type of ClientMessage appropriately. Calls to CheckForMisbehaviour, UpdateState, and UpdateStateOnMisbehaviour
will assume that the content of the ClientMessage has been verified and can be trusted. An error should be returned
if the ClientMessage fails to verify. See section VerifyClientMessage for more information.
CheckForMisbehaviour method
Checks for evidence of a misbehaviour in Header or Misbehaviour type. It assumes the ClientMessage
has already been verified. See section CheckForMisbehaviour for more information.
RecoverClient method
RecoverClient is used to recover an expired or frozen client by updating the client with the state of a substitute client. The method must verify that the provided substitute may be used to update the subject client. See section Implementing RecoverClient for more information.
VerifyUpgradeAndUpdateState method
VerifyUpgradeAndUpdateState provides a path to upgrading clients given an upgraded ClientState, upgraded ConsensusState and proofs for each. See section Implementing VerifyUpgradeAndUpdateState for more information.