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

Split out ibc-clients crate #971

Merged
merged 33 commits into from
Nov 21, 2023

Conversation

seanchen1991
Copy link
Contributor

Part of: #965

Description


PR author checklist:

  • Added changelog entry, using unclog.
  • Added tests.
  • Linked to GitHub issue.
  • Updated code comments and documentation (e.g., docs/).
  • Tagged one reviewer who will be the one responsible for shepherding this PR.

Reviewer checklist:

  • Reviewed Files changed in the GitHub PR explorer.
  • Manually tested (in case integration/unit/mock tests are absent).

@seanchen1991
Copy link
Contributor Author

seanchen1991 commented Nov 19, 2023

@Farhad-Shabani Two things before this PR is fully ready for review and merging:

  1. The ibc_core::extra::tendermint::validate_self_client module complains about not being to find the latest_height method on the ClientState type (imported from ibc_client_tendermint_types::client_state::ClientState). This is because the latest_height method is implemented for ClientState as part of the ClientStateCommon trait: this trait implementation exists in the handlers part of the ics07-tendermint crate, not the ics07-tendermint/types sub-crate. How should we go about resolving this? Should the ClientStateCommon trait implementation be moved to the types sub-crate? We could also opt to move the latest_height function out of the ClientStateCommon trait and have it exist standalone in the types sub-crate. What's the preferred way to address this?
  2. The ibc-testkit crate's import paths still need to be updated.

@Farhad-Shabani
Copy link
Member

Two things before this PR is fully ready for review and merging

Big thanks @seanchen1991 for taking care of the clients migration! 🙌
I made a few more tweaks to the ibc-core PR. Some code shuffled around, and I ditched ibc-core-extra crate, moving its codebase to the other right crates. I've updated your PR as well to sync up with these changes and also tackled issues you pointed out earlier.

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

Attention: 197 lines in your changes are missing coverage. Please review.

Comparison is base (60fd38d) 69.88% compared to head (c84fad8) 70.25%.

Files Patch % Lines
...s/ibc-clients/ics07-tendermint/src/client_state.rs 59.53% 155 Missing ⚠️
.../ics24-host/tendermint/src/validate_self_client.rs 0.00% 19 Missing ⚠️
...ents/ics07-tendermint/types/src/consensus_state.rs 47.05% 9 Missing ⚠️
...bc-testkit/src/utils/dummies/clients/tendermint.rs 53.33% 7 Missing ⚠️
...ics07-tendermint/src/client_state/update_client.rs 77.77% 4 Missing ⚠️
.../ics07-tendermint/src/client_state/misbehaviour.rs 75.00% 2 Missing ⚠️
crates/ibc-testkit/src/testapp/ibc/clients/mod.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@                     Coverage Diff                     @@
##           farhad/migrate-ibc-core     #971      +/-   ##
===========================================================
+ Coverage                    69.88%   70.25%   +0.37%     
===========================================================
  Files                          175      175              
  Lines                        17362    17698     +336     
===========================================================
+ Hits                         12133    12434     +301     
- Misses                        5229     5264      +35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Farhad-Shabani Farhad-Shabani marked this pull request as ready for review November 20, 2023 07:11
@Farhad-Shabani
Copy link
Member

fyi: to avoid confusion arising from the varied use of ClientState in different types and implementations, I've updated the naming around. The newly defined newtype ClientState is now named ClientStateWrapper, while the original Tendermint ClientState struct has been preserved as TmClientState wherever it is imported. The term ClientState still refers to the trait, ensuring consistency in naming with the ConsensusState as well. Hope it works.

@Farhad-Shabani Farhad-Shabani merged commit 49a5ffa into farhad/migrate-ibc-core Nov 21, 2023
14 checks passed
@Farhad-Shabani Farhad-Shabani deleted the sean/migrate-tendermint-client branch November 21, 2023 02:43
@Farhad-Shabani
Copy link
Member

Merged this PR to have a smoother review of changes within a consolidated branch.

Farhad-Shabani added a commit that referenced this pull request Nov 21, 2023
…` crates (#969)

* feat: migrate `core` module under the `ibc` crate into `ibc-core`

feat: migrate `core` module under the `ibc` crate into `ibc-core`

feat: migrate `applications` module under the `ibc` crate into `ibc-apps` (#967)

* feat: restructure and split off applications codebase into ibc-apps dir

* imp: rename transfer dir to ics20_transfer

* feat: add ibc-apps crate

* fix: remove redundant dep + fix cargo doc

* docs: add README and descriptions

* docs: update main README page

* nit: docstrings

* nit: docstrings

* imp: rename folder to ics20-transfer

* chore: move serializers into ics20-transfer/types

* fix: apply reviewer comments

* imp: add docstring for cosmos_adr028_escrow_address

* fix: add missing features + use workspace deps for ibc crates

* imp: place re-exports under mod

* nit: apply suggestions from code review

Co-authored-by: Sean Chen <seanchen11235@gmail.com>
Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>

* fix: cargo fmt

---------

Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>
Co-authored-by: Sean Chen <seanchen11235@gmail.com>

feat: restructure and split off applications codebase into ibc-apps dir

refactor: nits from nightly clippy (#962)

* use enum tuple variants directly

* use first() over get(0)

* use infallible conversion

* rm redundant export

* cargo fmt

ci: spell check on GitHub workflows (#964)

* typos github action

* cutom config for typos

* fix spelling to counterparty

* fix spelling to transfer

imp: rename transfer dir to ics20_transfer

feat: add ibc-apps crate

fix: remove redundant dep + fix cargo doc

docs: add README and descriptions

docs: update main README page

nit: docstrings

nit: docstrings

imp: rename folder to ics20-transfer

chore: move serializers into ics20-transfer/types

fix: apply reviewer comments

imp: add docstring for cosmos_adr028_escrow_address

fix: add missing features + use workspace deps for ibc crates

imp: place re-exports under mod

feat: ibc core codebase overhaul (part-1)

feat: ibc core codebase overhaul (part-2)

chore: comment out ibc-query & ibc-testkit

fix: add missing features

nit

* fix: re-export ibc_apps in the ibc crate

* chore: adjust features + add description for crates

* fix: CI catches

* fix: no_std

* imp: define ics25-handler + move tendermint-specific impls into ibc-core-host-tendermint

* fix: cargo doc

* docs: add and edit READMEs

* fix: cargo hack catches

* fix: cargo udeps catches

* chore: ajdust README tables

* docs: further README adjustments

* fix: typo

* chore: another review of comments & READMEs

* imp: move Any and Protobuf to ibc-primitives

* fix: missing std features

* Split out ibc-clients crate (#971)

* Migrate crates/ibc-clients

* Fix dependencies in types directory

* Fix dependencies in ibc-clients crate

* Delete ibc/ics07_tendermint directory

* Resolve dependencies in ibc crate

* Resolve dependencies in ibc-clients crate

* Wrap ClientState type in a newtype wrapper

* Address all compilation errors

* Migrate crates/ibc-clients

* Fix dependencies in types directory

* Fix dependencies in ibc-clients crate

* Delete ibc/ics07_tendermint directory

* Resolve dependencies in ibc crate

* Resolve dependencies in ibc-clients crate

* Wrap ClientState type in a newtype wrapper

* Address all compilation errors

* Add default feature `std` for ibc-clients crate

* Change cfg derivation

* Fixing import paths

* Fix import paths for ibc-client-tendermint crate

* Fix merge conflicts

* Fix merge conflicts

* Fix merge conflicts

* Fix remaining compilation errors in ics07-tendermint crate

* chore: adjust import paths, features and READMEs

* fix: CI catches

* fix: add serde dep for ibc-client-tendermint

* fix: serde_tests

* imp: rename ClientState to ClientStateWrapper

---------

Co-authored-by: Farhad Shabani <farhad.shabani@gmail.com>

* docs: improve crates descriptions

* fix: apply reviewer comments

* Delete some unused modules and add some documentation

* Add TODO to use u64::dev_ceil

* Formatting of ibc-primitives README

* fix: ibc-primitives serde feature

---------

Co-authored-by: Sean Chen <seanchen11235@gmail.com>
Farhad-Shabani added a commit that referenced this pull request Nov 22, 2023
* feat: migrate `applications` module under the `ibc` crate into `ibc-apps` (#967)

* feat: restructure and split off applications codebase into ibc-apps dir

* imp: rename transfer dir to ics20_transfer

* feat: add ibc-apps crate

* fix: remove redundant dep + fix cargo doc

* docs: add README and descriptions

* docs: update main README page

* nit: docstrings

* nit: docstrings

* imp: rename folder to ics20-transfer

* chore: move serializers into ics20-transfer/types

* fix: apply reviewer comments

* imp: add docstring for cosmos_adr028_escrow_address

* fix: add missing features + use workspace deps for ibc crates

* imp: place re-exports under mod

* nit: apply suggestions from code review

Co-authored-by: Sean Chen <seanchen11235@gmail.com>
Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>

* fix: cargo fmt

---------

Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>
Co-authored-by: Sean Chen <seanchen11235@gmail.com>

* docs: ADR-008 to restructure the `ibc` crate (#966)

* docs: write ADR for ibc crate restructure

* fix: mistaken adr007 file naming

* chore: markdown adjustment

* fix: apply suggestions from code review

Co-authored-by: Sean Chen <seanchen11235@gmail.com>
Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>

* docs: explanation for *-types interaction with ibc-proto

---------

Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>
Co-authored-by: Sean Chen <seanchen11235@gmail.com>

* feat: migrate `core`, `clients` modules into `ibc-core`, `ibc-clients` crates (#969)

* feat: migrate `core` module under the `ibc` crate into `ibc-core`

feat: migrate `core` module under the `ibc` crate into `ibc-core`

feat: migrate `applications` module under the `ibc` crate into `ibc-apps` (#967)

* feat: restructure and split off applications codebase into ibc-apps dir

* imp: rename transfer dir to ics20_transfer

* feat: add ibc-apps crate

* fix: remove redundant dep + fix cargo doc

* docs: add README and descriptions

* docs: update main README page

* nit: docstrings

* nit: docstrings

* imp: rename folder to ics20-transfer

* chore: move serializers into ics20-transfer/types

* fix: apply reviewer comments

* imp: add docstring for cosmos_adr028_escrow_address

* fix: add missing features + use workspace deps for ibc crates

* imp: place re-exports under mod

* nit: apply suggestions from code review

Co-authored-by: Sean Chen <seanchen11235@gmail.com>
Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>

* fix: cargo fmt

---------

Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>
Co-authored-by: Sean Chen <seanchen11235@gmail.com>

feat: restructure and split off applications codebase into ibc-apps dir

refactor: nits from nightly clippy (#962)

* use enum tuple variants directly

* use first() over get(0)

* use infallible conversion

* rm redundant export

* cargo fmt

ci: spell check on GitHub workflows (#964)

* typos github action

* cutom config for typos

* fix spelling to counterparty

* fix spelling to transfer

imp: rename transfer dir to ics20_transfer

feat: add ibc-apps crate

fix: remove redundant dep + fix cargo doc

docs: add README and descriptions

docs: update main README page

nit: docstrings

nit: docstrings

imp: rename folder to ics20-transfer

chore: move serializers into ics20-transfer/types

fix: apply reviewer comments

imp: add docstring for cosmos_adr028_escrow_address

fix: add missing features + use workspace deps for ibc crates

imp: place re-exports under mod

feat: ibc core codebase overhaul (part-1)

feat: ibc core codebase overhaul (part-2)

chore: comment out ibc-query & ibc-testkit

fix: add missing features

nit

* fix: re-export ibc_apps in the ibc crate

* chore: adjust features + add description for crates

* fix: CI catches

* fix: no_std

* imp: define ics25-handler + move tendermint-specific impls into ibc-core-host-tendermint

* fix: cargo doc

* docs: add and edit READMEs

* fix: cargo hack catches

* fix: cargo udeps catches

* chore: ajdust README tables

* docs: further README adjustments

* fix: typo

* chore: another review of comments & READMEs

* imp: move Any and Protobuf to ibc-primitives

* fix: missing std features

* Split out ibc-clients crate (#971)

* Migrate crates/ibc-clients

* Fix dependencies in types directory

* Fix dependencies in ibc-clients crate

* Delete ibc/ics07_tendermint directory

* Resolve dependencies in ibc crate

* Resolve dependencies in ibc-clients crate

* Wrap ClientState type in a newtype wrapper

* Address all compilation errors

* Migrate crates/ibc-clients

* Fix dependencies in types directory

* Fix dependencies in ibc-clients crate

* Delete ibc/ics07_tendermint directory

* Resolve dependencies in ibc crate

* Resolve dependencies in ibc-clients crate

* Wrap ClientState type in a newtype wrapper

* Address all compilation errors

* Add default feature `std` for ibc-clients crate

* Change cfg derivation

* Fixing import paths

* Fix import paths for ibc-client-tendermint crate

* Fix merge conflicts

* Fix merge conflicts

* Fix merge conflicts

* Fix remaining compilation errors in ics07-tendermint crate

* chore: adjust import paths, features and READMEs

* fix: CI catches

* fix: add serde dep for ibc-client-tendermint

* fix: serde_tests

* imp: rename ClientState to ClientStateWrapper

---------

Co-authored-by: Farhad Shabani <farhad.shabani@gmail.com>

* docs: improve crates descriptions

* fix: apply reviewer comments

* Delete some unused modules and add some documentation

* Add TODO to use u64::dev_ceil

* Formatting of ibc-primitives README

* fix: ibc-primitives serde feature

---------

Co-authored-by: Sean Chen <seanchen11235@gmail.com>

* imp: move crates into the root directory

* chore: add unclogs + fix broken links

* fix: additional deps and features adjustment

* fix: cargo fmt, clippy

* imp: review ibc-core-host-cosmos crate

* fix: move consensus_state API implementation into ibc-client-tendermint

* Delete empty ics07-tendermint/types README

* fix: apply suggestions from code review

Co-authored-by: Sean Chen <seanchen11235@gmail.com>
Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>

* fix: adjust comments, markdowns

* nit: further touchups

---------

Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>
Co-authored-by: Sean Chen <seanchen11235@gmail.com>
@Farhad-Shabani Farhad-Shabani added this to the v0.48.0 milestone Nov 24, 2023
Farhad-Shabani added a commit that referenced this pull request Sep 9, 2024
* feat: migrate `applications` module under the `ibc` crate into `ibc-apps` (#967)

* feat: restructure and split off applications codebase into ibc-apps dir

* imp: rename transfer dir to ics20_transfer

* feat: add ibc-apps crate

* fix: remove redundant dep + fix cargo doc

* docs: add README and descriptions

* docs: update main README page

* nit: docstrings

* nit: docstrings

* imp: rename folder to ics20-transfer

* chore: move serializers into ics20-transfer/types

* fix: apply reviewer comments

* imp: add docstring for cosmos_adr028_escrow_address

* fix: add missing features + use workspace deps for ibc crates

* imp: place re-exports under mod

* nit: apply suggestions from code review

Co-authored-by: Sean Chen <seanchen11235@gmail.com>
Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>

* fix: cargo fmt

---------

Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>
Co-authored-by: Sean Chen <seanchen11235@gmail.com>

* docs: ADR-008 to restructure the `ibc` crate (#966)

* docs: write ADR for ibc crate restructure

* fix: mistaken adr007 file naming

* chore: markdown adjustment

* fix: apply suggestions from code review

Co-authored-by: Sean Chen <seanchen11235@gmail.com>
Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>

* docs: explanation for *-types interaction with ibc-proto

---------

Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>
Co-authored-by: Sean Chen <seanchen11235@gmail.com>

* feat: migrate `core`, `clients` modules into `ibc-core`, `ibc-clients` crates (#969)

* feat: migrate `core` module under the `ibc` crate into `ibc-core`

feat: migrate `core` module under the `ibc` crate into `ibc-core`

feat: migrate `applications` module under the `ibc` crate into `ibc-apps` (#967)

* feat: restructure and split off applications codebase into ibc-apps dir

* imp: rename transfer dir to ics20_transfer

* feat: add ibc-apps crate

* fix: remove redundant dep + fix cargo doc

* docs: add README and descriptions

* docs: update main README page

* nit: docstrings

* nit: docstrings

* imp: rename folder to ics20-transfer

* chore: move serializers into ics20-transfer/types

* fix: apply reviewer comments

* imp: add docstring for cosmos_adr028_escrow_address

* fix: add missing features + use workspace deps for ibc crates

* imp: place re-exports under mod

* nit: apply suggestions from code review

Co-authored-by: Sean Chen <seanchen11235@gmail.com>
Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>

* fix: cargo fmt

---------

Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>
Co-authored-by: Sean Chen <seanchen11235@gmail.com>

feat: restructure and split off applications codebase into ibc-apps dir

refactor: nits from nightly clippy (#962)

* use enum tuple variants directly

* use first() over get(0)

* use infallible conversion

* rm redundant export

* cargo fmt

ci: spell check on GitHub workflows (#964)

* typos github action

* cutom config for typos

* fix spelling to counterparty

* fix spelling to transfer

imp: rename transfer dir to ics20_transfer

feat: add ibc-apps crate

fix: remove redundant dep + fix cargo doc

docs: add README and descriptions

docs: update main README page

nit: docstrings

nit: docstrings

imp: rename folder to ics20-transfer

chore: move serializers into ics20-transfer/types

fix: apply reviewer comments

imp: add docstring for cosmos_adr028_escrow_address

fix: add missing features + use workspace deps for ibc crates

imp: place re-exports under mod

feat: ibc core codebase overhaul (part-1)

feat: ibc core codebase overhaul (part-2)

chore: comment out ibc-query & ibc-testkit

fix: add missing features

nit

* fix: re-export ibc_apps in the ibc crate

* chore: adjust features + add description for crates

* fix: CI catches

* fix: no_std

* imp: define ics25-handler + move tendermint-specific impls into ibc-core-host-tendermint

* fix: cargo doc

* docs: add and edit READMEs

* fix: cargo hack catches

* fix: cargo udeps catches

* chore: ajdust README tables

* docs: further README adjustments

* fix: typo

* chore: another review of comments & READMEs

* imp: move Any and Protobuf to ibc-primitives

* fix: missing std features

* Split out ibc-clients crate (#971)

* Migrate crates/ibc-clients

* Fix dependencies in types directory

* Fix dependencies in ibc-clients crate

* Delete ibc/ics07_tendermint directory

* Resolve dependencies in ibc crate

* Resolve dependencies in ibc-clients crate

* Wrap ClientState type in a newtype wrapper

* Address all compilation errors

* Migrate crates/ibc-clients

* Fix dependencies in types directory

* Fix dependencies in ibc-clients crate

* Delete ibc/ics07_tendermint directory

* Resolve dependencies in ibc crate

* Resolve dependencies in ibc-clients crate

* Wrap ClientState type in a newtype wrapper

* Address all compilation errors

* Add default feature `std` for ibc-clients crate

* Change cfg derivation

* Fixing import paths

* Fix import paths for ibc-client-tendermint crate

* Fix merge conflicts

* Fix merge conflicts

* Fix merge conflicts

* Fix remaining compilation errors in ics07-tendermint crate

* chore: adjust import paths, features and READMEs

* fix: CI catches

* fix: add serde dep for ibc-client-tendermint

* fix: serde_tests

* imp: rename ClientState to ClientStateWrapper

---------

Co-authored-by: Farhad Shabani <farhad.shabani@gmail.com>

* docs: improve crates descriptions

* fix: apply reviewer comments

* Delete some unused modules and add some documentation

* Add TODO to use u64::dev_ceil

* Formatting of ibc-primitives README

* fix: ibc-primitives serde feature

---------

Co-authored-by: Sean Chen <seanchen11235@gmail.com>

* imp: move crates into the root directory

* chore: add unclogs + fix broken links

* fix: additional deps and features adjustment

* fix: cargo fmt, clippy

* imp: review ibc-core-host-cosmos crate

* fix: move consensus_state API implementation into ibc-client-tendermint

* Delete empty ics07-tendermint/types README

* fix: apply suggestions from code review

Co-authored-by: Sean Chen <seanchen11235@gmail.com>
Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>

* fix: adjust comments, markdowns

* nit: further touchups

---------

Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>
Co-authored-by: Sean Chen <seanchen11235@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants