-
Notifications
You must be signed in to change notification settings - Fork 639
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
api!: remove capabilities #7270
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.
Needs migration docs. Can leave comments across this PR where stuff is removed.
There should probably be a store upgrades migration for removing capability store key.
@@ -65,16 +64,7 @@ func (k Keeper) registerInterchainAccount(ctx context.Context, connectionID, por | |||
return "", errorsmod.Wrapf(icatypes.ErrActiveChannelAlreadySet, "existing active channel %s for portID %s on connection %s", activeChannelID, portID, connectionID) | |||
} | |||
|
|||
switch { | |||
case k.portKeeper.IsBound(ctx, portID) && !k.hasCapability(ctx, portID): |
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.
This case basically says - if a a capability exists (port is bound) with core ibc, but not claimed by the ica app, then return an error. This is essentially unreachable code, unless someone has wired a code path into the chain to allow icacontroller- port ids to be created with the core ibc scoped keeper.
switch { | ||
case k.portKeeper.IsBound(ctx, portID) && !k.hasCapability(ctx, portID): | ||
return "", errorsmod.Wrapf(icatypes.ErrPortAlreadyBound, "another module has claimed capability for and bound port with portID: %s", portID) | ||
case !k.portKeeper.IsBound(ctx, portID): |
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.
This case is - if no capability exists (port bound) for port id in core ibc's scoped keeper, then;
- Set port: this was previously used for genesis exports such that we can recreate ports on a genesis restart, unclear if we still actually need this for ica as ports are assumed to be in the format
icacontroller-
. Unlike transfer where we set the port because it could be modified by devs to e.g. "ibc-transfer" (unclear if there is assumptions in other places that it must just be "transfer"). - Create a new capability via
BindPort
using ibc core's scoped keeper. This creates a capability and adds "ibc" as an owner. - Claim the capability using the ica scoped keeper. This adds ica as the second owner
In scenarios where we open a new channel(after close) for an existing port id, then neither of these cases are hit and skip the entire switch statement.
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 thanks for looking into this one 🫡
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.
Massive red diff, love it! Should we add something to the changelog too?
@@ -19,7 +19,6 @@ require ( | |||
github.com/cosmos/cosmos-proto v1.0.0-beta.5 | |||
github.com/cosmos/cosmos-sdk v0.50.10-0.20240808075341-156231be8aef | |||
github.com/cosmos/gogoproto v1.7.0 | |||
github.com/cosmos/ibc-go/modules/capability v1.0.1 |
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.
🥳
Quality Gate passed for 'ibc-go'Issues Measures |
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.
🎉 finally! What a great simplification! ❤️
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/
).godoc
comments.Files changed
in the GitHub PR explorer.SonarCloud Report
in the comment section below once CI passes.