Use rooted bank by default in rpc bank selection (#6759)
* Name anonymous parameters for clarity * Add CommitmentConfig to select bank for rpc * Add commitment information to jsonrpc docs * Update send_and_confirm retries as per commitment defaults * Pass CommitmentConfig into client requests; also various 'use' cleanup * Use _with_commitment methods to speed local_cluster tests * Pass CommitmentConfig into Archiver in order to enable quick confirmations in local_cluster tests * Restore solana ping speed * Increase wallet-sanity timeout to account for longer confirmation time
This commit is contained in:
@@ -11,6 +11,7 @@ use serde_json::Value;
|
||||
use solana_client::{rpc_client::RpcClient, rpc_request::RpcVoteAccountInfo};
|
||||
use solana_sdk::{
|
||||
clock,
|
||||
commitment_config::CommitmentConfig,
|
||||
hash::Hash,
|
||||
signature::{Keypair, KeypairUtil},
|
||||
system_transaction,
|
||||
@@ -72,7 +73,7 @@ impl ClusterQuerySubCommands for App<'_, '_> {
|
||||
.long("timeout")
|
||||
.value_name("SECONDS")
|
||||
.takes_value(true)
|
||||
.default_value("10")
|
||||
.default_value("15")
|
||||
.help("Wait up to timeout seconds for transaction confirmation"),
|
||||
),
|
||||
)
|
||||
@@ -221,7 +222,10 @@ pub fn process_ping(
|
||||
Ok(signature) => {
|
||||
let transaction_sent = Instant::now();
|
||||
loop {
|
||||
let signature_status = rpc_client.get_signature_status(&signature)?;
|
||||
let signature_status = rpc_client.get_signature_status_with_commitment(
|
||||
&signature,
|
||||
CommitmentConfig::recent(),
|
||||
)?;
|
||||
let elapsed_time = Instant::now().duration_since(transaction_sent);
|
||||
if let Some(transaction_status) = signature_status {
|
||||
match transaction_status {
|
||||
|
@@ -11,11 +11,14 @@ use serde_derive::{Deserialize, Serialize};
|
||||
use serde_json::{Map, Value};
|
||||
use solana_client::rpc_client::RpcClient;
|
||||
use solana_config_api::{config_instruction, get_config_data, ConfigKeys, ConfigState};
|
||||
use solana_sdk::account::Account;
|
||||
use solana_sdk::message::Message;
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
use solana_sdk::signature::{Keypair, KeypairUtil};
|
||||
use solana_sdk::transaction::Transaction;
|
||||
use solana_sdk::{
|
||||
account::Account,
|
||||
commitment_config::CommitmentConfig,
|
||||
message::Message,
|
||||
pubkey::Pubkey,
|
||||
signature::{Keypair, KeypairUtil},
|
||||
transaction::Transaction,
|
||||
};
|
||||
use std::error;
|
||||
|
||||
pub const MAX_SHORT_FIELD_LENGTH: usize = 70;
|
||||
@@ -297,7 +300,9 @@ pub fn process_set_validator_info(
|
||||
};
|
||||
|
||||
// Check existence of validator-info account
|
||||
let balance = rpc_client.poll_get_balance(&info_pubkey).unwrap_or(0);
|
||||
let balance = rpc_client
|
||||
.poll_get_balance_with_commitment(&info_pubkey, CommitmentConfig::default())
|
||||
.unwrap_or(0);
|
||||
|
||||
let keys = vec![(id(), false), (config.keypair.pubkey(), true)];
|
||||
let (message, signers): (Message, Vec<&Keypair>) = if balance == 0 {
|
||||
|
Reference in New Issue
Block a user