cosmos / relayer

An IBC relayer for ibc-go
Apache License 2.0
390 stars 1.71k forks source link

retry only if processing completed for a packet #1393

Closed agouin closed 9 months ago

agouin commented 9 months ago

https://github.com/cosmos/relayer/blob/be5a4cf7022638a5ce773de3f2261a52ebbc276a/relayer/processor/message_processor.go#L323 here we track the height where we are "processing" a message. This is prior to attempting the broadcas

https://github.com/cosmos/relayer/blob/be5a4cf7022638a5ce773de3f2261a52ebbc276a/relayer/processor/path_end_runtime.go#L580 here, we check if the number of blocks since the lastProcessedHeight is at least 5, and will retry if so.

So, if we broadcast and don't see the observed event within 5 blocks, it will retry. This is especially an issue on faster chains such as sei and dydx where tx propagation through the p2p network can take more than 5 blocks

This modifies the behavior to be: if the last attempted broadcast completed, then retry if it has been more than 5 blocks since the previous broadcast attempt.

Additionally: removePacketRetention was using the incorrect key for clearing caches on the counterparty, which for acks can lead to counterparty recvpackets not being cleared.

Related: #1359