Skip to content

Commit 7dcbdb4

Browse files
Clarify basic vs msg-specific validations + notice for upgradedConsState
1 parent 92e0334 commit 7dcbdb4

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

docs/architecture/adr-006-upgrade-client-implementation.md

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ capability, chains that implement `IBC-rs` may bring various concerns and
1414
characteristics than Tendermint chains leading to different ways for upgrading
1515
their clients. However there are general rules that apply to all and can serve
1616
as a framework for any `IBC-rs` implementation. On this basis, this record aims
17-
to justify the logic behind upgrading a light client, determine the boundary
18-
between client-wide and client-specific upgrade processes, list requisites for
19-
validation and execution steps, and explain Tendermint's upgrade client
20-
implementation within the
17+
to justify the chain-wide logic behind upgrading light clients, list requisites
18+
for validation and execution steps, determine the boundary between basic and
19+
message-specific validations by an IBC handler, and explain Tendermint's upgrade
20+
client implementation within the
2121
[ics07_tendermint](../../crates/ibc/src/clients/ics07_tendermint).
2222

2323
## Decision
@@ -46,18 +46,18 @@ implementation of this rationale in `IBC-rs` is explained.
4646
* It is **UP TO** the chain's architecture how updated client and consensus
4747
states are committed, either through decentralized approaches, like governance
4848
or centralized methods, like a multisig account, etc.
49-
* Upon commitment, chain's store **MUST** contain updated client and consensus
49+
* Upon commitment, chain's store **MUST** contain upgraded client and consensus
5050
states, which can be retrieved using respective upgrade paths
5151

5252
#### IBC Handler accepts upgrade?
5353

5454
After ensuring that the chain upgrades is supported by IBC, the general
5555
validation and execution steps that apply to all chains are as follows. The
56-
criteria for classifying a validation as client-wide (also can be known as
57-
basic) or client-specific was whether that IBC handler can perform that action
58-
just using its own context data, which are available upon calling interfaces
59-
provided by `ClientState` and `ConsensusState` traits, like `is_frozen()`,
60-
`latest_height()`, etc.
56+
criteria for classifying a validation as basic or message-specific was whether
57+
that IBC handler can perform that action , regardless of knowing the message
58+
content, just using its own context data that are available upon calling
59+
provided interfaces by `ClientState` and `ConsensusState` traits, like
60+
`is_frozen()`, `latest_height()`, etc.
6161

6262
* Latest client state **MUST NOT** be frozen
6363
* Received update message including verification proofs **MUST** successfully be
@@ -66,6 +66,8 @@ provided by `ClientState` and `ConsensusState` traits, like `is_frozen()`,
6666
current revision which is somehow encoded in the proof verification process.
6767
This prevents premature upgrades, as the counterparty may cancel or modify
6868
upgrade plans before the last planned height.
69+
* Latest consensus state **MUST** be within the trusting period of the latest
70+
client state, which for clients without a trusting period is always true.
6971

7072
Any other requisite beyond the above rules are considered client-specific. Next,
7173
we go through the upgrade process for Tendermint clients to justify the logic
@@ -121,7 +123,9 @@ supported by `IBC-rs`:
121123
An IBC-connected Tendermint chain will take the following steps to completely
122124
upgrade its own chain and counterparty's IBC client. Note that the chain-level
123125
upgrade instruction (1) is not a part of the IBC protocol. It is provided for
124-
the sake of the big picture and as an example of how the upgrade process can be.
126+
the sake of the big picture and as a reference to follow the upgrade process
127+
from the very beginning when a proposal is initiated to when the upgrade message
128+
is entirely handled.
125129

126130
1. Upgrade chain through governance
127131
1. Create a 02-client
@@ -147,17 +151,21 @@ the sake of the big picture and as an example of how the upgrade process can be.
147151
upgrade/UpgradedIBCState/{upgradeHeight}/upgradedConsState
148152
```
149153

154+
Notice that since the `UpgradedConsensusState` will not be available at
155+
the upgrade path prior to this height, relayers cannot submit a valid
156+
upgrade message as the proof verification would fail
157+
150158
2. Submit an upgrade client message by relayers to the counterparty chain
151159
1. Wait for the upgrading chain to reach the upgrade height and halt
152160
2. Query a full node for the proofs of `UpgradedClient` and
153161
`UpgradedConsensusState` at the last height of the old chain
154162
3. Update the counterparty client to the last height of the old chain using
155163
the `UpdateClient` msg
156-
4. Submit an `UpgradeClient` msg to the counterparty chain with the
164+
4. Submit a `MsgUpgradeClient` message to the counterparty chain with the
157165
`UpgradedClient`, `UpgradedConsensusState` and their respective proofs
158166

159167
3. Process the upgrade message on the counterparty chain upon receiving a
160-
`MsgUpgradeClient` message performs basic validations (BV), client-specific
168+
`MsgUpgradeClient` message performs basic validations (BV), message-specific
161169
validations (SV) and lastly execution (E) steps as follows:
162170
1. (BV) Check that the current client is not frozen
163171
2. (BV) Check if the latest consensus state is within the trust period
@@ -189,7 +197,7 @@ validations (SV) and lastly execution (E) steps as follows:
189197
the connection can be used for relaying packets, relayers must submit an
190198
`UpdateClientMsg` with a header from the new chain.
191199

192-
4. Submit an `UpdateClient` msg by a relayer to the counterparty chain with a
200+
1. Submit an `UpdateClient` msg by a relayer to the counterparty chain with a
193201
header from the newly upgraded chain
194202

195203
#### Decisions

0 commit comments

Comments
 (0)