Make tpu_use_quic a flag only without argument (#24018) (#24027)

(cherry picked from commit 98525ddea9)

Co-authored-by: Lijun Wang <83639177+lijunwangs@users.noreply.github.com>
This commit is contained in:
mergify[bot]
2022-04-13 13:00:49 -06:00
committed by GitHub
parent d48e9b3a7b
commit 9aa95870fa

View File

@ -9,7 +9,6 @@ use {
console::style,
log::*,
rand::{seq::SliceRandom, thread_rng},
send_transaction_service::DEFAULT_TPU_USE_QUIC,
solana_clap_utils::{
input_parsers::{keypair_of, keypairs_of, pubkey_of, value_of},
input_validators::{
@ -455,7 +454,6 @@ pub fn main() {
let default_accounts_shrink_ratio = &DEFAULT_ACCOUNTS_SHRINK_RATIO.to_string();
let default_rocksdb_fifo_shred_storage_size =
&DEFAULT_ROCKS_FIFO_SHRED_STORAGE_SIZE_BYTES.to_string();
let default_tpu_use_quic = &DEFAULT_TPU_USE_QUIC.to_string();
let matches = App::new(crate_name!()).about(crate_description!())
.version(solana_version::version!())
@ -1147,9 +1145,7 @@ pub fn main() {
.arg(
Arg::with_name("tpu_use_quic")
.long("tpu-use-quic")
.takes_value(true)
.value_name("BOOLEAN")
.default_value(default_tpu_use_quic)
.takes_value(false)
.help("When this is set to true, the system will use QUIC to send transactions."),
)
.arg(
@ -2103,7 +2099,7 @@ pub fn main() {
let restricted_repair_only_mode = matches.is_present("restricted_repair_only_mode");
let accounts_shrink_optimize_total_space =
value_t_or_exit!(matches, "accounts_shrink_optimize_total_space", bool);
let tpu_use_quic = value_t_or_exit!(matches, "tpu_use_quic", bool);
let tpu_use_quic = matches.is_present("tpu_use_quic");
let shrink_ratio = value_t_or_exit!(matches, "accounts_shrink_ratio", f64);
if !(0.0..=1.0).contains(&shrink_ratio) {