Skip to content

Commit

Permalink
Replace check_header_and_update_state with an architecture similar …
Browse files Browse the repository at this point in the history
…to ibc-go (#584)

* fix

* changelog

* verify_header

contains a FIXME to double check

* fix header.trusted_next_validator_set hash bug

* fmt

* remove bad comment

* add timestamp monotonicity checks to `verify_header()`

* clean up verify_header

* add revision number check in verify_header

* header height extra check

* clarifying comment

* check_misbehaviour_header scaffolding

* remove duplicate methods

* verify_misbehaviour done as ibc-go

* fix chain ID before commit verification

* finish verify_misbehavior

* `check_for_misbehaviour` header variant implementation

* check_for_misbehaviour, misbehaviour variant

* monotonicity of timestamps in update_client

* update_state_on_misbehaviour

* implement update_state in tendermint light client

* cleanup `map_err`s

* Rename MsgUpdateClient::client_message

* impl raw misbehaviour -> MsgUpdateClient

* change updateClientKind enum

* move misbehaviour tests to update_client

* move misbehaviour type url

* remove misbehaviour msg and handler

* update_client::validate

* implement part of update_client::execute

* separate events emitted

* finish update_client::execute

* remove TODO

* implement mock client state

* fix mockclientstate

* fix event created on update_client

* fix mock

* fix mock

* test var names

* fix parts of the problem with test

* fix test

* clippy

* remove old methods

* clean Misbehaviour::new()

* cleanup unused

* move `update_client` method to submodule

* move misbehaviour to submodule

* move implementation to function

* move implementation to function

* changelog

* add clarifying comment

* fmt

* Update crates/ibc/src/clients/ics07_tendermint/client_state/misbehaviour.rs

Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>
Signed-off-by: Philippe Laferrière <plafer@protonmail.com>

* Update crates/ibc/src/clients/ics07_tendermint/client_state/update_client.rs

Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>
Signed-off-by: Philippe Laferrière <plafer@protonmail.com>

* Update crates/ibc/src/clients/ics07_tendermint/client_state/misbehaviour.rs

Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>
Signed-off-by: Philippe Laferrière <plafer@protonmail.com>

* fix misbehaviour ctor

* improve documentation around `UpdateKind`

* fmt

* remove unused misbehaviour trait

* fix misbehaviour header checks

* Update crates/ibc/src/clients/ics07_tendermint/client_state/update_client.rs

Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>
Signed-off-by: Philippe Laferrière <plafer@protonmail.com>

* fix test after merge

---------

Signed-off-by: Philippe Laferrière <plafer@protonmail.com>
Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>
  • Loading branch information
plafer and ancazamfir authored Apr 13, 2023
1 parent 2ab8333 commit 8f31355
Show file tree
Hide file tree
Showing 28 changed files with 1,046 additions and 1,022 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- `ClientState`: Split `check_misbehaviour_and_update_state`
and `check_header_and_update_state`
([#535](https://github.com/cosmos/ibc-rs/issues/535))
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Tendermint light client: fix missing trusted_validator_set
hash check
([#583](https://github.com/cosmos/ibc-rs/issues/583))
3 changes: 3 additions & 0 deletions .changelog/unreleased/bug/585-missing-trusted-height-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Tendermint light client: fix missing `Header.height()`
vs `Header.trusted_height` check
([#585](https://github.com/cosmos/ibc-rs/issues/585))
3 changes: 3 additions & 0 deletions .changelog/unreleased/bug/589-commit-verification-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Tendermint light client: ensure that we use the correct
chain ID in commit verification
([#589](https://github.com/cosmos/ibc-rs/issues/589))
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Tendermint light client: add check that ensure that
the consensus state timestamps are monotonic, otherwise
freeze the client
([#598](https://github.com/cosmos/ibc-rs/issues/598))
3 changes: 3 additions & 0 deletions .changelog/unreleased/bug/601-client-state-latest-height.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Tendermint light client: fix how the client's latest
height is updated
([#601](https://github.com/cosmos/ibc-rs/issues/601))
Loading

0 comments on commit 8f31355

Please sign in to comment.