-
Notifications
You must be signed in to change notification settings - Fork 919
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
feat(cmd): adding timeout flag #3580
base: main
Are you sure you want to change the base?
Conversation
does this time out the transaction in the mempool, or just in the client? |
just in the client. is it supposed to also set it for the mempool? |
I'm thinking of a case where I send transaction with nonce x, it times out, and then when I go to send another transaction, also with nonce x, it errors because it has the same nonce as the tx that is already timed out on client, but in the mempool |
But node does not support nonce so far. We agreed that's it is not necessary. |
This does not happen anymore - the nonce error was fixed by upgrading app :)
I don't think he's saying we need to support nonce, I think @jcstein was just describing that what happens with a nonce in the background was throwing errors to the user, and that a timeout for txs in the mempool could fix this. What if we add a timeout to |
I'd rather pass it through the context. |
Fair, I guess we can't have a timeout in the transaction itself that gets submitted, right? |
I don't want to grow the TxConfig. Timeout is smth we can configure through the context. |
😄 🚢
yeah, i was thinking of a case where the tx is timed out on client, but when user makes new tx, there is still error due to mempool. it sounds like the nonce upgrades fixed this though |
@jcstein Did you test this PR already? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3580 +/- ##
==========================================
+ Coverage 44.83% 45.51% +0.68%
==========================================
Files 265 274 +9
Lines 14620 15422 +802
==========================================
+ Hits 6555 7020 +465
- Misses 7313 7598 +285
- Partials 752 804 +52 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you describe how the user should interact with the flag? In what units the timeout should be passed, bc duration represents time in nanoseconds.?
007d9ea
@vgonkivs The flag docstring prints the usage, e.g. 30s, 1m. This is because pflag has a DurationVar option, which handles this parsing underneath. And it's tested, this is the output you get when the timeline is exceeded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @sebasti810!
Thank you for the contribution
fixes #3575