Skip to content

Simplify IBC app callback lookup #3817

Closed

Description

Summary

Simplify the application callback lookup

Problem Definition

Currently the msg_server.go performs a repetitive calls to LookupModuleByPort and LookupModuleByChannel. These function are only used to get the module which is then passed to k.Router.GetRoute(module) to obtain the application callbacks.

Currently some of the calls to these lookup function use the returned capability, but this will likely be removed after this spec issue is addressed.

Proposal

We can likely reduce this 2 step lookup into one call:

cbs, err := k.PortKeeper.LookupCallbacksByChannel(ctx, msg.PortId, msg.ChannelId)
If err != nil {
    return err
}

Another alternative is to have the port keeper implement each callback function, such that you call through the port keeper:

err := k.PortKeeper.OnChanInit()

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged/assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    needs discussionIssues that need discussion before they can be worked onnice-to-havetype: code hygieneClean up code but without changing functionality or interfaces

    Type

    No type

    Projects

    • Status

      Done 🥳

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions