heliaxdev / hermes

IBC Relayer in Rust
https://hermes.informal.systems
Apache License 2.0
5 stars 10 forks source link

Namada chain didn't receive the ack with Hermes relaying #17

Closed yito88 closed 5 months ago

yito88 commented 11 months ago

Summary of Bug

When a Namada chain sent a token to another Namada chain, (if the other chain didn't send, i.e. SendPacket event didn't happen,) the source chain didn't receive the ack though Hermes caught the WriteAcknowledgement event from the destination chain.

Version

v1.7.1-namada-beta4

Steps to Reproduce

Acceptance Criteria


For Admin Use

yito88 commented 11 months ago

The cause is a difference in Tendermint's event type between Cosmos and Namada. Cosmos(Gaia) emitted a WriteAcknowledgement event in Tx event type. Namada emitted all events in EndBlock and they were included in NewBlock event type. Hermes doesn't assume that WriteAcknowledgement event is included in NewBlock. (So, transfers from Namada to Gaia worked well.) When the event is captured in Hermes, Hermes spawns a relaying thread and relays the packet for the ack. However, Namada's WriteAcknowledgement event was ignored by Hermes because it was in NewBlock event.

I fixed Hermes to check WriteAcknowledgement event in NewBlock, and it worked well. https://github.com/heliaxdev/hermes/commit/764973dd79233e7a709b9e709763a327ebaddfdc

hkey0 commented 8 months ago

Bunun nedeni, Tendermint'in Cosmos ve Namada arasındaki olay türündeki farklılıktır. Cosmos(Gaia) bir mesaj yaydı WriteAcknowledgementolay Txetkinlik tipi. Namada tüm olayları yayınladı EndBlockve onlar da dahil edildi NewBlocketkinlik tipi. Hermes bunu varsaymıyor WriteAcknowledgementetkinlik dahildir NewBlock. (Yani Namada'dan Gaia'ya transferler işe yaradı.) Olay Hermes'te yakalandığında, Hermes bir aktarma iş parçacığı oluşturur ve paketi onay için iletir. Ancak Namada'nın WriteAcknowledgementolay Hermes tarafından göz ardı edildi çünkü NewBlocketkinlik.

Hermes'i kontrol etmesi için düzelttim WriteAcknowledgementolay NewBlockve iyi çalıştı. 764973d

hello yito when i want to swap tokens with xcs contract in osmosis and send them to namada, the tokens get stuck in relayer.

if I then send a regular ibc transfer, the tokens stuck in relayer are transferred to namada. is this issue related to my problem?

yito88 commented 8 months ago

Hi @hkey0, thank you for reporting it. Actually, this issue has been resolved by using the upstream tendermint-rs. Could you share your operations to reproduce the issue and the versions of Namada and Hermes?

hkey0 commented 8 months ago

Hi @hkey0, thank you for reporting it. Actually, this issue has been resolved by using the upstream tendermint-rs. Could you share your operations to reproduce the issue and the versions of Namada and Hermes?

I didn't expect you to respond so quickly. So I was resting. Sorry for the late reply.

I am using the latest version of Namada (0.31.6). I installed Hermes following the instructions here. https://docs.namada.net/operators/ibc#from-source

I set up relayer, deployed xcs and swap router contract in osmosis testnet, set pools and channels from the contract. I can start a transaction in osmosis, swap tokens and transfer tokens to namada (atomically) but most of the time the funds get stuck in relayer. Then when I do a regular ibc transfer, the stuck funds are transferred to namada.

I sent you a message on discord (yuji088) to chat in detail. My nickname is hkey. Can we chat on discord for instant and fast communication?

yito88 commented 5 months ago

The original issue was resolved by using the upstream tendermint-rs