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

ChanUpgradeAck should call the chanUpgradeOpen subprotocol if ready #4030

Closed
3 tasks
damiannolan opened this issue Jul 6, 2023 · 2 comments
Closed
3 tasks
Assignees
Labels
04-channel channel-upgradability Channel upgradability feature

Comments

@damiannolan
Copy link
Member

Summary

The following spec additions should be added to the ChanUpgradeAck handler to call the channel upgrade open subprotocol if ready:

// if both sides have already flushed then open the upgrade handshake immediately
if currentChannel.flushStatus == FLUSHCOMPLETE && counterpartyFlushStatus == FLUSHCOMPLETE {
        openUpgradelHandshake(portIdentifier, channelIdentifier)
        module.onChanUpgradeOpen(portIdentifier, channelIdentifier)
}

Note, we normally route app callbacks from the core msg server so we probably need to make this check at that level in order to call:

cbs.OnChanUpgradeOpen(ctx, msg.PortId, msg.ChannelId)

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged/assigned
@damiannolan damiannolan added 04-channel channel-upgradability Channel upgradability feature labels Jul 6, 2023
@damiannolan damiannolan added this to the 04-channel upgrades alpha milestone Jul 6, 2023
@damiannolan
Copy link
Member Author

Note when calling into ChanUpgradeOpen subprotocol from ChanUpgradeAck we assume the counterpartyChannelState to be TRYUPGRADE as is already verified in the ChanUpgradeAck handler

func (k Keeper) ChanUpgradeOpen(
	ctx sdk.Context,
	portID,
	channelID string,
	counterpartyChannelState types.State,
	proofChannel []byte,
	proofHeight clienttypes.Height,
) error 

@DimitrisJim
Copy link
Contributor

closed in #4075

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
04-channel channel-upgradability Channel upgradability feature
Projects
Archived in project
Development

No branches or pull requests

2 participants