Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packet timeout timestamp at IBC is not updated until next TX #611

Closed
4 tasks
RaulBernal opened this issue Oct 26, 2021 · 3 comments
Closed
4 tasks

Packet timeout timestamp at IBC is not updated until next TX #611

RaulBernal opened this issue Oct 26, 2021 · 3 comments

Comments

@RaulBernal
Copy link

Summary of Bug

The field value timeout_timestamp is not recalculated properly.
Until a new valid TX is generated, the value of the field is not recalculated.
This causes invalid packets if a valid TX is not sent within 10 minutes (default value of the timeout).

Version

From SDK v.0.42.x to v.0.44.x
Tested in

  • Osmosis v.4.1.0 cosmos_sdk_version: v0.42.9
  • BitCanna v.1.2 cosmos sdk_version: v.0.44.2

Steps to Reproduce

$date
Mon Oct 25 08:00:40 UTC 2021
$ bcnad tx ibc-transfer transfer transfer channel-1 osmo1skyy4yhejshhs9rv67fl2dswnlhk3mfugvr7sv 69ubcna  --gas auto --gas-prices 0.001ubcna --gas-adjustment 1.5  --from validator  --packet-timeout-timestamp 600000000000
Enter keyring passphrase:
gas estimate: 102783
{"body":{"messages":[{"@type":"/ibc.applications.transfer.v1.MsgTransfer","source_port":"transfer","source_channel":"channel-1","token":{"denom":"ubcna","amount":"69"},"sender":"bcna1606cfyw6q60umn9zvv5j77ds896r5wqsajy0af","receiver":"osmo1skyy4yhejshhs9rv67fl2dswnlhk3mfugvr7sv","timeout_height":{"revision_number":"1","revision_height":"1724774"},"timeout_timestamp":"1635148912350984020"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[{"denom":"ubcna","amount":"103"}],"gas_limit":"102783","payer":"","granter":""}},"signatures":[]}

confirm transaction before signing and broadcasting [y/N]: n
cancelled transaction
$ date
Mon Oct 25 08:01:04 UTC 2021
$ bcnad tx ibc-transfer transfer transfer channel-1 osmo1skyy4yhejshhs9rv67fl2dswnlhk3mfugvr7sv 69ubcna  --gas auto --gas-prices 0.001ubcna --gas-adjustment 1.5  --from validator  --packet-timeout-timestamp 600000000000
Enter keyring passphrase:
gas estimate: 102783
{"body":{"messages":[{"@type":"/ibc.applications.transfer.v1.MsgTransfer","source_port":"transfer","source_channel":"channel-1","token":{"denom":"ubcna","amount":"69"},"sender":"bcna1606cfyw6q60umn9zvv5j77ds896r5wqsajy0af","receiver":"osmo1skyy4yhejshhs9rv67fl2dswnlhk3mfugvr7sv","timeout_height":{"revision_number":"1","revision_height":"1724774"},"timeout_timestamp":"1635148912350984020"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[{"denom":"ubcna","amount":"103"}],"gas_limit":"102783","payer":"","granter":""}},"signatures":[]}

confirm transaction before signing and broadcasting [y/N]: n

We get this error on relayer:
I[2021-10-25|08:02:09.671] ✘ [osmosis-1]@{1723868} - msg(0:/ibc.core.client.v1.MsgUpdateClient,1:/ibc.core.channel.v1.MsgRecvPacket) err(channel:14:failed to execute message; message index: 1: receive packet verification failed: block timestamp >= packet timeout timestamp (2021-10-25 08:02:00.472031016 +0000 UTC >= 2021-10-25 08:01:52.35098402 +0000 UTC): packet timeout)

The same for osmosisd

$ osmosisd tx ibc-transfer transfer transfer channel-51 bcna1606cfyw6q60umn9zvv5j77ds896r5wqsajy0af 1uosmo --from test
Enter keyring passphrase:
{"body":{"messages":[{"@type":"/ibc.applications.transfer.v1.MsgTransfer","source_port":"transfer","source_channel":"channel-51","token":{"denom":"uosmo","amount":"1"},"sender":"osmo1skyy4yhejshhs9rv67fl2dswnlhk3mfugvr7sv","receiver":"bcna1606cfyw6q60umn9zvv5j77ds896r5wqsajy0af","timeout_height":{"revision_number":"1","revision_height":"371458"},"timeout_timestamp":"1635148630217372060"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}

confirm transaction before signing and broadcasting [y/N]: n
cancelled transaction

$ osmosisd tx ibc-transfer transfer transfer channel-51 bcna1606cfyw6q60umn9zvv5j77ds896r5wqsajy0af 1uosmo --from test
Enter keyring passphrase:
{"body":{"messages":[{"@type":"/ibc.applications.transfer.v1.MsgTransfer","source_port":"transfer","source_channel":"channel-51","token":{"denom":"uosmo","amount":"1"},"sender":"osmo1skyy4yhejshhs9rv67fl2dswnlhk3mfugvr7sv","receiver":"bcna1606cfyw6q60umn9zvv5j77ds896r5wqsajy0af","timeout_height":{"revision_number":"1","revision_height":"371458"},"timeout_timestamp":"1635148630217372060"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}

confirm transaction before signing and broadcasting [y/N]: n
cancelled transaction
$ osmosisd tx ibc-transfer transfer transfer channel-51 bcna1606cfyw6q60umn9zvv5j77ds896r5wqsajy0af 1uosmo --from test
Enter keyring passphrase:
incorrect passphrase
Enter keyring passphrase:
{"body":{"messages":[{"@type":"/ibc.applications.transfer.v1.MsgTransfer","source_port":"transfer","source_channel":"channel-51","token":{"denom":"uosmo","amount":"1"},"sender":"osmo1skyy4yhejshhs9rv67fl2dswnlhk3mfugvr7sv","receiver":"bcna1606cfyw6q60umn9zvv5j77ds896r5wqsajy0af","timeout_height":{"revision_number":"1","revision_height":"371458"},"timeout_timestamp":"1635148630217372060"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}

confirm transaction before signing and broadcasting [y/N]: y

The TX timeout value was 14 minutes in the past
E[2021-10-25|08:12:10.254] - [bitcanna-1] -> err(rpc error: code = InvalidArgument desc = failed to execute message; message index: 1: receive packet verification failed: block timestamp >= packet timeout timestamp (2021-10-25 08:12:03.465933869 +0000 UTC >= 2021-10-25 07:57:10.21737206 +0000 UTC): packet timeout: invalid request)


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@RaulBernal
Copy link
Author

RaulBernal commented Oct 26, 2021

I'm relaying with go-relayer at this moment, but also happens with Hermes
and with TS relayer..

The timeout recalculate issue happens before I send the TX, if you see the
logs you can get the wrong timeout (I canceled the TX and tested with
another)

The way to avoid for me is to setup a script that raise a TX before the
10minutes (default timeout).

Other way to avoid is make the TX (even after of 10 minutes) with flag: --packet-timeout-timestamp 0 to disable the timeout function.

They Steps to reproduce are easy, don't need to send a TX, you can prepare but cancel the sending, so it don't touch the relayer:

$ osmosisd tx ibc-transfer transfer transfer channel-51 bcna1606cfyw6q60umn9zvv5j77ds896r5wqsajy0af 1uosmo --from test
Enter keyring passphrase:
{"body":{"messages":[{"@type":"/ibc.applications.transfer.v1.MsgTransfer","source_port":"transfer","source_channel":"channel-51","token":{"denom":"uosmo","amount":"1"},"sender":"osmo1skyy4yhejshhs9rv67fl2dswnlhk3mfugvr7sv","receiver":"bcna1606cfyw6q60umn9zvv5j77ds896r5wqsajy0af","timeout_height":{"revision_number":"1","revision_height":"371458"},"timeout_timestamp":"1635148630217372060"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}

confirm transaction before signing and broadcasting [y/N]: n
cancelled transaction

$ osmosisd tx ibc-transfer transfer transfer channel-51 bcna1606cfyw6q60umn9zvv5j77ds896r5wqsajy0af 1uosmo --from test
Enter keyring passphrase:
{"body":{"messages":[{"@type":"/ibc.applications.transfer.v1.MsgTransfer","source_port":"transfer","source_channel":"channel-51","token":{"denom":"uosmo","amount":"1"},"sender":"osmo1skyy4yhejshhs9rv67fl2dswnlhk3mfugvr7sv","receiver":"bcna1606cfyw6q60umn9zvv5j77ds896r5wqsajy0af","timeout_height":{"revision_number":"1","revision_height":"371458"},"timeout_timestamp":"1635148630217372060"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}

confirm transaction before signing and broadcasting [y/N]: n
cancelled transaction
$ osmosisd tx ibc-transfer transfer transfer channel-51 bcna1606cfyw6q60umn9zvv5j77ds896r5wqsajy0af 1uosmo --from test
Enter keyring passphrase:
incorrect passphrase
Enter keyring passphrase:
{"body":{"messages":[{"@type":"/ibc.applications.transfer.v1.MsgTransfer","source_port":"transfer","source_channel":"channel-51","token":{"denom":"uosmo","amount":"1"},"sender":"osmo1skyy4yhejshhs9rv67fl2dswnlhk3mfugvr7sv","receiver":"bcna1606cfyw6q60umn9zvv5j77ds896r5wqsajy0af","timeout_height":{"revision_number":"1","revision_height":"371458"},"timeout_timestamp":"1635148630217372060"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}

confirm transaction before signing and broadcasting [y/N]: y

@cwgoes
Copy link
Contributor

cwgoes commented Oct 26, 2021

Thank you for the bug report. Unless this is a mistake in the IBC specs, please file it on the implementation repo instead.

@RaulBernal
Copy link
Author

Opened in the proper repo:
cosmos/ibc-go#508

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants