Skip to content

Commit 01f2e96

Browse files
AdityaSripalcolin-axnercrodriguezvega
authored
ICS-3: Removal of Client Validation from Connection Handshake (#1128)
* remove client validation in spec, add diagrams and explanation doc * linter * Update spec/core/ics-003-connection-semantics/client-validation-removal.md Co-authored-by: colin axnér <[email protected]> * remove some usage of hostConsensusStateProof and deprecate fields in ICS026 datagrams * Update README.md --------- Co-authored-by: colin axnér <[email protected]> Co-authored-by: Carlos Rodriguez <[email protected]>
1 parent 2003a86 commit 01f2e96

File tree

5 files changed

+841
-38
lines changed

5 files changed

+841
-38
lines changed

spec/core/ics-003-connection-semantics/README.md

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ category: IBC/TAO
66
kind: instantiation
77
requires: 2, 24
88
required-by: 4, 25
9-
version compatibility: ibc-go v7.0.0
9+
version compatibility: ibc-go v9.0.0
1010
author: Christopher Goes <[email protected]>, Juwoon Yun <[email protected]>
1111
created: 2019-03-07
12-
modified: 2019-08-25
12+
modified: 2024-07-23
1313
---
1414

1515
## Synopsis
@@ -464,25 +464,21 @@ function connOpenTry(
464464
counterpartyPrefix: CommitmentPrefix,
465465
counterpartyClientIdentifier: Identifier,
466466
clientIdentifier: Identifier,
467-
clientState: ClientState,
467+
clientState: ClientState, // DEPRECATED
468468
counterpartyVersions: string[],
469469
delayPeriodTime: uint64,
470470
delayPeriodBlocks: uint64,
471471
proofInit: CommitmentProof,
472-
proofClient: CommitmentProof,
473-
proofConsensus: CommitmentProof,
472+
proofClient: CommitmentProof, // DEPRECATED
473+
proofConsensus: CommitmentProof, // DEPRECATED
474474
proofHeight: Height,
475475
consensusHeight: Height,
476-
hostConsensusStateProof?: bytes,
476+
hostConsensusStateProof?: bytes, // DEPRECATED
477477
) {
478478
// generate a new identifier
479479
identifier = generateIdentifier()
480480

481481
abortTransactionUnless(queryClientState(clientIdentifier) !== null)
482-
abortTransactionUnless(validateSelfClient(clientState))
483-
abortTransactionUnless(consensusHeight < getCurrentHeight())
484-
expectedConsensusState = getConsensusState(consensusHeight, hostConsensusStateProof)
485-
abortTransactionUnless(expectedConsensusState !== null)
486482
expectedConnectionEnd = ConnectionEnd{INIT, "", getCommitmentPrefix(), counterpartyClientIdentifier,
487483
clientIdentifier, counterpartyVersions, delayPeriodTime, delayPeriodBlocks}
488484

@@ -492,10 +488,7 @@ function connOpenTry(
492488
connection = ConnectionEnd{TRYOPEN, counterpartyConnectionIdentifier, counterpartyPrefix,
493489
clientIdentifier, counterpartyClientIdentifier, [version], delayPeriodTime, delayPeriodBlocks}
494490
abortTransactionUnless(connection.verifyConnectionState(proofHeight, proofInit, counterpartyConnectionIdentifier, expectedConnectionEnd))
495-
abortTransactionUnless(connection.verifyClientState(proofHeight, proofClient, clientState))
496-
abortTransactionUnless(connection.verifyClientConsensusState(
497-
proofHeight, proofConsensus, counterpartyClientIdentifier, consensusHeight, expectedConsensusState))
498-
491+
499492
provableStore.set(connectionPath(identifier), connection)
500493
addConnectionToClient(clientIdentifier, identifier)
501494
}
@@ -506,30 +499,30 @@ function connOpenTry(
506499
```typescript
507500
function connOpenAck(
508501
identifier: Identifier,
509-
clientState: ClientState,
502+
clientState: ClientState, // DEPRECATED
510503
version: string,
511504
counterpartyIdentifier: Identifier,
512505
proofTry: CommitmentProof,
513-
proofClient: CommitmentProof,
514-
proofConsensus: CommitmentProof,
506+
proofClient: CommitmentProof, // DEPRECATED
507+
proofConsensus: CommitmentProof, // DEPRECATED
515508
proofHeight: Height,
516509
consensusHeight: Height,
517-
hostConsensusStateProof?: bytes,
510+
hostConsensusStateProof?: bytes, // DEPRECATED
518511
) {
519-
abortTransactionUnless(consensusHeight < getCurrentHeight())
520-
abortTransactionUnless(validateSelfClient(clientState))
521512
connection = provableStore.get(connectionPath(identifier))
522513
abortTransactionUnless(connection !== null)
523-
abortTransactionUnless((connection.state === INIT && connection.versions.indexOf(version) !== -1)
524-
expectedConsensusState = getConsensusState(consensusHeight, hostConsensusStateProof)
525-
abortTransactionUnless(expectedConsensusState !== null)
526-
expectedConnectionEnd = ConnectionEnd{TRYOPEN, identifier, getCommitmentPrefix(),
527-
connection.counterpartyClientIdentifier, connection.clientIdentifier,
528-
[version], connection.delayPeriodTime, connection.delayPeriodBlocks}
514+
abortTransactionUnless(connection.state === INIT && connection.versions.indexOf(version) !== -1)
515+
expectedConnectionEnd = ConnectionEnd{
516+
TRYOPEN,
517+
identifier,
518+
getCommitmentPrefix(),
519+
connection.counterpartyClientIdentifier,
520+
connection.clientIdentifier,
521+
[version],
522+
connection.delayPeriodTime,
523+
connection.delayPeriodBlocks
524+
}
529525
abortTransactionUnless(connection.verifyConnectionState(proofHeight, proofTry, counterpartyIdentifier, expectedConnectionEnd))
530-
abortTransactionUnless(connection.verifyClientState(proofHeight, proofClient, clientState))
531-
abortTransactionUnless(connection.verifyClientConsensusState(
532-
proofHeight, proofConsensus, connection.counterpartyClientIdentifier, consensusHeight, expectedConsensusState))
533526
connection.state = OPEN
534527
connection.versions = [version]
535528
connection.counterpartyConnectionIdentifier = counterpartyIdentifier
@@ -580,7 +573,7 @@ function queryClientConnections(id: Identifier): Set<Identifier> {
580573
581574
## Backwards Compatibility
582575
583-
Not applicable.
576+
In the latest specification of the connection handshake, `connOpenTry` and `connOpenAck` will no longer validate that the counterparty's clien state and consensus state is a valid client of the executing chain's consensus protocol. Thus, `clientState`, `proofClient`, `proofConsensus` and `consensusHeight` fields in the `ConnOpenTry` and `ConnOpenACk` datagrams are deprecated and will eventually be removed.
584577
585578
## Forwards Compatibility
586579
@@ -605,6 +598,8 @@ Jul 29, 2019 - Revisions to track connection set associated with client
605598
606599
Jul 27, 2022 - Addition of `ClientState` validation in `connOpenTry` and `connOpenAck`
607600
601+
Jul 23, 2024 - [Removal of `ClientState` and `ConsensusState` validation in `connOpenTry` and `connOpenAck`](https://github.com/cosmos/ibc/pull/1128). For information on the consequences of these changes see the attached [diagram](./client-validation-removal.png) and [consequences document](./client-validation-removal.md)
602+
608603
## Copyright
609604
610605
All content herein is licensed under [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0).

0 commit comments

Comments
 (0)