Skip to content

Commit 1179885

Browse files
ICS 06: updates for cosmos/ibc-go#4429
1 parent 727ae4c commit 1179885

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

spec/client/ics-006-solo-machine-client/README.md

+22-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ stage: draft
55
category: IBC/TAO
66
kind: instantiation
77
implements: 2
8-
version compatibility: ibc-go v7.0.0
8+
version compatibility: ibc-go v7.3.0
99
author: Christopher Goes <[email protected]>
1010
created: 2019-12-09
1111
modified: 2019-12-09
@@ -25,6 +25,10 @@ Solo machine clients are roughly analogous to "implicit accounts" and can be use
2525

2626
Functions & terms are as defined in [ICS 2](../../core/ics-002-client-semantics).
2727

28+
`getCommitmentPrefix` is as defined in [ICS 24](../../core/ics-024-host-requirements).
29+
30+
`removePrefix` is as defined in [ICS 23](../../core/ics-023-vector-commitments).
31+
2832
### Desired properties
2933

3034
This specification must satisfy the client interface defined in [ICS 2](../../core/ics-002-client-semantics).
@@ -270,11 +274,18 @@ function verifyMembership(
270274
// the expected sequence used in the signature
271275
abortTransactionUnless(!clientState.frozen)
272276
abortTransactionUnless(proof.timestamp >= clientState.consensusState.timestamp)
277+
278+
// path is prefixed with the store prefix of the commitment proof
279+
// e.g. in ibc-go implementation this is "ibc"
280+
// since solomachines do not use multi-stores, the prefix needs
281+
// to be removed from the path to retrieve the correct key in the
282+
// solomachine store
283+
unprefixedPath = removePrefix(getCommitmentPrefix(), path)
273284
signBytes = SignBytes(
274285
sequence: clientState.sequence,
275286
timestamp: proof.timestamp,
276287
diversifier: clientState.consensusState.diversifier,
277-
path: path.String(),
288+
path: unprefixedPath,
278289
data: value,
279290
)
280291
proven = checkSignature(clientState.consensusState.publicKey, signBytes, proof.sig)
@@ -308,11 +319,18 @@ function verifyNonMembership(
308319
): Error {
309320
abortTransactionUnless(!clientState.frozen)
310321
abortTransactionUnless(proof.timestamp >= clientState.consensusState.timestamp)
322+
323+
// path is prefixed with the store prefix of the commitment proof
324+
// e.g. in ibc-go implementation this is "ibc"
325+
// since solomachines do not use multi-stores, the prefix needs
326+
// to be removed from the path to retrieve the correct key in the
327+
// solomachine store
328+
unprefixedPath = removePrefix(getCommitmentPrefix(), path)
311329
signBytes = SignBytes(
312330
sequence: clientState.sequence,
313331
timestamp: proof.timestamp,
314332
diversifier: clientState.consensusState.diversifier,
315-
path: path.String(),
333+
path: unprefixedPath,
316334
data: nil,
317335
)
318336
proven = checkSignature(clientState.consensusState.publicKey, signBytes, proof.sig)
@@ -354,6 +372,7 @@ Not applicable. Alterations to the client verification algorithm will require a
354372
December 9th, 2019 - Initial version
355373
December 17th, 2019 - Final first draft
356374
August 15th, 2022 - Changes to align with 02-client-refactor in [\#813](https://github.com/cosmos/ibc/pull/813)
375+
September 14th, 2022 - Changes to align with changes in [\#4429](https://github.com/cosmos/ibc-go/pull/4429)
357376

358377
## Copyright
359378

spec/client/ics-009-loopback-cilent/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ Functions & terms are as defined in [ICS 2](../../core/ics-002-client-semantics)
2525

2626
`ConnectionEnd` and `generateIdentifier` are as defined in [ICS 3](../../core/ics-003-connection-semantics)
2727

28-
`getCommitmentPrefix` and `removePrefix` are as defined in [ICS 24](../../core/ics-024-host-requirements).
28+
`getCommitmentPrefix` is as defined in [ICS 24](../../core/ics-024-host-requirements).
29+
30+
`removePrefix` is as defined in [ICS 23](../../core/ics-023-vector-commitments).
2931

3032
### Desired Properties
3133

0 commit comments

Comments
 (0)