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

tx raw packet-ack sends wrong acknowledgments in a 3 chain setup #614

Closed
5 tasks done
ancazamfir opened this issue Feb 5, 2021 · 0 comments · Fixed by #613
Closed
5 tasks done

tx raw packet-ack sends wrong acknowledgments in a 3 chain setup #614

ancazamfir opened this issue Feb 5, 2021 · 0 comments · Fixed by #613
Assignees
Labels
I: logic Internal: related to the relaying logic
Milestone

Comments

@ancazamfir
Copy link
Collaborator

ancazamfir commented Feb 5, 2021

Crate

relayer

Summary of Bug

MsgAcknowledment is sometimes rejected in a 3 chain setup when sent by the CLI (works from the relayer loop). The issue appears on a chain with multiple channels with different counterparty chains but with same counterparty port and channel-id.

Many thanks to @vitorenesduarte for finding this. Here are his notes:

Description

Before, a query_txs for a packet on a given chain would filter only by the packet source port, source channel and sequence.
With 2 chains, there can be at most a single packet matching such filter, and this fact was assumed in the code.

However, this assumption does not hold with more than 2 chains. To understand why, consider the following example with chains ibc-0, ibc-1 and ibc-2:

  • a channel handshake occurs between ibc-0 and ibc-1; the channel identifiers are channel-0 on both ends
  • a channel handshake occurs between ibc-1 and ibc-2; the channel identifier on ibc-1 is channel-1 and on ibc-2 is channel-0

If now both ibc-0 and ibc-2 send packets to ibc-1 and we do a packet query filtering only by the source, such query will return
packets from both ibc-0 and ibc-1 (as both have channel-0 as the source channel in their packets).

In this commit, we start filtering also by the destination port and destination channel. This makes the packet query unambiguous.

Thanks @ancazamfir for the help debugging this issue. It was a fun one!

Version

1f2e72d

Steps to Reproduce


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: logic Internal: related to the relaying logic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants