-
Notifications
You must be signed in to change notification settings - Fork 23
Fix Sending Tokens Back #19
Fix Sending Tokens Back #19
Conversation
Hey Aditya, thanks for taking some time to address the issue! This was part of the originally reported issue which we have fixed in our dev branch. Without this fix packets trying to be sent from C->B->A would always timeout going C->B I did exactly what you have in this PR which I also took from ibc-go. With these changes transfer packets will succeed in going C->B, with the appropriate acknowledgement, but going B->A fails every time with this error being logged on the Gaia fork we are using for Chain B.
Here is the full log from Gaia (B) going C->B:
My method for testing all of this is using a branch on the go-relayer that pulls down a forked gaia with the dev branch on the packet-forward-middleware https://github.com/cosmos/relayer/blob/justin/ibc-router-demo/dev-env-demo |
This is just a logging error. It's not a real bug. We've fixed it now in cosmos/ibc-go#1130 so I would ignore this. Double check that there is a real bug. Are you sure that the tokens are not actually sent back? Did you query the original address to see if it received the tokens. Hmm so when I tried the When I tried it on your branch, I wasn't able to get the forward direction to work either. I'm assuming I have something wrong with my setup and you have your forward direction correctly depositing the IBC tokens to final destination and that you are not able to receive the packet on the second hop in the reverse direction. So i will just mention what I would do with your setup. A couple directions to start debugging this:
Let me know if this helps you narrow the issue down at all, I can help more if you can narrow down the behavior further with the steps above. If you can figure out why I'm getting different behavior then you, that would be useful to |
Duly noted. This was just the last bit of logging when trying to go C->B->A so thought there could be some correlation between that and the packet failing to be sent B->A. re: using that dev branch. I updated the test to use the I'll take a look at your suggestions and verify that the packet is being sent correctly (if at all) but just glancing at the logs from the relayer in that Thanks again for taking the time to lend a hand here! |
Quick PR with my suspicion of what went wrong in router logic to prevent tokens from being correctly sent back.
I haven't tested this or written any test cases.
The routing logic needs to basically reconstruct the denom that would be constructed in RecvPacket, which wasn't happening in the case where router chain was source of funds in first hop.
See here:
https://github.com/cosmos/ibc-go/blob/main/modules/apps/transfer/keeper/relay.go#L229
I've basically copied over that code, please test manually and write test cases for this logic before merging.
Thanks!