Skip to content

Commit

Permalink
docs: light client dev guide CheckSubstituteAndUpdateState (#2981)
Browse files Browse the repository at this point in the history
  • Loading branch information
charleenfei authored Jan 11, 2023
1 parent 737e097 commit 70f03b1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion docs/ibc/light-clients/proposal.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
<!--
order: 9
-->
-->

# Implementing `CheckSubstituteAndUpdateState`

`CheckSubstituteAndUpdateState` will try to update the client with the state of the substitute client. [This type of governance proposal](https://ibc.cosmos.network/main/ibc/proposals.html) is typically used to recover an expired and frozen client, as it can recover the entire state and therefore all existing channels built on top of the client.

Prior to updating, this function must verify that:
- the substitute client is the same type as the subject client. For a reference implementation, please see the [Tendermint light client](https://github.com/cosmos/ibc-go/blob/02-client-refactor-beta1/modules/light-clients/07-tendermint/proposal_handle.go#L32).
- the provided substitute may be used to update the subject client. This may mean that certain parameters must remain unaltered. For example, a [valid substitute Tendermint light client](https://github.com/cosmos/ibc-go/blob/02-client-refactor-beta1/modules/light-clients/07-tendermint/proposal_handle.go#L84) must NOT change the chain ID, trust level, max clock drift, unbonding period, proof specs or upgrade path. Please note that `AllowUpdateAfterMisbehaviour` and `AllowUpdateAfterExpiry` have been deprecated (see ADR 026 for more information).

After these checks are performed, the function must [set the updated client and consensus states](https://github.com/cosmos/ibc-go/blob/02-client-refactor-beta1/modules/light-clients/07-tendermint/proposal_handle.go#L77) within the clientStore for the subject client.

0 comments on commit 70f03b1

Please sign in to comment.