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

feat: turn ClientConsensusStatePath::haight into Height #968

Closed
wants to merge 1 commit into from

Conversation

mina86
Copy link
Contributor

@mina86 mina86 commented Nov 16, 2023

Replace ClientConsensusStatePath’s epoch and height fields with
a single height field whose type is Height. This stores the exact
same information but allows infallible way to get Height out of the
path.

Arguably it also makes more sense conceptually since the epoch and
height are really just a single Height field. Even in formatted paths
those two are a single component so it makes sense to have them as
a single field.

Issue: #603


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).

Copy link

codecov bot commented Nov 16, 2023

Codecov Report

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

Comparison is base (bf77378) 66.30% compared to head (912b698) 66.86%.

Files Patch % Lines
crates/ibc/src/core/ics24_host/path.rs 18.75% 26 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #968      +/-   ##
==========================================
+ Coverage   66.30%   66.86%   +0.56%     
==========================================
  Files         161      161              
  Lines       15752    15579     -173     
==========================================
- Hits        10444    10417      -27     
+ Misses       5308     5162     -146     

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

Replace ClientConsensusStatePath’s epoch and height fields with
a single height field whose type is Height.  This stores the exact
same information but allows infallible way to get Height out of the
path.

Arguably it also makes more sense conceptually since the epoch and
height are really just a single Height field.  Even in formatted paths
those two are a single component so it makes sense to have them as
a single field.

Issue: informalsystems#603
@Farhad-Shabani
Copy link
Member

The codes touched in this PR, have been tweaked to align with our ibc crate restructuring (in this PR). Specifically, we've adjusted the ClientConsensusStatePath constructor to get the revision numbers and height separately for better decoupling of our ICS-02 and ICS-24 implementations there.
Let's hold off on this change until we wrap up the ibc restructuring PRs. I'll ping you after that to revisit and see if we can accommodate any of these changes.

@Farhad-Shabani
Copy link
Member

Given the new repo structure and to keep max compliance with IBC specs, the Height struct is now placed under the ibc-core-client-types crate and all the paths under the ibc-core-host-types, which two can't be dependent in the new setup (as it causes cyclic dependency issue).
Thus, the changes here can't be accommodated. Though, regarding the issue you mentioned here, I believe it will be solved as soon as we allow zero height creation.

@mina86 mina86 deleted the d branch November 29, 2023 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants