-
Notifications
You must be signed in to change notification settings - Fork 628
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(release/v8.3.x): use unordered ordering by default for new ica channels #6251
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,48 @@ func (k Keeper) RegisterInterchainAccount(ctx sdk.Context, connectionID, owner, | |
|
||
k.SetMiddlewareEnabled(ctx, portID, connectionID) | ||
|
||
_, err = k.registerInterchainAccount(ctx, connectionID, portID, version, channeltypes.ORDERED) | ||
_, err = k.registerInterchainAccount(ctx, connectionID, portID, version, channeltypes.UNORDERED) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} | ||
|
||
// RegisterInterchainAccountWithOrdering is the entry point to registering an interchain account: | ||
// - It generates a new port identifier using the provided owner string, binds to the port identifier and claims the associated capability. | ||
// - Callers are expected to provide the appropriate application version string. | ||
// - For example, this could be an ICS27 encoded metadata type or an ICS29 encoded metadata type with a nested application version. | ||
// - A new MsgChannelOpenInit is routed through the MsgServiceRouter, executing the OnOpenChanInit callback stack as configured. | ||
// - An error is returned if the port identifier is already in use. Gaining access to interchain accounts whose channels | ||
// have closed cannot be done with this function. A regular MsgChannelOpenInit must be used. | ||
// | ||
// Deprecated: this is a legacy API that is only intended to function correctly in workflows where an underlying authentication application has been set. | ||
// Calling this API will result in all packet callbacks being routed to the underlying application. | ||
|
||
// Please use MsgRegisterInterchainAccount for use cases which do not need to route to an underlying application. | ||
|
||
// Prior to v6.x.x of ibc-go, the controller module was only functional as middleware, with authentication performed | ||
// by the underlying application. For a full summary of the changes in v6.x.x, please see ADR009. | ||
// This API will be removed in later releases. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I used the same godoc as for |
||
func (k Keeper) RegisterInterchainAccountWithOrdering(ctx sdk.Context, connectionID, owner, version string, ordering channeltypes.Order) error { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added this function to allow setting the ordering, otherwise if the controller chain has a a custom auth module and tries to open a channel with a host chain that doesn't support unordered channels, any attempt to open new ICA channels will fail. Using this function, the controller chain has the option to use ordered ordering with chains that don't support unordered ordering. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will open an issue to break the API of |
||
portID, err := icatypes.NewControllerPortID(owner) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
if k.IsMiddlewareDisabled(ctx, portID, connectionID) && !k.IsActiveChannelClosed(ctx, connectionID, portID) { | ||
return errorsmod.Wrap(icatypes.ErrInvalidChannelFlow, "channel is already active or a handshake is in flight") | ||
} | ||
|
||
k.SetMiddlewareEnabled(ctx, portID, connectionID) | ||
|
||
// use ORDER_UNORDERED as default in case ordering is NONE | ||
if ordering == channeltypes.NONE { | ||
ordering = channeltypes.UNORDERED | ||
} | ||
|
||
_, err = k.registerInterchainAccount(ctx, connectionID, portID, version, ordering) | ||
if err != nil { | ||
return err | ||
} | ||
|
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.
We deprecated this in ibc-go/v6. We should discuss what it would mean to remove these APIs in favour of migrating directly to msg service router, and what users may be affected.
i.e. removing
RegisterInterchainAccount
public function used by "auth modules" and instead they depend on the baseappMsgServiceRouter
and sendMsgRegisterInterchainAccount
.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.
Thanks, @damiannolan. Yes, I agree we should discuss this. I was also thinking that if we get to ICS27 v2 this year, that might be a good moment to tackle that.