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

Add extension point for ibc app version decoding #1100

Closed
wants to merge 1 commit into from

Conversation

alpe
Copy link
Contributor

@alpe alpe commented Nov 18, 2022

After #1088

The version string stored with the channel can be overloaded with ibc middleware data. This PR adds an extension point to add a custom decoder to return the original IBC app level version.

  • ICS29AppVersionDecoder - supports the fee middleware
  • AppVersionDecoderChain - util to chain decoders as you can do with middleware and cascade output

@alpe alpe requested a review from pinosu November 18, 2022 11:10
Copy link
Member

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

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

I am confused here, and we should check with the ibc-go team.

When I discussed middleware with them this summer, understood it to be transparent. So if I have middleware(A) talking to middleware(B), neither A or B is aware they are wrapped by the middleware. The middleware sees the whole packet and version and after stripping off it's envelope, passes the content to the wrapped protocol.

For me, this is the only way that it can easily be adopted without forking all protocols that may be wrapped. Can @AdityaSripal comment on this issue?

@alpe
Copy link
Contributor Author

alpe commented Nov 18, 2022

The issue is that we not always have the full channel data passed via the IBC module but load the channel info from the store. There the raw version is stored.

},
) IBCAppVersionDecoder {
return AppVersionDecoderFn(func(ctx sdk.Context, rawVersion, portID, channelID string) (string, error) {
if channelSource.IsFeeEnabled(ctx, portID, channelID) {
Copy link
Member

Choose a reason for hiding this comment

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

If needed to get it to work, it is a hack and shows middleware stack is not complete.

There may be many new middleware and the wrapped applications shouldn't need to care, so no need to add eg ICS49 middleware that comes later

@codecov
Copy link

codecov bot commented Nov 18, 2022

Codecov Report

Merging #1100 (5487a70) into 960_ibc420 (2ce07c9) will increase coverage by 0.07%.
The diff coverage is 79.16%.

Impacted file tree graph

@@              Coverage Diff               @@
##           960_ibc420    #1100      +/-   ##
==============================================
+ Coverage       59.87%   59.94%   +0.07%     
==============================================
  Files              54       55       +1     
  Lines            7299     7332      +33     
==============================================
+ Hits             4370     4395      +25     
- Misses           2617     2621       +4     
- Partials          312      316       +4     
Impacted Files Coverage Δ
x/wasm/ibc.go 67.41% <61.90%> (-2.18%) ⬇️
x/wasm/ibc_middleware_support.go 92.30% <92.30%> (ø)
app/app.go 88.54% <100.00%> (ø)

@alpe
Copy link
Contributor Author

alpe commented Nov 21, 2022

Obsolete by #1102

@alpe alpe closed this Nov 21, 2022
@alpe alpe deleted the 960_ibc420_decoding branch March 22, 2023 09:53
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.

2 participants