-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
token-cli: Add confirm-tx timeout to RPC client #7484
Conversation
#### Problem As noticed with solana-labs#7456, a transaction with a nonced blockhash fails to confirm even though it works. This might be because of the confirmation logic in the RPC client, which looks for the provided blockhash: https://github.com/anza-xyz/agave/blob/b46c87ea538a1508ed4ae36f8dbf6c75dd57c883/rpc-client/src/nonblocking/rpc_client.rs#L1090 #### Summary of changes Specify a default transaction confirmation timeout.
@@ -97,9 +100,11 @@ impl<'a> Config<'a> { | |||
.unwrap_or(&cli_config.json_rpc_url), | |||
); | |||
let websocket_url = solana_cli_config::Config::compute_websocket_url(&json_rpc_url); | |||
let rpc_client = Arc::new(RpcClient::new_with_commitment( |
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.
What is the old behavior when these default timeouts are not set?
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.
30 seconds for rpc (which is what this PR uses), and none
for the other one, which is why I thought it was the issue
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.
Looking at the code, does at none
effectively mean we have a timeout of zero, i.e. we'll only check once and never check again for transaction confirmation?
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.
Correct
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.
Seems reasonable to me. Is there a way for the client to override this default?
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.
Not with this PR. I wanted to keep it simple here, and only add a command-line arg if anyone ever needs it in the future
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.
Problem
As noticed with #7456, a transaction with a nonced blockhash fails to confirm even though it works.
This might be because of the confirmation logic in the RPC client, which looks for the provided blockhash:
https://github.com/anza-xyz/agave/blob/b46c87ea538a1508ed4ae36f8dbf6c75dd57c883/rpc-client/src/nonblocking/rpc_client.rs#L1090
Summary of changes
Specify a default transaction confirmation timeout.