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

Do not assume packet payload to be a valid UTF-8 string #3770

Closed
5 tasks done
romac opened this issue Jan 11, 2024 · 0 comments · Fixed by #3768
Closed
5 tasks done

Do not assume packet payload to be a valid UTF-8 string #3770

romac opened this issue Jan 11, 2024 · 0 comments · Fixed by #3768
Assignees
Labels
A: bug Admin: something isn't working A: critical Admin: critical or important I: protocol Internal: related to IBC protocol changes (eg. v2 update)
Milestone

Comments

@romac
Copy link
Member

romac commented Jan 11, 2024

Summary of Bug

Hermers currently assumes that the ICS-04 packet data is valid UTF-8, as it relies on the deprecated packet_data attribute when reconstructing a packet.

Relying on the packet_data attribute enforces a UTF-8 encoded payload (eg. JSON), disallowing Protobuf-encoded payloads which we are starting to see in the wild.

The packet_data atttribute [has been deprecated][0] in favor of packet_data_hex since IBC-Go v1.0.0.

Instead we should use packet_data_hex which is a hex-encoded string.

Version

master

Steps to Reproduce

Sending a packet with a Protobuf-encoded payload results in this error when Hermes attempts to relay it:

WARN ThreadId(222) worker.batch{chain=bbn-test-a}:supervisor.handle_batch{chain=bbn-test-a}:supervisor.process_batch{chain=bbn-test-a}:worker.packet.cmd{src_chain=bbn-test-a src_port=zoneconcierge src_channel=channel-0 dst_chain=bbn-test-b}: task encountered ignorable error: link error: link failed with underlying error: gRPC call `send_tx_simulate` failed with status: status: Internal, message: "failed to decode Protobuf message: EventAttribute.value: Event.attributes: Result.events: SimulateResponse.result: invalid string value: data is not UTF-8 encoded", details: [], metadata: MetadataMap { headers: {"content-type": "application/grpc", "x-cosmos-block-height": "63"} }

Acceptance Criteria

Hermes can relay packets with Protobuf-encoded payloads.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@romac romac added A: bug Admin: something isn't working I: protocol Internal: related to IBC protocol changes (eg. v2 update) A: critical Admin: critical or important labels Jan 11, 2024
@romac romac added this to the v1.8 milestone Jan 11, 2024
@romac romac self-assigned this Jan 11, 2024
@romac romac modified the milestones: v1.8, v1.8.1 Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: bug Admin: something isn't working A: critical Admin: critical or important I: protocol Internal: related to IBC protocol changes (eg. v2 update)
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant