Browse Source

rm UDP TPU path from cli (#9092)

Alex Pyattaev 6 days ago
parent
commit
bb79fdb4e5

+ 0 - 13
cli/src/clap_app.rs

@@ -95,19 +95,6 @@ pub fn get_clap_app<'ab, 'v>(name: &str, about: &'ab str, version: &'v str) -> A
                 .global(true)
                 .global(true)
                 .help("Show additional information"),
                 .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("use_udp")
-                .long("use-udp")
-                .global(true)
-                .conflicts_with("use_quic")
-                .help("Use UDP when sending transactions."),
-        )
         .arg(
         .arg(
             Arg::with_name("use_tpu_client")
             Arg::with_name("use_tpu_client")
                 .long("use-tpu-client")
                 .long("use-tpu-client")

+ 3 - 7
cli/src/cli.rs

@@ -35,9 +35,7 @@ use {
     solana_signer::{Signer, SignerError},
     solana_signer::{Signer, SignerError},
     solana_stake_interface::{instruction::LockupArgs, state::Lockup},
     solana_stake_interface::{instruction::LockupArgs, state::Lockup},
     solana_tps_client::TpsClient,
     solana_tps_client::TpsClient,
-    solana_tpu_client::tpu_client::{
-        TpuClient, TpuClientConfig, DEFAULT_TPU_CONNECTION_POOL_SIZE, DEFAULT_TPU_ENABLE_UDP,
-    },
+    solana_tpu_client::tpu_client::{TpuClient, TpuClientConfig, DEFAULT_TPU_CONNECTION_POOL_SIZE},
     solana_transaction::versioned::VersionedTransaction,
     solana_transaction::versioned::VersionedTransaction,
     solana_transaction_error::TransactionError,
     solana_transaction_error::TransactionError,
     solana_vote_program::vote_state::VoteAuthorize,
     solana_vote_program::vote_state::VoteAuthorize,
@@ -540,7 +538,6 @@ pub struct CliConfig<'a> {
     pub send_transaction_config: RpcSendTransactionConfig,
     pub send_transaction_config: RpcSendTransactionConfig,
     pub confirm_transaction_initial_timeout: Duration,
     pub confirm_transaction_initial_timeout: Duration,
     pub address_labels: HashMap<String, String>,
     pub address_labels: HashMap<String, String>,
-    pub use_quic: bool,
     pub use_tpu_client: bool,
     pub use_tpu_client: bool,
 }
 }
 
 
@@ -589,7 +586,6 @@ impl Default for CliConfig<'_> {
                 u64::from_str(DEFAULT_CONFIRM_TX_TIMEOUT_SECONDS).unwrap(),
                 u64::from_str(DEFAULT_CONFIRM_TX_TIMEOUT_SECONDS).unwrap(),
             ),
             ),
             address_labels: HashMap::new(),
             address_labels: HashMap::new(),
-            use_quic: !DEFAULT_TPU_ENABLE_UDP,
             use_tpu_client: DEFAULT_PING_USE_TPU_CLIENT,
             use_tpu_client: DEFAULT_PING_USE_TPU_CLIENT,
         }
         }
     }
     }
@@ -951,7 +947,7 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
                 #[cfg(feature = "dev-context-only-utils")]
                 #[cfg(feature = "dev-context-only-utils")]
                 let connection_cache = create_connection_cache_for_tests(
                 let connection_cache = create_connection_cache_for_tests(
                     DEFAULT_TPU_CONNECTION_POOL_SIZE,
                     DEFAULT_TPU_CONNECTION_POOL_SIZE,
-                    config.use_quic,
+                    true,
                     "127.0.0.1".parse().unwrap(),
                     "127.0.0.1".parse().unwrap(),
                     Some(&keypair),
                     Some(&keypair),
                     rpc_client.clone(),
                     rpc_client.clone(),
@@ -959,7 +955,7 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
                 #[cfg(not(feature = "dev-context-only-utils"))]
                 #[cfg(not(feature = "dev-context-only-utils"))]
                 let connection_cache = create_connection_cache(
                 let connection_cache = create_connection_cache(
                     DEFAULT_TPU_CONNECTION_POOL_SIZE,
                     DEFAULT_TPU_CONNECTION_POOL_SIZE,
-                    config.use_quic,
+                    true,
                     "127.0.0.1".parse().unwrap(),
                     "127.0.0.1".parse().unwrap(),
                     Some(&keypair),
                     Some(&keypair),
                     rpc_client.clone(),
                     rpc_client.clone(),

+ 0 - 10
cli/src/main.rs

@@ -17,7 +17,6 @@ use {
     },
     },
     solana_remote_wallet::remote_wallet::RemoteWalletManager,
     solana_remote_wallet::remote_wallet::RemoteWalletManager,
     solana_rpc_client_api::config::RpcSendTransactionConfig,
     solana_rpc_client_api::config::RpcSendTransactionConfig,
-    solana_tpu_client::tpu_client::DEFAULT_TPU_ENABLE_UDP,
     std::{collections::HashMap, error, path::PathBuf, rc::Rc, time::Duration},
     std::{collections::HashMap, error, path::PathBuf, rc::Rc, time::Duration},
 };
 };
 
 
@@ -201,14 +200,6 @@ pub fn parse_args<'a>(
         config.address_labels
         config.address_labels
     };
     };
 
 
-    let use_quic = if matches.is_present("use_quic") {
-        true
-    } else if matches.is_present("use_udp") {
-        false
-    } else {
-        !DEFAULT_TPU_ENABLE_UDP
-    };
-
     let skip_preflight = matches.is_present("skip_preflight");
     let skip_preflight = matches.is_present("skip_preflight");
 
 
     let use_tpu_client = matches.is_present("use_tpu_client");
     let use_tpu_client = matches.is_present("use_tpu_client");
@@ -232,7 +223,6 @@ pub fn parse_args<'a>(
             },
             },
             confirm_transaction_initial_timeout,
             confirm_transaction_initial_timeout,
             address_labels,
             address_labels,
-            use_quic,
             use_tpu_client,
             use_tpu_client,
         },
         },
         signers,
         signers,

+ 1 - 3
cli/src/program.rs

@@ -3212,15 +3212,13 @@ fn send_deploy_messages(
                 }
                 }
             }
             }
 
 
-            let connection_cache = if config.use_quic {
+            let connection_cache = {
                 #[cfg(feature = "dev-context-only-utils")]
                 #[cfg(feature = "dev-context-only-utils")]
                 let cache =
                 let cache =
                     ConnectionCache::new_quic_for_tests("connection_cache_cli_program_quic", 1);
                     ConnectionCache::new_quic_for_tests("connection_cache_cli_program_quic", 1);
                 #[cfg(not(feature = "dev-context-only-utils"))]
                 #[cfg(not(feature = "dev-context-only-utils"))]
                 let cache = ConnectionCache::new_quic("connection_cache_cli_program_quic", 1);
                 let cache = ConnectionCache::new_quic("connection_cache_cli_program_quic", 1);
                 cache
                 cache
-            } else {
-                ConnectionCache::with_udp("connection_cache_cli_program_udp", 1)
             };
             };
             let transaction_errors = match connection_cache {
             let transaction_errors = match connection_cache {
                 ConnectionCache::Udp(cache) => TpuClient::new_with_connection_cache(
                 ConnectionCache::Udp(cache) => TpuClient::new_with_connection_cache(

+ 1 - 3
cli/src/program_v4.rs

@@ -1211,14 +1211,12 @@ fn send_messages(
     }
     }
 
 
     if !write_messages.is_empty() {
     if !write_messages.is_empty() {
-        let connection_cache = if config.use_quic {
+        let connection_cache = {
             #[cfg(feature = "dev-context-only-utils")]
             #[cfg(feature = "dev-context-only-utils")]
             let cache = ConnectionCache::new_quic_for_tests("connection_cache_cli_program_quic", 1);
             let cache = ConnectionCache::new_quic_for_tests("connection_cache_cli_program_quic", 1);
             #[cfg(not(feature = "dev-context-only-utils"))]
             #[cfg(not(feature = "dev-context-only-utils"))]
             let cache = ConnectionCache::new_quic("connection_cache_cli_program_quic", 1);
             let cache = ConnectionCache::new_quic("connection_cache_cli_program_quic", 1);
             cache
             cache
-        } else {
-            ConnectionCache::with_udp("connection_cache_cli_program_v4_udp", 1)
         };
         };
         let transaction_errors = match connection_cache {
         let transaction_errors = match connection_cache {
             ConnectionCache::Udp(cache) => TpuClient::new_with_connection_cache(
             ConnectionCache::Udp(cache) => TpuClient::new_with_connection_cache(

+ 0 - 16
validator/src/cli.rs

@@ -156,22 +156,6 @@ fn deprecated_arguments() -> Vec<DeprecatedArg> {
             .help("Milliseconds to wait in the TPU receiver for packet coalescing."),
             .help("Milliseconds to wait in the TPU receiver for packet coalescing."),
             usage_warning:"tpu_coalesce will be dropped (currently ignored)",
             usage_warning:"tpu_coalesce will be dropped (currently ignored)",
     );
     );
-    add_arg!(
-        // deprecated in v3.0.0
-        Arg::with_name("tpu_disable_quic")
-            .long("tpu-disable-quic")
-            .takes_value(false)
-            .help("Do not use QUIC to send transactions."),
-        usage_warning: "UDP support will be dropped"
-    );
-    add_arg!(
-        // deprecated in v3.0.0
-        Arg::with_name("tpu_enable_udp")
-            .long("tpu-enable-udp")
-            .takes_value(false)
-            .help("Enable UDP for receiving/sending transactions."),
-        usage_warning: "UDP support will be dropped"
-    );
     add_arg!(
     add_arg!(
         // deprecated in v3.1.0
         // deprecated in v3.1.0
         Arg::with_name("transaction_struct")
         Arg::with_name("transaction_struct")

+ 1 - 8
validator/src/commands/run/execute.rs

@@ -260,13 +260,6 @@ pub fn execute(
     let restricted_repair_only_mode = matches.is_present("restricted_repair_only_mode");
     let restricted_repair_only_mode = matches.is_present("restricted_repair_only_mode");
     let accounts_shrink_optimize_total_space =
     let accounts_shrink_optimize_total_space =
         value_t_or_exit!(matches, "accounts_shrink_optimize_total_space", bool);
         value_t_or_exit!(matches, "accounts_shrink_optimize_total_space", bool);
-    let tpu_use_quic = !matches.is_present("tpu_disable_quic");
-    if !tpu_use_quic {
-        warn!(
-            "TPU QUIC was disabled via --tpu_disable_quic, this will prevent validator from \
-             receiving transactions!"
-        );
-    }
     let vote_use_quic = value_t_or_exit!(matches, "vote_use_quic", bool);
     let vote_use_quic = value_t_or_exit!(matches, "vote_use_quic", bool);
 
 
     let tpu_enable_udp = if matches.is_present("tpu_enable_udp") {
     let tpu_enable_udp = if matches.is_present("tpu_enable_udp") {
@@ -1023,7 +1016,7 @@ pub fn execute(
         start_progress,
         start_progress,
         run_args.socket_addr_space,
         run_args.socket_addr_space,
         ValidatorTpuConfig {
         ValidatorTpuConfig {
-            use_quic: tpu_use_quic,
+            use_quic: true,
             vote_use_quic,
             vote_use_quic,
             tpu_connection_pool_size,
             tpu_connection_pool_size,
             tpu_enable_udp,
             tpu_enable_udp,