Remove deprecated packet_data
and packet_ack
attributes
#5990
Labels
04-channel
deprecated
Issues to remove deprecated code
needs discussion
Issues that need discussion before they can be worked on
Milestone
Summary
Remove the
packet_data
andpacket_ack
attributes which were deprecated in ibc-go v1 because they are incompatible with the requirements introduced in CometBFT v0.37.Problem Definition
The
packet_data
andpacket_ack
attributes have been deprecated in ibc-go v1 in favor ofpacket_data_hex
andpacket_ack_hex
but never removed.The difference between these two sets of attributes is that the former two hold raw binary data (ie. they are byte arrays holding potentially non-UTF-8 data) whereas the latter two hold hex-encoded data (ie. they are valid UTF-8 strings).
This was all fine until CometBFT v0.37, as previously these event attributes were defined as Protobuf
bytes
and could therefore hold arbitrary data.However, since CometBFT v0.37, event attributes are defined as Protobuf
string
:As per the Protobuf specification:
The fact that these attributes which may hold arbitrary data are encoded to Protobuf strings may not cause any problem when encoded from Go because Go strings, for better or worse, are allowed to hold arbitrary data:
However, this will fail at decoding time because
proto.Unmarshal
validates thatstring
fields hold valid UTF-8 data:Moreover, in Rust:
String
type is required to hold valid UTF-8 dataString
for Protobuf fields of typestring
This has seldom caused issue in practice in Hermes, because most apps use JSON-encoded data (ie. valid UTF-8 data) in ICS-04 packet payloads.
Nevertheless, we have seen one instance of this problem, both on-chain and in Hermes, where an app was using Protobuf-encoded data for ICS-04 packet payloads, which is not valid UTF-8 data.
Proposal
Remove the
packet_data
andpacket_ack
attributes in ibc-go v9.For Admin Use
The text was updated successfully, but these errors were encountered: