Skip to content

[ICS02] Design flaw of verify_upgrade_client function of ClientState trait #739

Closed
@riversyang

Description

@riversyang

Problem Statement

While implementing ICS12 (client for NEAR protocol) based on ibc-rs, I found that the verify_upgrade_client function of ClientState trait will NOT work when the client needs to use a proof verification algorithm other than Merkle proof.

https://github.com/cosmos/ibc-rs/blob/1c5b50b17894ef86c048cc8e874e09020f0a3bcd/crates/ibc/src/core/ics02_client/client_state.rs#L124-L131

As in NEAR protocol, the state proof is MPT proof rather than Merkle proof, we can not construct a Merkle proof for this function. But we can implement verify_membership and verify_non_membership functions for NEAR client like I did here, because they are using generic data type for proofs.

Solution Proposal

To resolve this issue, the proposed solution is to change the data types of proof_upgrade_client and proof_upgrade_consensus_state to CommitmentProofBytes, similar to the design of verify_membership and verify_non_membership. This modification will allow the implementation of clients to choose their own verification algorithms.

Metadata

Metadata

Labels

A: breakingAdmin: breaking change that may impact operators

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions