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

imp: add passthrough handlers for callbacks mw module #5376

Conversation

charleenfei
Copy link
Contributor

Description

closes: #4575

Commit Message / Changelog Entry

type: commit message

see the guidelines for commit messages. (view raw markdown for examples)


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 December 12, 2023 09:22
…he-channel-upgradability-application-callbacks-for-mod/callbacks
@charleenfei charleenfei marked this pull request as draft December 12, 2023 10:22
@charleenfei charleenfei marked this pull request as ready for review December 12, 2023 11:09
Copy link
Member

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

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

Looks like OnChanUpgradeConfirm is missing?

would be good to add an interface assertion at the top!

var _ porttypes.UpgradeableModule = (*IBCMiddleware)(nil)

modules/apps/callbacks/ibc_middleware.go Show resolved Hide resolved
modules/apps/callbacks/ibc_middleware.go Show resolved Hide resolved
…he-channel-upgradability-application-callbacks-for-mod/callbacks
@crodriguezvega crodriguezvega added the channel-upgradability Channel upgradability feature label Dec 13, 2023
@colin-axner colin-axner added the priority PRs that need prompt reviews label Dec 13, 2023
@colin-axner colin-axner marked this pull request as draft December 13, 2023 16:41
@colin-axner colin-axner marked this pull request as ready for review December 13, 2023 16:50
func (im IBCMiddleware) OnChanUpgradeInit(ctx sdk.Context, portID, channelID string, order channeltypes.Order, connectionHops []string, version string) (string, error) {
cbs, ok := im.app.(porttypes.UpgradableModule)
if !ok {
return "", errorsmod.Wrap(porttypes.ErrInvalidRoute, "upgrade route not found to module in application callstack")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: these err messages seem slightly off structurally wise?

Copy link
Member

Choose a reason for hiding this comment

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

how so? what would you expect them to look like?

I think this is how I structured them in the initial PR for core and other mods like fee etc, I'm open to suggestions if you want to open a PR and address all of them together after this then go ahead!

@@ -20,6 +20,7 @@ import (
var (
_ porttypes.Middleware = (*IBCMiddleware)(nil)
_ porttypes.PacketDataUnmarshaler = (*IBCMiddleware)(nil)
_ porttypes.UpgradableModule = (*IBCMiddleware)(nil)
Copy link
Member

Choose a reason for hiding this comment

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

I assume its intensional that we never added an app upgrade callback for chanUpgradeConfirm, its been so long that I don't really remember, but I think it was

Copy link
Contributor

Choose a reason for hiding this comment

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

yes it is intentional. I think there's nothing to do in that step since it is just acknowledging that the counterparty set your timeout timer

Copy link
Member

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

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

lgtm!

func (im IBCMiddleware) OnChanUpgradeInit(ctx sdk.Context, portID, channelID string, order channeltypes.Order, connectionHops []string, version string) (string, error) {
cbs, ok := im.app.(porttypes.UpgradableModule)
if !ok {
return "", errorsmod.Wrap(porttypes.ErrInvalidRoute, "upgrade route not found to module in application callstack")
Copy link
Member

Choose a reason for hiding this comment

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

how so? what would you expect them to look like?

I think this is how I structured them in the initial PR for core and other mods like fee etc, I'm open to suggestions if you want to open a PR and address all of them together after this then go ahead!

…he-channel-upgradability-application-callbacks-for-mod/callbacks
@charleenfei charleenfei merged commit 355d401 into 04-channel-upgrades Dec 14, 2023
55 checks passed
@charleenfei charleenfei deleted the charly/issue#4575-implement-the-channel-upgradability-application-callbacks-for-mod/callbacks branch December 14, 2023 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
channel-upgradability Channel upgradability feature priority PRs that need prompt reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants