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 app, middleware and 05-port modules with ChanUpgradeTimeout function #3859

Merged

Conversation

charleenfei
Copy link
Contributor

@charleenfei charleenfei commented Jun 15, 2023

Description

part of the work needed for #3855

note that this PR does not actually implement the functionality of the app callbacks, it only sets up the blocker


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.

  • Targeted PR against correct branch (see CONTRIBUTING.md).
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/).
  • Added relevant godoc comments.
  • Provide a commit message to be used for the changelog entry in the PR description for review.
  • Re-reviewed Files changed in the Github PR explorer.
  • Review Codecov Report in the comment section below once CI passes.

@charleenfei charleenfei marked this pull request as ready for review June 15, 2023 11:38
proofErrorReceipt []byte,
proofHeight ibcexported.Height,
) error {
return im.app.OnChanUpgradeTimeout(ctx, portID, channelID, counterpartyChannel, prevErrorReceipt, proofCounterpartyChannel, proofErrorReceipt, proofHeight)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason why you forward here instead of nil? Just curious.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, because we are calling it from the controller middleware here which should pass the call through to the app for the app callback.

basically, this would be called in the usecase where you have an underlying module that you want to use to authenticate ICA actions (the kinda v0 auth module design we had for ICA), and then you wrap that application with the ICA controller middleware. in the v1 design you can pass a nil app to the ICA controller middleware, and use the controller msg_server directly.

Copy link
Contributor

@chatton chatton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@DimitrisJim DimitrisJim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🚀

@charleenfei charleenfei merged commit e201873 into 04-channel-upgrades Jun 16, 2023
@charleenfei charleenfei deleted the charly/chanupgradetimeout-app-module-impl branch June 16, 2023 20:01
@colin-axner
Copy link
Contributor

Can you link me to the discussion for adding OnChanUpgradeTimeout? I see the spec uses OnChanUpgradeRestore and I'm curious what use cases there are for apps distinguishing between cancelled upgrades and upgrades which were timed out

@colin-axner
Copy link
Contributor

Where do you see OnChanUpgradeTimeout?

I see:

  // restore callback must not return error since counterparty successfully restored previous channelEnd
    module.onChanUpgradeRestore(
        portIdentifer,
        channelIdentifier
    )
}

@charleenfei
Copy link
Contributor Author

ahhhh i think youre absolutely right 🙈

@charleenfei
Copy link
Contributor Author

will correct in a followup pr!

@colin-axner
Copy link
Contributor

Sounds good, no worries. Just made sense to me to only have 1 app callback for channel upgrade failure scenarios

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

Successfully merging this pull request may close these issues.

4 participants