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

token-cli: Add confirm-tx timeout to RPC client #7484

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

joncinque
Copy link
Contributor

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.

#### 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(
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit: Seems reasonable to me. Is there a way for the client to override this default?

Copy link
Contributor Author

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

Copy link
Contributor

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@joncinque joncinque merged commit f3bd048 into solana-labs:master Nov 12, 2024
31 checks passed
@joncinque joncinque deleted the tkclitimeout branch November 12, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants