From 3a96232f38675345260113303365a89c0cf8434b Mon Sep 17 00:00:00 2001 From: Aditya Sripal Date: Tue, 15 Mar 2022 17:12:42 +0100 Subject: [PATCH 1/2] add generic verify method, and remove bespoke optional verification method --- spec/core/ics-002-client-semantics/README.md | 30 ++++++++++++++------ 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/spec/core/ics-002-client-semantics/README.md b/spec/core/ics-002-client-semantics/README.md index e46d63f6f..d5029253a 100644 --- a/spec/core/ics-002-client-semantics/README.md +++ b/spec/core/ics-002-client-semantics/README.md @@ -429,26 +429,40 @@ type verifyNextSequenceRecv = ( => boolean ``` -#### Optional Functions +`verifyMembership` is a generic proof verification method which verifies a proof of the existence a value at a given `CommitmentPath` at the specified height. +The caller is expected to construct the full `CommitmentPath` from a `CommitmentPrefix` and a standardized path. If the caller desires a particular delay period to be enforced, +then it can pass in a non-zero `delayPeriodTime` or `delayPeriodBlocks`. If a delay period is not necessary, the caller must pass in 0 for `delayPeriodTime` and `delayPeriodBlocks`, +and the client will not enforce any delay period for verification. +```typescript +type verifyMembership = ( + clientState: ClientState, + height: Height, + delayPeriodTime: uint64, + delayPeriodBlocks: uint64, + proof: CommitmentProof, + path: CommitmentPath, + value: bytes) + => boolean +``` -`verifyPacketReceipt` verifies a proof of an incoming packet receipt at the specified port, specified channel, and specified sequence. It is needed only if the chain wishes to support new channel types other than ORDERED and UNORDERED. +`verifyNonMembership` is a generic proof verification method which verifies a proof of absence at a given `CommitmentPath` at the specified height. +The caller is expected to construct the full `CommitmentPath` from a `CommitmentPrefix` and a standardized path. If the caller desires a particular delay period to be enforced, +then it can pass in a non-zero `delayPeriodTime` or `delayPeriodBlocks`. If a delay period is not necessary, the caller must pass in 0 for `delayPeriodTime` and `delayPeriodBlocks`, +and the client will not enforce any delay period for verification. ```typescript -type verifyPacketReceipt = ( +type verifyNonMembership = ( clientState: ClientState, height: Height, delayPeriodTime: uint64, delayPeriodBlocks: uint64, - prefix: CommitmentPrefix, proof: CommitmentProof, - portIdentifier: Identifier, - channelIdentifier: Identifier, - sequence: uint64, - receipt: bytes) + path: CommitmentPath) => boolean ``` + #### Query interface ##### Chain queries From 34be3abdb8d7ee1e0191ac180a523e24c17368ae Mon Sep 17 00:00:00 2001 From: Aditya Date: Thu, 17 Mar 2022 11:10:28 +0100 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Marius Poke --- spec/core/ics-002-client-semantics/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/core/ics-002-client-semantics/README.md b/spec/core/ics-002-client-semantics/README.md index d5029253a..c25c19494 100644 --- a/spec/core/ics-002-client-semantics/README.md +++ b/spec/core/ics-002-client-semantics/README.md @@ -429,8 +429,8 @@ type verifyNextSequenceRecv = ( => boolean ``` -`verifyMembership` is a generic proof verification method which verifies a proof of the existence a value at a given `CommitmentPath` at the specified height. -The caller is expected to construct the full `CommitmentPath` from a `CommitmentPrefix` and a standardized path. If the caller desires a particular delay period to be enforced, +`verifyMembership` is a generic proof verification method which verifies a proof of the existence of a value at a given `CommitmentPath` at the specified height. +The caller is expected to construct the full `CommitmentPath` from a `CommitmentPrefix` and a standardized path (as defined in [ICS 24](../ics-024-host-requirements/README.md#path-space)). If the caller desires a particular delay period to be enforced, then it can pass in a non-zero `delayPeriodTime` or `delayPeriodBlocks`. If a delay period is not necessary, the caller must pass in 0 for `delayPeriodTime` and `delayPeriodBlocks`, and the client will not enforce any delay period for verification. @@ -446,8 +446,8 @@ type verifyMembership = ( => boolean ``` -`verifyNonMembership` is a generic proof verification method which verifies a proof of absence at a given `CommitmentPath` at the specified height. -The caller is expected to construct the full `CommitmentPath` from a `CommitmentPrefix` and a standardized path. If the caller desires a particular delay period to be enforced, +`verifyNonMembership` is a generic proof verification method which verifies a proof of absence of a given `CommitmentPath` at the specified height. +The caller is expected to construct the full `CommitmentPath` from a `CommitmentPrefix` and a standardized path (as defined in [ICS 24](../ics-024-host-requirements/README.md#path-space)). If the caller desires a particular delay period to be enforced, then it can pass in a non-zero `delayPeriodTime` or `delayPeriodBlocks`. If a delay period is not necessary, the caller must pass in 0 for `delayPeriodTime` and `delayPeriodBlocks`, and the client will not enforce any delay period for verification.