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

Add migration docs for 02-client refactor #1287

Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1fc561e
add changes on : ClientState, Header, Misbehaviour, ConsensState, lig…
catShaark Apr 25, 2022
0e7bd3a
Update docs/migrations/v3-to-v4.md
catShaark Apr 25, 2022
7db7f72
Update docs/migrations/v3-to-v4.md
catShaark Apr 25, 2022
250353d
Update docs/migrations/v3-to-v4.md
catShaark Apr 25, 2022
4699eb2
Update docs/migrations/v3-to-v4.md
catShaark Apr 25, 2022
5b7f447
Update docs/migrations/v3-to-v4.md
catShaark Apr 25, 2022
4de0e29
Update docs/migrations/v3-to-v4.md
catShaark Apr 25, 2022
6c9551f
add more entries and more description
catShaark Apr 26, 2022
8c77483
Update docs/migrations/v3-to-v4.md
catShaark Apr 26, 2022
060988a
Update docs/migrations/v3-to-v4.md
catShaark Apr 26, 2022
1c546b9
Update docs/migrations/v3-to-v4.md
catShaark Apr 26, 2022
2f890d2
Update docs/migrations/v3-to-v4.md
catShaark Apr 26, 2022
fefb363
Update docs/migrations/v3-to-v4.md
catShaark Apr 26, 2022
1a27799
Update docs/migrations/v3-to-v4.md
catShaark Apr 26, 2022
318a2d5
Update docs/migrations/v3-to-v4.md
catShaark Apr 26, 2022
5886fed
Update docs/migrations/v3-to-v4.md
catShaark Apr 26, 2022
ee9eb5f
Update docs/migrations/v3-to-v4.md
catShaark Apr 26, 2022
8a91ca3
Merge branch '02-client-refactor' into add-migration-docs-for-client-…
catShaark Apr 27, 2022
776890a
Merge branch '02-client-refactor' into add-migration-docs-for-client-…
catShaark Apr 27, 2022
fb92159
Merge branch '02-client-refactor' into add-migration-docs-for-client-…
catShaark Apr 29, 2022
4aad399
Update docs/migrations/v3-to-v4.md
catShaark Apr 29, 2022
f2739ea
Merge branch '02-client-refactor' into add-migration-docs-for-client-…
catShaark May 9, 2022
12f6dcb
update migration doc
catShaark May 9, 2022
c29da1e
update migration doc
catShaark May 9, 2022
9fde6ec
update migration doc
catShaark May 9, 2022
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
50 changes: 45 additions & 5 deletions docs/migrations/v3-to-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,53 @@ No genesis or in-place migrations required when upgrading from v1 or v2 of ibc-g

## Chains

### IS04 - Channel
### IS04 - Channel

The `WriteAcknowledgement` API now takes the `exported.Acknowledgement` type instead of passing in the acknowledgement byte array directly.
This is an API breaking change and as such IBC application developers will have to update any calls to `WriteAcknowledgement`.
The `WriteAcknowledgement` API now takes the `exported.Acknowledgement` type instead of passing in the acknowledgement byte array directly.
This is an API breaking change and as such IBC application developers will have to update any calls to `WriteAcknowledgement`.

## IBC Light Clients

The `VerifyUpgradeAndUpdateState` function has been modified. The client state and consensus state return value has been removed.
### `ClientState` interface changes

Light clients **must** set the updated client state and consensus state in the client store after verifying a valid client upgrade.
The `VerifyUpgradeAndUpdateState` function has been modified. The client state and consensus state return values have been removed.

Light clients **must** handle all management of client and consensus states including the setting of updated client state and consensus state in the client store.

The `CheckHeaderAndUpdateState` function has been split into 4 new functions:

- `VerifyClientMessage` verifies a `ClientMessage`. A `ClientMessage` could be a `Header`, `Misbehaviour`, or batch update. Calls to `CheckForMisbehaviour`, `UpdateState`, and `UpdateStateOnMisbehaviour` will assume that the content of the `ClientMessage` has been verified and can be trusted. An error should be returned if the `ClientMessage` fails to verify.

- `CheckForMisbehaviour` checks for evidence of a misbehaviour in `Header` or `Misbehaviour` types.

- `UpdateStateOnMisbehaviour` performs appropriate state changes on a `ClientState` given that misbehaviour has been detected and verified.

- `UpdateState` updates and stores as necessary any associated information for an IBC client, such as the `ClientState` and corresponding `ConsensusState`. An error is returned if `ClientMessage` is of type `Misbehaviour`. Upon successful update, a list containing the updated consensus state height is returned.

The `CheckMisbehaviourAndUpdateState` function has been removed from `ClientState` interface. This functionality is now encapsulated by the usage of `VerifyClientMessage`, `CheckForMisbehaviour`, `UpdateStateOnMisbehaviour`, `UpdateState`.

The function `GetTimestampAtHeight` has been added to the `ClientState` interface. It should return the timestamp for a consensus state associated with the provided height.

### `Header` and `Misbehaviour`

`exported.Header` and `exported.Misbehaviour` interface types have been merged and renamed to `ClientMessage` interface.
catShaark marked this conversation as resolved.
Show resolved Hide resolved

`GetHeight` function has been removed from `exported.Header` and thus is not included in the `ClientMessage` interface

### `ConsensusState`

The `GetRoot` function has been removed from consensus state interface since it was not used by core IBC.

### Light client implementations

09-localhost light client implementation has been removed because it is currently non-functional.

### Client Keeper

Keeper function `CheckMisbehaviourAndUpdateState` has been removed since function `UpdateClient` can now handle updating `ClientState` on `ClientMessage` type which can be any `Misbehaviour` implementations.
crodriguezvega marked this conversation as resolved.
Show resolved Hide resolved

### SDK Message

`MsgSubmitMisbehaviour` is deprecated since `MsgUpdateClient` can now submit a `ClientMessage` type which can be any `Misbehaviour` implementations.
crodriguezvega marked this conversation as resolved.
Show resolved Hide resolved

The field `header` in `MsgUpdateClient` has been renamed to `client message`.