Skip to content

Commit ec94b51

Browse files
Clarify basic vs upgrade-specific validations + notice for upgradedConsState
1 parent 92e0334 commit ec94b51

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

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

Lines changed: 20 additions & 13 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+
upgrade-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,17 @@ 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 upgrade-specific was whether
57+
that IBC handler can perform that check just using its own contextual data,
58+
which are available upon calling interfaces provided by `ClientState` and
59+
`ConsensusState` traits, like `is_frozen()`, `latest_height()`, etc.
6160

6261
* Latest client state **MUST NOT** be frozen
6362
* Received update message including verification proofs **MUST** successfully be
@@ -66,6 +65,8 @@ provided by `ClientState` and `ConsensusState` traits, like `is_frozen()`,
6665
current revision which is somehow encoded in the proof verification process.
6766
This prevents premature upgrades, as the counterparty may cancel or modify
6867
upgrade plans before the last planned height.
68+
* Latest consensus state **MUST** be within the trusting period of the latest
69+
client state, which for clients without a trusting period is not applicable.
6970

7071
Any other requisite beyond the above rules are considered client-specific. Next,
7172
we go through the upgrade process for Tendermint clients to justify the logic
@@ -121,7 +122,9 @@ supported by `IBC-rs`:
121122
An IBC-connected Tendermint chain will take the following steps to completely
122123
upgrade its own chain and counterparty's IBC client. Note that the chain-level
123124
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.
125+
the sake of the big picture and as a reference to follow the upgrade process
126+
from the very beginning when a proposal is initiated to when the upgrade message
127+
is entirely handled.
125128

126129
1. Upgrade chain through governance
127130
1. Create a 02-client
@@ -147,17 +150,21 @@ the sake of the big picture and as an example of how the upgrade process can be.
147150
upgrade/UpgradedIBCState/{upgradeHeight}/upgradedConsState
148151
```
149152

153+
Notice that since the `UpgradedConsensusState` will not be available at
154+
the upgrade path prior to this height, relayers cannot submit a valid
155+
upgrade message as the proof verification would fail
156+
150157
2. Submit an upgrade client message by relayers to the counterparty chain
151158
1. Wait for the upgrading chain to reach the upgrade height and halt
152159
2. Query a full node for the proofs of `UpgradedClient` and
153160
`UpgradedConsensusState` at the last height of the old chain
154161
3. Update the counterparty client to the last height of the old chain using
155162
the `UpdateClient` msg
156-
4. Submit an `UpgradeClient` msg to the counterparty chain with the
163+
4. Submit a `MsgUpgradeClient` message to the counterparty chain with the
157164
`UpgradedClient`, `UpgradedConsensusState` and their respective proofs
158165

159166
3. Process the upgrade message on the counterparty chain upon receiving a
160-
`MsgUpgradeClient` message performs basic validations (BV), client-specific
167+
`MsgUpgradeClient` message performs basic validations (BV), upgrade-specific
161168
validations (SV) and lastly execution (E) steps as follows:
162169
1. (BV) Check that the current client is not frozen
163170
2. (BV) Check if the latest consensus state is within the trust period

0 commit comments

Comments
 (0)