cosmos / relayer

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

fix: avoid counterparty recv packet message get removed before open channel #1455

Closed mmsqe closed 6 months ago

mmsqe commented 6 months ago

relay packet message happens right before new channel get created, for more info:

2024-05-01T01:36:49.868214Z info Successfully created new channel {"chain_name": "cronos_777-1", "chain_id": "cronos_777-1", "channel_id": "channel-2", "connection_id": "connection-0", "port_id": "icacontroller-crc1q04jewhxw4xxu3vlg3rc85240h9q7ns6hglz0g"} 2024-05-01T01:36:52.722142Z info Successful transaction {"provider_type": "cosmos", "chain_id": "chainmain-1", "gas_used": 161557, "fees": "196281000000basecro", "fee_payer": "cro1u08u5dvtnpmlpdq333uj9tcj75yceggszxpnsy", "height": 57, "msg_types": ["/ibc.core.client.v1.MsgUpdateClient", "/ibc.core.channel.v1.MsgChannelOpenConfirm"], "tx_hash": "46663D951CA2738EC796451679400C351D93AD3B73F22778654CA5301EA39F09"} 2024-05-01T01:36:52.869073Z warn Refusing to relay packet message because channel is not open {"path_name": "chainmain-cronos", "chain_id": "chainmain-1", "client_id": "07-tendermint-0", "event_type": "recv_packet", "sequence": 1, "channel_id": "channel-2", "port_id": "icahost", "counterparty_channel_id": "channel-2", "counterparty_port_id": "icacontroller-crc1q04jewhxw4xxu3vlg3rc85240h9q7ns6hglz0g"} 2024-05-01T01:36:52.869222Z info Successfully created new channel {"chain_name": "chainmain-1", "chain_id": "chainmain-1", "channel_id": "channel-2", "connection_id": "connection-0", "port_id": "icahost"}
mmsqe commented 6 months ago

good catch!

is the max retry being set to 1 enough to always ensure the packet gets relayed? in the logs you posted it looks like that is the case since the relayer attempted to relay the packet right after the MsgChannelOpenConfirm.

Yes, retry once would be good enough for this edge case.