-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Move IBC packet data interpretation to the application module #5890
Conversation
09dc1a8
to
9ef298b
Compare
Hmm, I actually would prefer that we just get rid of |
I'm in favor of that as well. Would we still have the PacketDataI type as the thing that the golang modules unmarshal to? |
No strong reason, so yes, I'll do that. I'm just getting my feet wet. 😄
Probably an application-level interface (not exported by the channel) just to be able to specify the subset of codecs to use for the packet unmarshalling. I'll rename it just to prevent conflicts. @cwgoes Should the IBC channel have a |
I don't think there needs to be a common interface if modules are decoding individually anyways.
💯
Yes, exactly.
Yes, I think that makes sense, it should not be in each encoding separately for sure. |
This also adds a channelexported.NewOpaquePacketData(rawBytes) implementation to assist apps in being able to manipulate the raw packet data using the codec layer.
9ef298b
to
b5070a4
Compare
Codecov Report
@@ Coverage Diff @@
## ibc-alpha #5890 +/- ##
=============================================
- Coverage 35.25% 35.25% -0.01%
=============================================
Files 408 408
Lines 42411 42409 -2
=============================================
- Hits 14952 14950 -2
Misses 26108 26108
Partials 1351 1351
|
This one only has a GetBytes() method, which is implemented by OpaquePacketData.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is exactly the right direction, I think we can fail even faster on the deserialisation.
No need to wrap the []byte packet.GetData(). If the caller wants it, they can use it directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great improvement! Main request is that the packet timeout is still committed correctly with these new changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Pending @AdityaSripal's comments to be resolved
Should we implement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one minor improvement
Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
@jackzampolin writes:
That's a terrific idea! Doing this would greatly simplify the ICS-20 implementation and make it much more understandable in intent. Do you want to take this to an issue? |
Would like to see it impl in this PR tbh |
This is a great idea but imo out of scope for this PR. If we get this in I can reduce the number of changes to the proto migration and I prefer not to be blocked 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 🎉
Closes: #5870
Description
The main change is as the title: to move the IBC packet data interpretation to the application module to which it was routed. Notably, the
TimeoutHeight
is moved toPacketI
andData
is a raw[]byte
again.The tests pass for the entire
x/ibc
directory, but I'm unsure if I have covered all the corner cases.I will need help from @jackzampolin and @cwgoes to get this over the finish line. Next comes testing in Agoric's Cosmos module.
For contributor use:
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerFor admin use:
WIP
,R4R
,docs
, etc)