Revert "Enable QUIC client by default. Add arg to disable QUIC client… (#26913)
Revert "Enable QUIC client by default. Add arg to disable QUIC client. (#26879)"
This reverts commit 4c29750095
.
This commit is contained in:
parent
83a0f5da0f
commit
0f4b858224
|
@ -214,10 +214,10 @@ fn main() {
|
||||||
.help("Number of threads to use in the banking stage"),
|
.help("Number of threads to use in the banking stage"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("tpu_disable_quic")
|
Arg::new("tpu_use_quic")
|
||||||
.long("tpu-disable-quic")
|
.long("tpu-use-quic")
|
||||||
.takes_value(false)
|
.takes_value(false)
|
||||||
.help("Disable forwarding messages to TPU using QUIC"),
|
.help("Forward messages to TPU using QUIC"),
|
||||||
)
|
)
|
||||||
.get_matches();
|
.get_matches();
|
||||||
|
|
||||||
|
|
|
@ -290,10 +290,10 @@ pub fn build_args<'a, 'b>(version: &'b str) -> App<'a, 'b> {
|
||||||
.help("Submit transactions with a TpuClient")
|
.help("Submit transactions with a TpuClient")
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("tpu_disable_quic")
|
Arg::with_name("tpu_use_quic")
|
||||||
.long("tpu-disable-quic")
|
.long("tpu-use-quic")
|
||||||
.takes_value(false)
|
.takes_value(false)
|
||||||
.help("Do not submit transactions via QUIC; only affects ThinClient (default) \
|
.help("Submit transactions via QUIC; only affects ThinClient (default) \
|
||||||
or TpuClient sends"),
|
or TpuClient sends"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
|
@ -348,8 +348,8 @@ pub fn extract_args(matches: &ArgMatches) -> Config {
|
||||||
args.external_client_type = ExternalClientType::RpcClient;
|
args.external_client_type = ExternalClientType::RpcClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
if matches.is_present("tpu_disable_quic") {
|
if matches.is_present("tpu_use_quic") {
|
||||||
args.use_quic = false;
|
args.use_quic = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(v) = matches.value_of("tpu_connection_pool_size") {
|
if let Some(v) = matches.value_of("tpu_connection_pool_size") {
|
||||||
|
|
|
@ -32,7 +32,7 @@ static MAX_CONNECTIONS: usize = 1024;
|
||||||
|
|
||||||
/// Used to decide whether the TPU and underlying connection cache should use
|
/// Used to decide whether the TPU and underlying connection cache should use
|
||||||
/// QUIC connections.
|
/// QUIC connections.
|
||||||
pub const DEFAULT_TPU_USE_QUIC: bool = true;
|
pub const DEFAULT_TPU_USE_QUIC: bool = false;
|
||||||
|
|
||||||
/// Default TPU connection pool size per remote address
|
/// Default TPU connection pool size per remote address
|
||||||
pub const DEFAULT_TPU_CONNECTION_POOL_SIZE: usize = 4;
|
pub const DEFAULT_TPU_CONNECTION_POOL_SIZE: usize = 4;
|
||||||
|
@ -683,11 +683,6 @@ mod tests {
|
||||||
// be lazy and not connect until first use or handle connection errors somehow
|
// be lazy and not connect until first use or handle connection errors somehow
|
||||||
// (without crashing, as would be required in a real practical validator)
|
// (without crashing, as would be required in a real practical validator)
|
||||||
let connection_cache = ConnectionCache::default();
|
let connection_cache = ConnectionCache::default();
|
||||||
let port_offset = if connection_cache.use_quic() {
|
|
||||||
QUIC_PORT_OFFSET
|
|
||||||
} else {
|
|
||||||
0
|
|
||||||
};
|
|
||||||
let addrs = (0..MAX_CONNECTIONS)
|
let addrs = (0..MAX_CONNECTIONS)
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|_| {
|
.map(|_| {
|
||||||
|
@ -700,29 +695,18 @@ mod tests {
|
||||||
let map = connection_cache.map.read().unwrap();
|
let map = connection_cache.map.read().unwrap();
|
||||||
assert!(map.len() == MAX_CONNECTIONS);
|
assert!(map.len() == MAX_CONNECTIONS);
|
||||||
addrs.iter().for_each(|a| {
|
addrs.iter().for_each(|a| {
|
||||||
let port = a
|
let conn = &map.get(a).expect("Address not found").connections[0];
|
||||||
.port()
|
let conn = conn.new_blocking_connection(*a, connection_cache.stats.clone());
|
||||||
.checked_add(port_offset)
|
assert!(a.ip() == conn.tpu_addr().ip());
|
||||||
.unwrap_or_else(|| a.port());
|
|
||||||
let addr = &SocketAddr::new(a.ip(), port);
|
|
||||||
|
|
||||||
let conn = &map.get(addr).expect("Address not found").connections[0];
|
|
||||||
let conn = conn.new_blocking_connection(*addr, connection_cache.stats.clone());
|
|
||||||
assert!(addr.ip() == conn.tpu_addr().ip());
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
let addr = &get_addr(&mut rng);
|
let addr = get_addr(&mut rng);
|
||||||
connection_cache.get_connection(addr);
|
connection_cache.get_connection(&addr);
|
||||||
|
|
||||||
let port = addr
|
|
||||||
.port()
|
|
||||||
.checked_add(port_offset)
|
|
||||||
.unwrap_or_else(|| addr.port());
|
|
||||||
let addr_with_quic_port = SocketAddr::new(addr.ip(), port);
|
|
||||||
let map = connection_cache.map.read().unwrap();
|
let map = connection_cache.map.read().unwrap();
|
||||||
assert!(map.len() == MAX_CONNECTIONS);
|
assert!(map.len() == MAX_CONNECTIONS);
|
||||||
let _conn = map.get(&addr_with_quic_port).expect("Address not found");
|
let _conn = map.get(&addr).expect("Address not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -248,6 +248,7 @@ mod tests {
|
||||||
"--valid-signatures",
|
"--valid-signatures",
|
||||||
"--num-signatures",
|
"--num-signatures",
|
||||||
"8",
|
"8",
|
||||||
|
"--tpu-use-quic",
|
||||||
"--send-batch-size",
|
"--send-batch-size",
|
||||||
"1",
|
"1",
|
||||||
])
|
])
|
||||||
|
|
|
@ -61,7 +61,7 @@ while [[ -n $1 ]]; do
|
||||||
elif [[ $1 = --enable-rpc-bigtable-ledger-storage ]]; then
|
elif [[ $1 = --enable-rpc-bigtable-ledger-storage ]]; then
|
||||||
args+=("$1")
|
args+=("$1")
|
||||||
shift
|
shift
|
||||||
elif [[ $1 = --tpu-disable-quic ]]; then
|
elif [[ $1 = --tpu-use-quic ]]; then
|
||||||
args+=("$1")
|
args+=("$1")
|
||||||
shift
|
shift
|
||||||
elif [[ $1 = --rpc-send-batch-ms ]]; then
|
elif [[ $1 = --rpc-send-batch-ms ]]; then
|
||||||
|
|
|
@ -1213,16 +1213,8 @@ pub fn main() {
|
||||||
Arg::with_name("tpu_use_quic")
|
Arg::with_name("tpu_use_quic")
|
||||||
.long("tpu-use-quic")
|
.long("tpu-use-quic")
|
||||||
.takes_value(false)
|
.takes_value(false)
|
||||||
.hidden(true)
|
|
||||||
.conflicts_with("tpu_disable_quic")
|
|
||||||
.help("Use QUIC to send transactions."),
|
.help("Use QUIC to send transactions."),
|
||||||
)
|
)
|
||||||
.arg(
|
|
||||||
Arg::with_name("tpu_disable_quic")
|
|
||||||
.long("tpu-disable-quic")
|
|
||||||
.takes_value(false)
|
|
||||||
.help("Do not use QUIC to send transactions."),
|
|
||||||
)
|
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("disable_quic_servers")
|
Arg::with_name("disable_quic_servers")
|
||||||
.long("disable-quic-servers")
|
.long("disable-quic-servers")
|
||||||
|
@ -2322,7 +2314,7 @@ pub fn main() {
|
||||||
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");
|
let tpu_use_quic = matches.is_present("tpu_use_quic");
|
||||||
let enable_quic_servers = !matches.is_present("disable_quic_servers");
|
let enable_quic_servers = !matches.is_present("disable_quic_servers");
|
||||||
let tpu_connection_pool_size = value_t_or_exit!(matches, "tpu_connection_pool_size", usize);
|
let tpu_connection_pool_size = value_t_or_exit!(matches, "tpu_connection_pool_size", usize);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue