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

broadcast_tx poll and timeout ? #88

Closed
daeMOn63 opened this issue Feb 11, 2022 · 3 comments
Closed

broadcast_tx poll and timeout ? #88

daeMOn63 opened this issue Feb 11, 2022 · 3 comments
Assignees

Comments

@daeMOn63
Copy link
Contributor

Currently, broadcast_tx is auto-fetching the tx receipt after some configurable sleep time and this seems to raise some issues:

  • the sleep time can't be 0 or anything below the avg block time or tx will just be reported as failed
  • the sleep time value is dependent on the network activity. On a quiet day, tx will land on the first block and 10 seconds will do, on a busier day it might take a couple of blocks before being included

Might improve things to have either:

  • a poll & timeout strategy here similar to cosmjs so that it retries to pull the receipt every 3 seconds or so, and timeout if it didn't succeed after 60 seconds. This might also be some settings great to have exposed on higher-level API / client parameters as defaults are quite a network dependant?
  • let broadcast_tx return the tx hash and have another endpoint to poll for receipt (I'm thinking of uses cases where we don't really care about the receipt and just need to fire txs fast)

Also worth noting that the tx receipt might also include another error code field, which might be non-zero if the tx failed (even if broadcast reported a code = 0 earlier), maybe we'll want to test this out as well and raise on error, rather than leaving it to the user?

@5A11
Copy link
Member

5A11 commented Aug 11, 2022

PR #239

1 similar comment
@5A11
Copy link
Member

5A11 commented Aug 11, 2022

PR #239

@5A11
Copy link
Member

5A11 commented Aug 16, 2022

This is now in

@5A11 5A11 closed this as completed Aug 16, 2022
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

3 participants