diff --git a/cli/src/clap_app.rs b/cli/src/clap_app.rs index 1760b5161783f2..176828e7fe7cec 100644 --- a/cli/src/clap_app.rs +++ b/cli/src/clap_app.rs @@ -84,6 +84,12 @@ pub fn get_clap_app<'ab, 'v>(name: &str, about: &'ab str, version: &'v str) -> A .global(true) .help("Show additional information"), ) + .arg( + Arg::with_name("use_quic") + .long("use-quic") + .global(true) + .help("Use QUIC when sending transactions."), + ) .arg( Arg::with_name("no_address_labels") .long("no-address-labels") diff --git a/cli/src/cli.rs b/cli/src/cli.rs index c4c9f4b3c0b745..e64398396cca4f 100644 --- a/cli/src/cli.rs +++ b/cli/src/cli.rs @@ -502,6 +502,7 @@ pub struct CliConfig<'a> { pub send_transaction_config: RpcSendTransactionConfig, pub confirm_transaction_initial_timeout: Duration, pub address_labels: HashMap, + pub use_quic: bool, } impl CliConfig<'_> { @@ -549,6 +550,7 @@ impl Default for CliConfig<'_> { u64::from_str(DEFAULT_CONFIRM_TX_TIMEOUT_SECONDS).unwrap(), ), address_labels: HashMap::new(), + use_quic: false, } } } diff --git a/cli/src/main.rs b/cli/src/main.rs index acb8df54312fd2..58733cf0b65e06 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -202,6 +202,8 @@ pub fn parse_args<'a>( config.address_labels }; + let use_quic = matches.is_present("use_quic"); + Ok(( CliConfig { command, @@ -220,6 +222,7 @@ pub fn parse_args<'a>( }, confirm_transaction_initial_timeout, address_labels, + use_quic, }, signers, )) diff --git a/cli/src/program.rs b/cli/src/program.rs index 72016db9e9f8ec..add485fb6f9a52 100644 --- a/cli/src/program.rs +++ b/cli/src/program.rs @@ -2226,7 +2226,11 @@ fn send_deploy_messages( if let Some(write_messages) = write_messages { if let Some(write_signer) = write_signer { trace!("Writing program data"); - let connection_cache = Arc::new(ConnectionCache::default()); + let connection_cache = if config.use_quic { + Arc::new(ConnectionCache::new(1)) + } else { + Arc::new(ConnectionCache::with_udp(1)) + }; let tpu_client = TpuClient::new_with_connection_cache( rpc_client.clone(), &config.websocket_url,