Conversation
|
cc relayer teams: @ethanfrey @ancazamfir
|
|
@colin-axner Why? That doesn't make any sense to me. If I want to protobuf encode my packet data i should just be able to do that. With your proposal, I either shouldn't use protobuf. Or I need to do a secondary encoding to make it utf-8, and then decode twice in my application RecvPacket callback. This doesn't make sense. Packet Data is raw data (marshaled in whatever preference of the app developer), it's not a string. It's up to us as core IBC to make sure that raw data gets to the other end correctly so that it can be unmarshaled as expected by app developer. It's not up to app developer to make their raw data look like a "string" for our convenience. |
There was a problem hiding this comment.
I gave it some more thought and this solution sounds good since it only changes how events are emitted.
If applications are using proto to marshal their packet data, then I don't see why other applications won't run into the same issue we are facing here. Is there usefulness in not hex encoding packet data before passing it to core IBC?
|
can you add a section to the migrations doc? |
This fix makes it such that applications that use proto to marshal won't face this issue at all. Assuming relayers upgrade to use the new attribute. So regardless of the encoding format that applications choose, IBC will work. As I tested, proto-marshalling transfer packet data works seamlessly if you encode/decode with hex. It breaks when you try to just do a raw conversion. Without this fix, we are limiting application choice on encoding without a good reason. Note applications are returning a byte slice, not a string in |
Codecov Report
@@ Coverage Diff @@
## main #144 +/- ##
===========================================
+ Coverage 65.22% 78.86% +13.64%
===========================================
Files 127 109 -18
Lines 8413 6468 -1945
===========================================
- Hits 5487 5101 -386
+ Misses 2561 1008 -1553
+ Partials 365 359 -6
|
|
Thanks for the quick fix. |
Description
Encoding packet data in hex allows for more robust encoding/decoding for relayers. Proto-encoded packets were breaking with old bare string conversion. Raw binary can be passed through events using hex.
Tested live with go-relayer and two-chainz script
closes: #XXXX
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.
docs/) or specification (x/<module>/spec/)godoccomments.Unreleasedsection inCHANGELOG.mdFiles changedin the Github PR explorerCodecov Reportin the comment section below once CI passes