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

feat(cmd): adding timeout flag #3580

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

sebasti810
Copy link

fixes #3575

@github-actions github-actions bot added the external Issues created by non node team members label Jul 19, 2024
@sebasti810 sebasti810 changed the title fix: 3575 feat(cmd): adding timeout flag Jul 19, 2024
@vgonkivs vgonkivs requested a review from jcstein July 19, 2024 12:32
@jcstein
Copy link
Member

jcstein commented Jul 19, 2024

does this time out the transaction in the mempool, or just in the client?

@sebasti810
Copy link
Author

just in the client. is it supposed to also set it for the mempool?

@jcstein
Copy link
Member

jcstein commented Jul 19, 2024

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

@vgonkivs
Copy link
Member

But node does not support nonce so far. We agreed that's it is not necessary.

@distractedm1nd
Copy link
Member

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

This does not happen anymore - the nonce error was fixed by upgrading app :)

But node does not support nonce so far. We agreed that's it is not necessary.

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 TxConfig in a separate issue?

@vgonkivs
Copy link
Member

I'd rather pass it through the context.

@distractedm1nd
Copy link
Member

Fair, I guess we can't have a timeout in the transaction itself that gets submitted, right?

@vgonkivs
Copy link
Member

I don't want to grow the TxConfig. Timeout is smth we can configure through the context.
wdyt @distractedm1nd ?

@jcstein
Copy link
Member

jcstein commented Jul 19, 2024

This does not happen anymore - the nonce error was fixed by upgrading app :)

😄 🚢

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.

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

@ramin ramin added the kind:feat Attached to feature PRs label Jul 21, 2024
@renaynay
Copy link
Member

@jcstein Did you test this PR already?

renaynay
renaynay previously approved these changes Aug 13, 2024
cristaloleg
cristaloleg previously approved these changes Aug 13, 2024
@codecov-commenter
Copy link

codecov-commenter commented Aug 13, 2024

Codecov Report

Attention: Patch coverage is 51.61290% with 15 lines in your changes missing coverage. Please review.

Project coverage is 45.51%. Comparing base (2469e7a) to head (007d9ea).
Report is 162 commits behind head on main.

Files Patch % Lines
cmd/rpc.go 0.00% 10 Missing ⚠️
api/rpc/client/client.go 76.19% 4 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

walldiss
walldiss previously approved these changes Aug 13, 2024
Copy link
Member

@vgonkivs vgonkivs left a 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.?

@sebasti810
Copy link
Author

@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
image

@jcstein
Copy link
Member

jcstein commented Aug 23, 2024

@jcstein Did you test this PR already?

@renaynay just saw this, no I haven't tested it yet

Copy link
Member

@Wondertan Wondertan left a 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

cmd/rpc.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external Issues created by non node team members kind:feat Attached to feature PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

improvement(cmd): add timeout flag
10 participants