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

update the Order check ValidateUpgradeFields util method to allow for all supported Order types #3635

Closed
3 tasks
charleenfei opened this issue May 23, 2023 · 2 comments
Assignees

Comments

@charleenfei
Copy link
Contributor

charleenfei commented May 23, 2023

Summary

In a previous version of the upgradability spec, a channel upgrade could only update the Ordering of the channel within a subset of the existing ordering (ie: Unordered channels could not be upgraded to Ordered, whereas Ordered could be updated to both Unordered and Ordered.) However, because the latest iteration of the spec allows for packets to finish their lifecycles, we can now upgrade channel ordering to any type of ordering, provided it is supported by the connection.

The util method for validating upgrade fields should reflect this.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged/assigned
@damiannolan
Copy link
Member

Partially addressed by removing dead code in #3634.

We should add the following in a follow up PR to ensure the order is supported by the underlying connection. ref

getVersions := connectionEnd.GetVersions()
if len(getVersions) != 1 {
    return "", nil, errorsmod.Wrapf(
	connectiontypes.ErrInvalidVersion,
	"single version must be negotiated on connection before opening channel, got: %v",
	getVersions,
    )
}

if !connectiontypes.VerifySupportedFeature(getVersions[0], order.String()) {
    return "", nil, errorsmod.Wrapf(
	connectiontypes.ErrInvalidVersion,
	"connection version %s does not support channel ordering: %s",
	getVersions[0], order.String(),
    )
}

This should probably be reflected in the spec also if not already. cc @AdityaSripal

@charleenfei charleenfei self-assigned this Jun 7, 2023
charleenfei added a commit that referenced this issue Jun 7, 2023
…ub.com:cosmos/ibc-go into charly/#3635-order-check-validateupgradefields
@crodriguezvega
Copy link
Contributor

Closed by #3774.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants