cosmos / ibc-rs

Rust implementation of the Inter-Blockchain Communication (IBC) protocol.
Apache License 2.0
206 stars 82 forks source link

Faulty receipt check during receive packet validation #1336

Closed Farhad-Shabani closed 2 months ago

Farhad-Shabani commented 2 months ago

Background

During the validation of a received packet, in case of unordered channels, there is a check where the handler look for the receipt packet by calling get_packet_receipt. If the receipt exist or not it will do nothing and treats as a no-op. But if the storage call result in any other failure than PacketReceiptNotFound the handler throw out error and recv_packet_validate fail.

Bug Summary

This is faulty and redundant check as it’s very probable that a host for non-existence case, be wrongly emitting another error variant, therefore get_packet_receipt call end up with failure instead of no-op. Besides, this storage call is redundant as in any case it's supposed to be no-op.

Version

<= 0.54.0