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:
@ -10,6 +10,7 @@
|
||||
use crate::{
|
||||
account::Account,
|
||||
clock::Slot,
|
||||
commitment_config::CommitmentConfig,
|
||||
fee_calculator::FeeCalculator,
|
||||
hash::Hash,
|
||||
instruction::Instruction,
|
||||
@ -44,24 +45,60 @@ pub trait SyncClient {
|
||||
/// Get an account or None if not found.
|
||||
fn get_account(&self, pubkey: &Pubkey) -> Result<Option<Account>>;
|
||||
|
||||
/// Get an account or None if not found. Uses explicit commitment configuration.
|
||||
fn get_account_with_commitment(
|
||||
&self,
|
||||
pubkey: &Pubkey,
|
||||
commitment_config: CommitmentConfig,
|
||||
) -> Result<Option<Account>>;
|
||||
|
||||
/// Get account balance or 0 if not found.
|
||||
fn get_balance(&self, pubkey: &Pubkey) -> Result<u64>;
|
||||
|
||||
/// Get account balance or 0 if not found. Uses explicit commitment configuration.
|
||||
fn get_balance_with_commitment(
|
||||
&self,
|
||||
pubkey: &Pubkey,
|
||||
commitment_config: CommitmentConfig,
|
||||
) -> Result<u64>;
|
||||
|
||||
/// Get recent blockhash
|
||||
fn get_recent_blockhash(&self) -> Result<(Hash, FeeCalculator)>;
|
||||
|
||||
/// Get recent blockhash. Uses explicit commitment configuration.
|
||||
fn get_recent_blockhash_with_commitment(
|
||||
&self,
|
||||
commitment_config: CommitmentConfig,
|
||||
) -> Result<(Hash, FeeCalculator)>;
|
||||
|
||||
/// Get signature status.
|
||||
fn get_signature_status(
|
||||
&self,
|
||||
signature: &Signature,
|
||||
) -> Result<Option<transaction::Result<()>>>;
|
||||
|
||||
/// Get signature status. Uses explicit commitment configuration.
|
||||
fn get_signature_status_with_commitment(
|
||||
&self,
|
||||
signature: &Signature,
|
||||
commitment_config: CommitmentConfig,
|
||||
) -> Result<Option<transaction::Result<()>>>;
|
||||
|
||||
/// Get last known slot
|
||||
fn get_slot(&self) -> Result<Slot>;
|
||||
|
||||
/// Get last known slot. Uses explicit commitment configuration.
|
||||
fn get_slot_with_commitment(&self, commitment_config: CommitmentConfig) -> Result<u64>;
|
||||
|
||||
/// Get transaction count
|
||||
fn get_transaction_count(&self) -> Result<u64>;
|
||||
|
||||
/// Get transaction count. Uses explicit commitment configuration.
|
||||
fn get_transaction_count_with_commitment(
|
||||
&self,
|
||||
commitment_config: CommitmentConfig,
|
||||
) -> Result<u64>;
|
||||
|
||||
/// Poll until the signature has been confirmed by at least `min_confirmed_blocks`
|
||||
fn poll_for_signature_confirmation(
|
||||
&self,
|
||||
|
Reference in New Issue
Block a user