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

Merged
merged 12 commits into from
Oct 3, 2024
Merged

Conversation

sebasti810
Copy link
Contributor

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
Contributor 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
Collaborator

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
Collaborator

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 0% with 9 lines in your changes missing coverage. Please review.

Project coverage is 46.44%. Comparing base (2469e7a) to head (517e864).
Report is 326 commits behind head on main.

Files with missing lines Patch % Lines
cmd/rpc.go 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3580      +/-   ##
==========================================
+ Coverage   44.83%   46.44%   +1.60%     
==========================================
  Files         265      314      +49     
  Lines       14620    18137    +3517     
==========================================
+ Hits         6555     8423    +1868     
- Misses       7313     8701    +1388     
- Partials      752     1013     +261     

☔ 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
Contributor 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
renaynay
renaynay previously approved these changes Oct 2, 2024
Wondertan
Wondertan previously approved these changes Oct 2, 2024
cristaloleg
cristaloleg previously approved these changes Oct 2, 2024
@renaynay renaynay dismissed vgonkivs’s stale review October 2, 2024 13:39

we need to morge now

@Wondertan Wondertan enabled auto-merge (squash) October 2, 2024 13:39
cmd/rpc.go Outdated Show resolved Hide resolved
@renaynay renaynay dismissed stale reviews from Wondertan, cristaloleg, and themself via f7bbb68 October 2, 2024 15:25
@cristaloleg cristaloleg disabled auto-merge October 2, 2024 15:46
@cristaloleg cristaloleg enabled auto-merge (squash) October 2, 2024 16:17
@cristaloleg cristaloleg disabled auto-merge October 3, 2024 08:32
@cristaloleg cristaloleg enabled auto-merge (squash) October 3, 2024 08:32
@cristaloleg cristaloleg merged commit 1c62d99 into celestiaorg:main Oct 3, 2024
31 checks passed
Copy link

gitpoap-bot bot commented Oct 3, 2024

Congrats, your important contribution to this open-source project has earned you a GitPOAP!

GitPOAP: 2024 Celestia Contributor:

GitPOAP: 2024 Celestia Contributor GitPOAP Badge

Head to gitpoap.io & connect your GitHub account to mint!

Learn more about GitPOAPs here.

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