-
Notifications
You must be signed in to change notification settings - Fork 624
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
fix: ica handshake reopening channel - use GetAppVersion
in favour of channel.Version
#2302
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a changelog entry, @damiannolan? :)
Done! ✅ |
if !icatypes.IsPreviousMetadataEqual(channel.Version, metadata) { | ||
appVersion, found := k.GetAppVersion(ctx, portID, activeChannelID) | ||
if !found { | ||
panic(fmt.Sprintf("active channel mapping set for %s, but channel does not exist in channel store", activeChannelID)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this panic introduces multiple conventions in the function (error return + panic) does it make more sense to return an error instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to panic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned earlier in person I just followed essentially the same used above here - as in some places in ibc-go code we just panic
because it's unreachable code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we could add a comment indicating as such? The message we panic with seems like it would be a regular error that we could run into.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to add a test case for the exact issue we had?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
I've been modifying the existing the test It looks like we need to handle the same unwrapping of the channel version on the host in the This requires us to compose the I'll make the changes locally and see if it resolves the failing test before pushing an update. Edit: This seemed to do the trick. I've pushed an update with the changes to the |
…el version in OnChanOpenTry handshake cb
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2302 +/- ##
==========================================
+ Coverage 79.54% 79.58% +0.03%
==========================================
Files 175 175
Lines 12069 12131 +62
==========================================
+ Hits 9600 9654 +54
- Misses 2045 2049 +4
- Partials 424 428 +4
|
Thank you for this fix ibc-go team! |
@damiannolan Could you please document this API change in the PR for the migration docs of v5? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM just left a very minor nit!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
if !icatypes.IsPreviousMetadataEqual(channel.Version, metadata) { | ||
appVersion, found := k.GetAppVersion(ctx, portID, activeChannelID) | ||
if !found { | ||
panic(fmt.Sprintf("active channel mapping set for %s, but channel does not exist in channel store", activeChannelID)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a nit: channel does not exist in channel store
is kind of confusing if the error is GetAppVersion
returning not found -- maybe something like channel version does not exist?
…of `channel.Version` (#2302) * adding unwrapping of channel version to ica controller handshake reopening flow * adding changelog * adding ics4Wrapper to ics27 host submodule, handling unwrapping channel version in OnChanOpenTry handshake cb * updating changelog Co-authored-by: colin axnér <[email protected]> Co-authored-by: Carlos Rodriguez <[email protected]> (cherry picked from commit 9e6246f) # Conflicts: # CHANGELOG.md # modules/apps/27-interchain-accounts/host/keeper/keeper.go
…of `channel.Version` (#2302) * adding unwrapping of channel version to ica controller handshake reopening flow * adding changelog * adding ics4Wrapper to ics27 host submodule, handling unwrapping channel version in OnChanOpenTry handshake cb * updating changelog Co-authored-by: colin axnér <[email protected]> Co-authored-by: Carlos Rodriguez <[email protected]> (cherry picked from commit 9e6246f) # Conflicts: # CHANGELOG.md # modules/apps/27-interchain-accounts/host/keeper/keeper.go
…of `channel.Version` (backport #2302) (#2357) * fix: ica handshake reopening channel - use `GetAppVersion` in favour of `channel.Version` (#2302) * adding unwrapping of channel version to ica controller handshake reopening flow * adding changelog * adding ics4Wrapper to ics27 host submodule, handling unwrapping channel version in OnChanOpenTry handshake cb * updating changelog Co-authored-by: colin axnér <[email protected]> Co-authored-by: Carlos Rodriguez <[email protected]> (cherry picked from commit 9e6246f) # Conflicts: # CHANGELOG.md # modules/apps/27-interchain-accounts/host/keeper/keeper.go * fixing imports and interface type Co-authored-by: Damian Nolan <[email protected]>
…of `channel.Version` (backport #2302) (#2358) * fix: ica handshake reopening channel - use `GetAppVersion` in favour of `channel.Version` (#2302) * adding unwrapping of channel version to ica controller handshake reopening flow * adding changelog * adding ics4Wrapper to ics27 host submodule, handling unwrapping channel version in OnChanOpenTry handshake cb * updating changelog Co-authored-by: colin axnér <[email protected]> Co-authored-by: Carlos Rodriguez <[email protected]> (cherry picked from commit 9e6246f) # Conflicts: # CHANGELOG.md # modules/apps/27-interchain-accounts/host/keeper/keeper.go * fixing merge conflict error - reinstate interface type for msg router Co-authored-by: Damian Nolan <[email protected]>
Description
closes: #XXXX
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes