Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: decouple client routing from encoding #5806

Merged
merged 92 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
c459971
refactor: add initial light client module interface
colin-axner Jan 29, 2024
e44bfc1
wip: add boiler plate light client module for tendermint client
colin-axner Jan 29, 2024
53a8dbe
feat: adding initial light client module impl for 06-solomachine
damiannolan Jan 29, 2024
f90c702
chore: adding LightClientModule interface assertion for 06-solomachine
damiannolan Jan 29, 2024
87e952f
chore: adding initial boiilerplate for 08-wasm mod
damiannolan Jan 30, 2024
100340a
refactor: add boilerplate tendermint light client module
colin-axner Jan 30, 2024
cc856d2
Merge branch 'feat/02-client-router' of github.com:cosmos/ibc-go into…
colin-axner Jan 30, 2024
1ec5291
refactor: add localhost boilerplate code
colin-axner Jan 30, 2024
a21fded
imp: add basic 02-client router
colin-axner Jan 30, 2024
9ee3fff
refactor: use light client module for client status
colin-axner Jan 30, 2024
95f1ff5
chore: move solomachine keeper to internal
damiannolan Jan 30, 2024
63483bf
chore: adding GetTimestampAtHeight to clientkeeper using 02-client ro…
damiannolan Jan 30, 2024
f08c004
refactor: rm GetTimestampAtHeight from 03-connection and adapt api ca…
damiannolan Jan 30, 2024
090cbbf
chore: wire up solomachine module with clientRouter in app.go
damiannolan Jan 30, 2024
8d8bb34
chore: move commented out test to client keeper - still has todo to u…
damiannolan Jan 30, 2024
2875686
chore: add solomachine client module to AppModule constructor and wir…
damiannolan Jan 30, 2024
f36001b
fix: use correct route for client status lookup
colin-axner Jan 30, 2024
3cf291f
Merge branch 'feat/02-client-router' of github.com:cosmos/ibc-go into…
colin-axner Jan 30, 2024
a7f995d
chore: add clientRouter to 08-wasm simapp and wire up
damiannolan Jan 30, 2024
46ebec2
fix: solo machine unmarshal bug and 02-client keeper tests
colin-axner Jan 30, 2024
542dd95
Merge branch 'feat/02-client-router' of github.com:cosmos/ibc-go into…
colin-axner Jan 30, 2024
896f225
test: fix GetTimestampAtHeight test in clientkeeper
damiannolan Jan 30, 2024
145c834
Merge branch 'feat/02-client-router' of github.com:cosmos/ibc-go into…
colin-axner Jan 30, 2024
55ffa19
refactor(solomachine): add getClientState helper and unmarhsal interface
damiannolan Jan 30, 2024
3e9a40c
refactor: align 08-wasm, add GetClientState helper and unmarshal inte…
damiannolan Jan 30, 2024
61311e8
fix(temp): temporarily add WithStoreKey opt to wasmkeeper to fix fail…
damiannolan Jan 30, 2024
daf3b47
fix: wire up callbacks simapp to fix failing tests
damiannolan Jan 30, 2024
a4cc0bc
refactor: modify UpdateClient handler to use light client module api
damiannolan Jan 30, 2024
8efa5be
Merge branch 'main' of github.com:cosmos/ibc-go into feat/02-client-r…
colin-axner Jan 31, 2024
3020f38
feat: add ClientStoreProvider interface for isolated prefix stores (#…
damiannolan Jan 31, 2024
92747c8
refactor: rm internal/keeper from solomachine
damiannolan Jan 31, 2024
379e0d3
refactor: begin removing stale client state interfaces
colin-axner Jan 31, 2024
b639a87
Merge branch 'feat/02-client-router' of github.com:cosmos/ibc-go into…
colin-axner Jan 31, 2024
3099d33
feat: wire up localhost
colin-axner Jan 31, 2024
2ca1ddf
fix: tests in 06-solomachine and 07-tendermint
colin-axner Jan 31, 2024
029f5ef
fix: rest of tests
colin-axner Jan 31, 2024
23b5cbb
refactor: use light client module APIs in 03-connection state verify
damiannolan Jan 31, 2024
2a2133b
chore: adapt remaining handlers to use light client module api in 03-…
damiannolan Jan 31, 2024
f60c4be
fix: locahost verify membership and non membership in light client mo…
colin-axner Jan 31, 2024
5ccc21b
Merge branch 'feat/02-client-router' of github.com:cosmos/ibc-go into…
colin-axner Jan 31, 2024
47521d7
refactor: remove VerifyMembership and VerifyNonMembership from client…
colin-axner Jan 31, 2024
11e40d0
Merge branch 'main' of github.com:cosmos/ibc-go into feat/02-client-r…
colin-axner Jan 31, 2024
91084ba
fix: rm getters for clientID from connection (conflict)
damiannolan Feb 1, 2024
acdec44
Merge branch 'main' into feat/02-client-router
crodriguezvega Feb 7, 2024
f08a0e6
02-client routing: fix linter warnings (#5818)
crodriguezvega Feb 8, 2024
daedbf6
02-client routing: pass client ID to get route instead of client type…
crodriguezvega Feb 8, 2024
2f9186c
use localhost client ID
crodriguezvega Feb 8, 2024
61937ea
02-client routing: function in store provider to return client store …
crodriguezvega Feb 15, 2024
b715710
02-client routing: implement `RecoverClient` in light client modules …
crodriguezvega Feb 15, 2024
f4ee20b
Merge branch 'main' into feat/02-client-router
crodriguezvega Feb 18, 2024
1225ce0
fixes from merge of main
crodriguezvega Feb 18, 2024
f9eaf91
02-client routing: remove client ID validation (#5897)
crodriguezvega Feb 27, 2024
87c6a65
Merge branch 'main' into feat/02-client-router
damiannolan Mar 4, 2024
6b55091
Merge branch 'main' into feat/02-client-router
damiannolan Mar 5, 2024
650d785
Merge branch 'main' into feat/02-client-router
crodriguezvega Mar 6, 2024
68bb9f2
docs: add removal of `ClientState` interface functions to migration d…
crodriguezvega Mar 7, 2024
501a846
02-client routing: remove `GetLatestHeight` from `ClientState` interf…
crodriguezvega Mar 11, 2024
ccf2adf
docs: refactor light client developer guide
colin-axner Mar 11, 2024
63ec69c
imp: cleanup godoc on router type
colin-axner Mar 11, 2024
b6d07a5
02-client routing: implement `VerifyUpgradeAndUpdateState` in light c…
crodriguezvega Mar 12, 2024
e143ecb
Merge branch 'main' into feat/02-client-router
damiannolan Mar 12, 2024
93f84b0
nit: lcm -> l for all light client modules
colin-axner Mar 12, 2024
e3348f3
remove unnecessary comment
colin-axner Mar 12, 2024
39601e3
chore: remove unnecessary todo's
colin-axner Mar 12, 2024
0921bf6
chore: lint fix docs
colin-axner Mar 12, 2024
89112a1
Apply suggestions from code review
colin-axner Mar 12, 2024
4f9b535
chore: 02-client handler godoc
colin-axner Mar 12, 2024
ea3fff4
Merge branch 'feat/02-client-router' of github.com:cosmos/ibc-go into…
colin-axner Mar 12, 2024
8c5f67c
Update modules/core/02-client/keeper/client.go
colin-axner Mar 12, 2024
fa51d0d
Update modules/light-clients/06-solomachine/light_client_module_test.go
colin-axner Mar 12, 2024
bddbb07
remove commented out code in msg server
colin-axner Mar 13, 2024
184a271
chore: update godoc, remove todo's
colin-axner Mar 13, 2024
708e452
chore: remove unnecessary func from localhost + cleanup
colin-axner Mar 13, 2024
9bad009
Apply suggestions from code review
colin-axner Mar 13, 2024
cbfaea7
Update docs/docs/03-light-clients/01-developer-guide/01-overview.md
colin-axner Mar 13, 2024
5de2ebc
chore: remove todo + deprecation notice
colin-axner Mar 13, 2024
02d40b2
Merge branch 'feat/02-client-router' of github.com:cosmos/ibc-go into…
colin-axner Mar 13, 2024
7674954
chore: fix broken link
colin-axner Mar 13, 2024
a830c11
chore: godoc for exported client.go file
colin-axner Mar 13, 2024
3b3ff19
chore: test update
colin-axner Mar 13, 2024
cfb8607
chore: godoc
colin-axner Mar 13, 2024
a43b1b3
chore: update godoc in 06-solomachine light client module
colin-axner Mar 13, 2024
3128ab8
chore: update 07-tendermint light client module godoc
colin-axner Mar 13, 2024
5ed427a
chore: update localhost client module godocs
colin-axner Mar 13, 2024
0d821c5
chore: update 08-wasm light client module godoc
colin-axner Mar 13, 2024
ba429b9
fix: broken link
colin-axner Mar 13, 2024
0329451
fix(e2e): correctly assign trusted height and latest height vars to b…
damiannolan Mar 13, 2024
16e141b
address my self-review comments and some of rabbit's comments
crodriguezvega Mar 14, 2024
4cd3a59
Merge branch 'main' into feat/02-client-router
crodriguezvega Mar 14, 2024
c1c70ae
Update e2e/tests/transfer/localhost_test.go
damiannolan Mar 14, 2024
696f852
chore: godocs, rm ClientStore from expected keeper, rename events arg…
damiannolan Mar 14, 2024
86f3679
Merge branch 'main' into feat/02-client-router
damiannolan Mar 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs/01-ibc/05-upgrades/02-developer-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ slug: /ibc/upgrades/developer-guide
Learn how to implement upgrade functionality for your custom IBC client.
:::

Please see the section [Handling upgrades](../../03-light-clients/01-developer-guide/05-upgrades.md) from the light client developer guide for more information.
Please see the section [Handling upgrades](../../03-light-clients/01-developer-guide/06-upgrades.md) from the light client developer guide for more information.
21 changes: 18 additions & 3 deletions docs/docs/03-light-clients/01-developer-guide/01-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

A light client module developer should be concerned with three main interfaces:

- [`LightClientModule`](#lightclientmodule) a module which manages many light client instances of a certain type.
- [`ClientState`](#clientstate) encapsulates the light client implementation and its semantics.
- [`ConsensusState`](#consensusstate) tracks consensus data used for verification of client updates, misbehaviour detection and proof verification of counterparty state.
- [`ClientMessage`](#clientmessage) used for submitting block headers for client updates and submission of misbehaviour evidence using conflicting headers.
damiannolan marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -35,6 +36,20 @@

## Concepts and vocabulary

### `LightClientModule`

`LightClientModule` is an interface defined by core IBC which allows for modular light client implementations. All light client implementations *must* implement the [`LightClientModule` interface](https://github.com/cosmos/ibc-go/blob/501a8462345da099144efe91d495bfcfa18d760d/modules/core/exported/client.go#L51) so that core IBC may redirect calls to the light client module.

For example a light client module may need to:
damiannolan marked this conversation as resolved.
Show resolved Hide resolved
- create clients

Check failure on line 44 in docs/docs/03-light-clients/01-developer-guide/01-overview.md

View workflow job for this annotation

GitHub Actions / lint

Lists should be surrounded by blank lines

docs/docs/03-light-clients/01-developer-guide/01-overview.md:44 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "- create clients"] https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md032.md
- update clients
- recover and upgrade clients
- verify membership and non-membership

The methods which make up this interface are detailed at a more granular level in the [LightClientModule section of this guide](02-light-client-module.md).

Please refer to the `07-tendermint`'s[`LightClientModule` definition](https://github.com/cosmos/ibc-go/blob/501a8462345da099144efe91d495bfcfa18d760d/modules/light-clients/07-tendermint/light_client_module.go#L17) for more information.
colin-axner marked this conversation as resolved.
Show resolved Hide resolved

### `ClientState`

`ClientState` is a term used to define the data structure which encapsulates opaque light client state. The `ClientState` contains all the information needed to verify a `ClientMessage` and perform membership and non-membership proof verification of counterparty state. This includes properties that refer to the remote state machine, the light client type and the specific light client instance.
Expand All @@ -47,7 +62,7 @@
- Constraints used for client upgrades.

The `ClientState` type maintained within the light client module *must* implement the [`ClientState`](https://github.com/cosmos/ibc-go/tree/02-client-refactor-beta1/modules/core/exported/client.go#L36) interface defined in `core/modules/exported/client.go`.
The methods which make up this interface are detailed at a more granular level in the [ClientState section of this guide](02-client-state.md).
The methods which make up this interface are detailed at a more granular level in the [ClientState section of this guide](03-client-state.md).

Please refer to the `07-tendermint` light client module's [`ClientState` definition](https://github.com/cosmos/ibc-go/tree/02-client-refactor-beta1/proto/ibc/lightclients/tendermint/v1/tendermint.proto#L18) containing information such as chain ID, status, latest height, unbonding period and proof specifications.

Expand All @@ -58,7 +73,7 @@
For example, the `ConsensusState` of the `07-tendermint` light client module defines a trusted root which is used by the `ClientState` to perform verification of membership and non-membership commitment proofs, as well as the next validator set hash used for verifying headers can be trusted in client updates.

The `ConsensusState` type maintained within the light client module *must* implement the [`ConsensusState`](https://github.com/cosmos/ibc-go/tree/02-client-refactor-beta1/modules/core/exported/client.go#L134) interface defined in `modules/core/exported/client.go`.
The methods which make up this interface are detailed at a more granular level in the [`ConsensusState` section of this guide](03-consensus-state.md).
The methods which make up this interface are detailed at a more granular level in the [`ConsensusState` section of this guide](04-consensus-state.md).

### `Height`

Expand All @@ -76,4 +91,4 @@
- A batch of block headers which when verified inserts `N` `ConsensusState` instances for `N` unique heights.
- Evidence of misbehaviour provided by two conflicting block headers.

Learn more in the [Handling update and misbehaviour](04-updates-and-misbehaviour.md) section.
Learn more in the [Handling update and misbehaviour](05-updates-and-misbehaviour.md) section.
Original file line number Diff line number Diff line change
@@ -1,28 +1,12 @@
---
title: Client State interface
sidebar_label: Client State interface
title: Light Client Module interface
sidebar_label: Light Client Module interface
sidebar_position: 2
slug: /ibc/light-clients/client-state
slug: /ibc/light-clients/light-client-module
---


# Implementing the `ClientState` interface

Learn how to implement the [`ClientState`](https://github.com/cosmos/ibc-go/blob/v7.0.0/modules/core/exported/client.go#L36) interface. This list of methods described here does not include all methods of the interface. Some methods are explained in detail in the relevant sections of the guide.

## `ClientType` method

`ClientType` should return a unique string identifier of the light client. This will be used when generating a client identifier.
The format is created as follows: `ClientType-{N}` where `{N}` is the unique global nonce associated with a specific client.

## `GetLatestHeight` method

`GetLatestHeight` should return the latest block height that the client state represents.

## `Validate` method

`Validate` should validate every client state field and should return an error if any value is invalid. The light client
implementer is in charge of determining which checks are required. See the [Tendermint light client implementation](https://github.com/cosmos/ibc-go/blob/v7.0.0/modules/light-clients/07-tendermint/client_state.go#L111) as a reference.
# Implementing the `LightClientModule` interface

## `Status` method

Expand All @@ -37,9 +21,9 @@ All possible `Status` types can be found [here](https://github.com/cosmos/ibc-go

This field is returned in the response of the gRPC [`ibc.core.client.v1.Query/ClientStatus`](https://github.com/cosmos/ibc-go/blob/v7.0.0/modules/core/02-client/types/query.pb.go#L665) endpoint.

## `GetTimestampAtHeight` method
## `TimestampAtHeight` method

`GetTimestampAtHeight` must return the timestamp for the consensus state associated with the provided height.
`TimestampAtHeight` must return the timestamp for the consensus state associated with the provided height.
This value is used to facilitate timeouts by checking the packet timeout timestamp against the returned value.

## `Initialize` method
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Client State interface
sidebar_label: Client State interface
sidebar_position: 3
slug: /ibc/light-clients/client-state
---


# Implementing the `ClientState` interface

Learn how to implement the [`ClientState`](https://github.com/cosmos/ibc-go/blob/v7.0.0/modules/core/exported/client.go#L36) interface. This list of methods described here does not include all methods of the interface. Some methods are explained in detail in the relevant sections of the guide.

## `ClientType` method

`ClientType` should return a unique string identifier of the light client. This will be used when generating a client identifier.
The format is created as follows: `ClientType-{N}` where `{N}` is the unique global nonce associated with a specific client.

## `Validate` method

`Validate` should validate every client state field and should return an error if any value is invalid. The light client
implementer is in charge of determining which checks are required. See the [Tendermint light client implementation](https://github.com/cosmos/ibc-go/blob/v7.0.0/modules/light-clients/07-tendermint/client_state.go#L111) as a reference.


Check failure on line 23 in docs/docs/03-light-clients/01-developer-guide/03-client-state.md

View workflow job for this annotation

GitHub Actions / lint

Multiple consecutive blank lines

docs/docs/03-light-clients/01-developer-guide/03-client-state.md:23 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2] https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md012.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Consensus State interface
sidebar_label: Consensus State interface
sidebar_position: 3
sidebar_position: 4
slug: /ibc/light-clients/consensus-state
---

Expand All @@ -16,7 +16,7 @@ The below [`ConsensusState`](https://github.com/cosmos/ibc-go/blob/v7.0.0/module

## `ClientType` method

This is the type of client consensus. It should be the same as the `ClientType` return value for the [corresponding `ClientState` implementation](02-client-state.md).
This is the type of client consensus. It should be the same as the `ClientType` return value for the [corresponding `ClientState` implementation](03-client-state.md).

## `GetTimestamp` method

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
title: Handling Updates and Misbehaviour
sidebar_label: Handling Updates and Misbehaviour
sidebar_position: 4
sidebar_position: 5
slug: /ibc/light-clients/updates-and-misbehaviour
---


# Handling `ClientMessage`s: updates and misbehaviour

As mentioned before in the documentation about [implementing the `ConsensusState` interface](03-consensus-state.md), [`ClientMessage`](https://github.com/cosmos/ibc-go/blob/v7.0.0/modules/core/exported/client.go#L147) is an interface used to update an IBC client. This update may be performed by:
As mentioned before in the documentation about [implementing the `ConsensusState` interface](04-consensus-state.md), [`ClientMessage`](https://github.com/cosmos/ibc-go/blob/v7.0.0/modules/core/exported/client.go#L147) is an interface used to update an IBC client. This update may be performed by:

- a single header
- a batch of headers
Expand All @@ -30,7 +30,7 @@ type ClientMessage interface {
}
```

The `ClientMessage` will be passed to the client to be used in [`UpdateClient`](https://github.com/cosmos/ibc-go/blob/v7.0.0/modules/core/02-client/keeper/client.go#L48), which retrieves the `ClientState` by client ID (available in `MsgUpdateClient`). This `ClientState` implements the [`ClientState` interface](02-client-state.md) for its specific consenus type (e.g. Tendermint).
The `ClientMessage` will be passed to the client to be used in [`UpdateClient`](https://github.com/cosmos/ibc-go/blob/v7.0.0/modules/core/02-client/keeper/client.go#L48), which retrieves the `ClientState` by client ID (available in `MsgUpdateClient`). This `ClientState` implements the [`ClientState` interface](03-client-state.md) for its specific consenus type (e.g. Tendermint).

`UpdateClient` will then handle a number of cases including misbehaviour and/or updating the consensus state, utilizing the specific methods defined in the relevant `ClientState`.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Handling Upgrades
sidebar_label: Handling Upgrades
sidebar_position: 5
sidebar_position: 6
slug: /ibc/light-clients/upgrades
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Existence/Non-Existence Proofs
sidebar_label: Existence/Non-Existence Proofs
sidebar_position: 6
sidebar_position: 7
slug: /ibc/light-clients/proofs
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Handling Proposals
sidebar_label: Handling Proposals
sidebar_position: 7
sidebar_position: 8
slug: /ibc/light-clients/proposals
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Setup
sidebar_label: Setup
sidebar_position: 8
sidebar_position: 9
slug: /ibc/light-clients/setup
---

charleenfei marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/03-light-clients/04-wasm/03-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ func CreateWasmUpgradeHandler(
}
```

Or alternatively the parameter can be updated via a governance proposal (see at the bottom of section [`Creating clients`](../01-developer-guide/08-setup.md#creating-clients) for an example of how to do this).
Or alternatively the parameter can be updated via a governance proposal (see at the bottom of section [`Creating clients`](../01-developer-guide/09-setup.md#creating-clients) for an example of how to do this).

## Adding the module to the store

charleenfei marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
20 changes: 10 additions & 10 deletions docs/docs/03-light-clients/04-wasm/07-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ pub enum QueryMsg {

To learn what it is expected from the Wasm light client contract when processing each message, please read the corresponding section of the [Light client developer guide](../01-developer-guide/01-overview.md):

- For `StatusMsg`, see the section [`Status` method](../01-developer-guide/02-client-state.md#status-method).
- For `TimestampAtHeightMsg`, see the section [`GetTimestampAtHeight` method](../01-developer-guide/02-client-state.md#gettimestampatheight-method).
- For `VerifyClientMessageMsg`, see the section [`VerifyClientMessage`](../01-developer-guide/04-updates-and-misbehaviour.md#verifyclientmessage).
- For `CheckForMisbehaviourMsg`, see the section [`CheckForMisbehaviour` method](../01-developer-guide/02-client-state.md#checkformisbehaviour-method).
- For `StatusMsg`, see the section [`Status` method](../01-developer-guide/03-client-state.md#status-method).
- For `TimestampAtHeightMsg`, see the section [`GetTimestampAtHeight` method](../01-developer-guide/03-client-state.md#gettimestampatheight-method).
- For `VerifyClientMessageMsg`, see the section [`VerifyClientMessage`](../01-developer-guide/05-updates-and-misbehaviour.md#verifyclientmessage).
- For `CheckForMisbehaviourMsg`, see the section [`CheckForMisbehaviour` method](../01-developer-guide/03-client-state.md#checkformisbehaviour-method).

## `SudoMsg`

Expand Down Expand Up @@ -88,12 +88,12 @@ pub enum SudoMsg {

To learn what it is expected from the Wasm light client contract when processing each message, please read the corresponding section of the [Light client developer guide](../01-developer-guide/01-overview.md):

- For `UpdateStateMsg`, see the section [`UpdateState`](../01-developer-guide/04-updates-and-misbehaviour.md#updatestate).
- For `UpdateStateOnMisbehaviourMsg`, see the section [`UpdateStateOnMisbehaviour`](../01-developer-guide/04-updates-and-misbehaviour.md#updatestateonmisbehaviour).
- For `VerifyUpgradeAndUpdateStateMsg`, see the section [`GetTimestampAtHeight` method](../01-developer-guide/05-upgrades.md#implementing-verifyupgradeandupdatestate).
- For `VerifyMembershipMsg`, see the section [`VerifyMembership` method](../01-developer-guide/02-client-state.md#verifymembership-method).
- For `VerifyNonMembershipMsg`, see the section [`VerifyNonMembership` method](../01-developer-guide/02-client-state.md#verifynonmembership-method).
- For `MigrateClientStoreMsg`, see the section [Implementing `CheckSubstituteAndUpdateState`](../01-developer-guide/07-proposals.md#implementing-checksubstituteandupdatestate).
- For `UpdateStateMsg`, see the section [`UpdateState`](../01-developer-guide/05-updates-and-misbehaviour.md#updatestate).
- For `UpdateStateOnMisbehaviourMsg`, see the section [`UpdateStateOnMisbehaviour`](../01-developer-guide/05-updates-and-misbehaviour.md#updatestateonmisbehaviour).
- For `VerifyUpgradeAndUpdateStateMsg`, see the section [`GetTimestampAtHeight` method](../01-developer-guide/06-upgrades.md#implementing-verifyupgradeandupdatestate).
- For `VerifyMembershipMsg`, see the section [`VerifyMembership` method](../01-developer-guide/03-client-state.md#verifymembership-method).
- For `VerifyNonMembershipMsg`, see the section [`VerifyNonMembership` method](../01-developer-guide/03-client-state.md#verifynonmembership-method).
- For `MigrateClientStoreMsg`, see the section [Implementing `CheckSubstituteAndUpdateState`](../01-developer-guide/08-proposals.md#implementing-checksubstituteandupdatestate).

### Migration

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/05-migrations/02-sdk-to-v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ app.IBCKeeper = ibckeeper.NewKeeper(

### UpdateClientProposal

The `UpdateClient` has been modified to take in two client-identifiers and one initial height. Please see the [documentation](../01-ibc/07-proposals.md) for more information.
The `UpdateClient` has been modified to take in two client-identifiers and one initial height. Please see the [documentation](../01-ibc/08-proposals.md) for more information.

### UpgradeProposal

Expand Down
23 changes: 23 additions & 0 deletions docs/docs/05-migrations/13-v8-to-v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,29 @@

The `ExportMetadata` interface function has been removed from the `ClientState` interface. Core IBC will export all key/value's within the 02-client store.

The `ZeroCustomFields` interface function has been removed from the `ClientState` interface.

The following functions have also been removed from the `ClientState` interface: `Initialize`, `Status`, `GetLatestHeight`, `GetTimestampAtHeight`, `VerifyClientMessage`, `VerifyMembership`, `VerifyNonMembership`, `CheckForMisbehaviour`, `UpdateState`, `UpdateStateOnMisbehaviour`, `CheckSubstituteAndUpdateState` and `VerifyUpgradeAndUpdateState`. ibc-go v9 decouples routing at the `02-client` layer from the light clients' encoding structure (i.e. every light client implementation of the `ClientState` interface is not used anymore to route the requests to the right light client at the `02-client` layer, instead a _light client module_ is registered for every light client type and `02-client` routes the requests to the right light client module based on the client ID). Light client developers must implement the newly introduced `LightClientModule` interface and are encouraged to move the logic implemented in the functions of their light client's implementation of the `ClientState` interface to the equivalent function in the `LightClientModule` interface. The table below shows the equivalence between the `ClientState` interface functions that have been removed and the functions in the `LightClientModule` interface:

Check failure on line 60 in docs/docs/05-migrations/13-v8-to-v9.md

View workflow job for this annotation

GitHub Actions / lint

Emphasis style

docs/docs/05-migrations/13-v8-to-v9.md:60:622 MD049/emphasis-style Emphasis style [Expected: asterisk; Actual: underscore] https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md049.md

Check failure on line 60 in docs/docs/05-migrations/13-v8-to-v9.md

View workflow job for this annotation

GitHub Actions / lint

Emphasis style

docs/docs/05-migrations/13-v8-to-v9.md:60:642 MD049/emphasis-style Emphasis style [Expected: asterisk; Actual: underscore] https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md049.md

|`ClientState` interface|`LightClientModule` interface|
|-----------------------|-----------------------------|
|`Initialize` |`Initialize` |
|`Status` |`Status` |
|`GetLatestHeight` |`LatestHeight` |
|`GetTimestampAtHeight` |`TimestampAtHeight` |
|`VerifyClientMessage` |`VerifyClientMessage` |
|`VerifyMembership` |`VerifyMembership` |
|`VerifyNonMembership` |`VerifyNonMembership` |
|`CheckForMisbehaviour` |`CheckForMisbehaviour` |
|`UpdateState` |`UpdateState` |
|`UpdateStateOnMisbehaviour` |`UpdateStateOnMisbehaviour` |
|`CheckSubstituteAndUpdateState`|`RecoverClient` |
|`VerifyUpgradeAndUpdateState` |`VerifyUpgradeAndUpdateState`|
|`ExportMetadata` | |
|`ZeroCustomFields` | |

Please check also the [light client developer guide](../03-light-clients/01-developer-guide/01-overview.md) for more information. The light client module implementation for `07-tendermint` may also be useful as reference.
damiannolan marked this conversation as resolved.
Show resolved Hide resolved

### 07-tendermint

The `IterateConsensusMetadata` function has been removed.
Expand Down
8 changes: 4 additions & 4 deletions e2e/tests/core/02-client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ func (s *ClientTestSuite) TestClient_Update_Misbehaviour() {
tmClientState, ok := clientState.(*ibctm.ClientState)
s.Require().True(ok)

trustedHeight, ok = tmClientState.GetLatestHeight().(clienttypes.Height)
s.Require().True(ok)
trustedHeight := tmClientState.LatestHeight
s.Require().True(trustedHeight.GT(clienttypes.ZeroHeight()))
})

t.Run("update clients", func(t *testing.T) {
Expand All @@ -377,8 +377,8 @@ func (s *ClientTestSuite) TestClient_Update_Misbehaviour() {
tmClientState, ok := clientState.(*ibctm.ClientState)
s.Require().True(ok)

latestHeight, ok = tmClientState.GetLatestHeight().(clienttypes.Height)
s.Require().True(ok)
latestHeight := tmClientState.LatestHeight
s.Require().True(latestHeight.GT(clienttypes.ZeroHeight()))
})

t.Run("create validator set", func(t *testing.T) {
Expand Down
Loading
Loading