Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unambiguous packet query (informalsystems#613)
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.
- Loading branch information