-
Notifications
You must be signed in to change notification settings - Fork 329
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
Option type should be used with non-zero Height #1009
Comments
My only potential concern with this solution is that our However, looking at the code, the zero height is often used as a special value, sometimes even explicitly mentioned in comments. This is confusing to me as I don't see any mention in the spec that the zero height should be treated differently. What am I missing here? I definitely agree that |
Note that |
We should perhaps encode this across the whole codebase as enum Height {
Latest,
Specific(u64)
} and then only convert |
It seems like a bunch of events use the zero height as well:
It seems to me that these should all use chain height from |
Yep, at least that's my understanding. @hu55a1n1 what do you think? Moreover, we should stop building events via the a) define explicitly what data each event carry in the event struct directly We are already doing (a) for the channel events but eg. not for the connection events. |
For context, I tried to solve this by implementing a The plan was to split the refactoring in multiple phases:
|
It is not clear to me what the event height means from the modules' perspective, because it seems like ibc-go doesn't include a
💯 |
Discussion relevant to #2043 |
FYI I'll wait on #2044 to be merged before I start working on this one to avoid merge conflicts. |
Crate
ibc-rs
Summary
Currently the
Height
type uses a specialHeight::zero()
value to denote the absence of height value. This causes ad hoc checks of whether a height is zero in various places. We should instead useOption<Height>
on places where the height value may be optional, and require non-zero value in theHeight
constructor.Acceptance Criteria
Option<Height>
instead ofHeight
.height == Height::zero()
is replaced with Option matching.For Admin Use
The text was updated successfully, but these errors were encountered: