-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
CLI with --no-wait doesn't retry #9400
Milestone
Comments
This was referenced May 11, 2020
Closing this. Only remaining related work is for the RPC node to retry on behalf of the |
This was referenced Dec 14, 2023
This was referenced Jan 1, 2024
This was referenced Mar 16, 2024
This was referenced Oct 15, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
Using the
--no-wait
option with the CLI doesn't retry sending the transaction, which pushes that complexity onto the caller. Specifically, it requires them to get a recent blockhash viasolana fees
and then guessing how long it can retry before that blockhash expires. Furthermore, the naive implementation would probably retry every ~100ms instead of doing exponential backoff to minimize network congestion.Proposed Solution 1
Add a new option
--confirmations=<NUMBER>
that is mutually exclusive with--no-wait
. NUMBER should be a number between 0 and 32, and should be the number of confirmations the CLI blocks on before exiting. If NUMBER is 0, it should only block until the transaction has been "accepted". That is, wait until the validator observes the transaction on the ledger; don't wait for a supermajority vote.While waiting for the transaction to be accepted, the CLI should send retries until the blockhash is expired. The retry algorithm should use exponential backoff, à la TCP. The CLI should not attempt to update the blockhash and re-sign.
Proposed Solution 2
Add two new CLI commands, such that the user can do retries:
solana recent-blockhash
, prints a base58 blockhash.solana check-blockhash <BLOCKHASH>
, returns 0 if the blockhash is found, and otherwise 1.Leaning heavily toward Proposal 1, but might want to implement the new commands in Proposal 2 for completeness.
cc: @mvines @CriesofCarrots @aeyakovenko
The text was updated successfully, but these errors were encountered: