change default `bench-tps` client to `tpu-client` (#35335)

* change default bench-tps client to tpu-client

* remote client default to tpu-client

* add --use-tpu-client back in. hide --use-thin-client

* address nit, inform of future thinclient deprecation
This commit is contained in:
Greg Cusack 2024-02-28 12:30:24 -08:00 committed by GitHub
parent 140818221c
commit 98ec72e6ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 38 additions and 24 deletions

View File

@ -34,7 +34,7 @@ pub enum ExternalClientType {
impl Default for ExternalClientType { impl Default for ExternalClientType {
fn default() -> Self { fn default() -> Self {
Self::ThinClient Self::TpuClient
} }
} }
@ -167,19 +167,19 @@ pub fn build_args<'a>(version: &'_ str) -> App<'a, '_> {
.long("rpc-addr") .long("rpc-addr")
.value_name("HOST:PORT") .value_name("HOST:PORT")
.takes_value(true) .takes_value(true)
.conflicts_with("tpu_client")
.conflicts_with("rpc_client") .conflicts_with("rpc_client")
.requires("tpu_addr") .requires("tpu_addr")
.requires("thin_client")
.help("Specify custom rpc_addr to create thin_client"), .help("Specify custom rpc_addr to create thin_client"),
) )
.arg( .arg(
Arg::with_name("tpu_addr") Arg::with_name("tpu_addr")
.long("tpu-addr") .long("tpu-addr")
.value_name("HOST:PORT") .value_name("HOST:PORT")
.conflicts_with("tpu_client")
.conflicts_with("rpc_client") .conflicts_with("rpc_client")
.takes_value(true) .takes_value(true)
.requires("rpc_addr") .requires("rpc_addr")
.requires("thin_client")
.help("Specify custom tpu_addr to create thin_client"), .help("Specify custom tpu_addr to create thin_client"),
) )
.arg( .arg(
@ -316,6 +316,7 @@ pub fn build_args<'a>(version: &'_ str) -> App<'a, '_> {
.arg( .arg(
Arg::with_name("rpc_client") Arg::with_name("rpc_client")
.long("use-rpc-client") .long("use-rpc-client")
.conflicts_with("thin_client")
.conflicts_with("tpu_client") .conflicts_with("tpu_client")
.takes_value(false) .takes_value(false)
.help("Submit transactions with a RpcClient") .help("Submit transactions with a RpcClient")
@ -324,22 +325,33 @@ pub fn build_args<'a>(version: &'_ str) -> App<'a, '_> {
Arg::with_name("tpu_client") Arg::with_name("tpu_client")
.long("use-tpu-client") .long("use-tpu-client")
.conflicts_with("rpc_client") .conflicts_with("rpc_client")
.conflicts_with("thin_client")
.takes_value(false) .takes_value(false)
.help("Submit transactions with a TpuClient") .help("Submit transactions with a TpuClient")
) )
.arg(
Arg::with_name("thin_client")
.long("use-thin-client")
.conflicts_with("rpc_client")
.conflicts_with("tpu_client")
.takes_value(false)
.hidden(hidden_unless_forced())
.help("Submit transactions with a ThinClient. Note: usage is discouraged. \
ThinClient will be deprecated.")
)
.arg( .arg(
Arg::with_name("tpu_disable_quic") Arg::with_name("tpu_disable_quic")
.long("tpu-disable-quic") .long("tpu-disable-quic")
.takes_value(false) .takes_value(false)
.help("Do not submit transactions via QUIC; only affects ThinClient (default) \ .help("Do not submit transactions via QUIC; only affects ThinClient \
or TpuClient sends"), or TpuClient (default) sends"),
) )
.arg( .arg(
Arg::with_name("tpu_connection_pool_size") Arg::with_name("tpu_connection_pool_size")
.long("tpu-connection-pool-size") .long("tpu-connection-pool-size")
.takes_value(true) .takes_value(true)
.help("Controls the connection pool size per remote address; only affects ThinClient (default) \ .help("Controls the connection pool size per remote address; only affects ThinClient \
or TpuClient sends"), or TpuClient (default) sends"),
) )
.arg( .arg(
Arg::with_name("compute_unit_price") Arg::with_name("compute_unit_price")
@ -442,10 +454,10 @@ pub fn parse_args(matches: &ArgMatches) -> Result<Config, &'static str> {
return Err("could not parse identity path"); return Err("could not parse identity path");
} }
if matches.is_present("tpu_client") { if matches.is_present("rpc_client") {
args.external_client_type = ExternalClientType::TpuClient;
} else if matches.is_present("rpc_client") {
args.external_client_type = ExternalClientType::RpcClient; args.external_client_type = ExternalClientType::RpcClient;
} else if matches.is_present("thin_client") {
args.external_client_type = ExternalClientType::ThinClient;
} }
if matches.is_present("tpu_disable_quic") { if matches.is_present("tpu_disable_quic") {
@ -679,7 +691,7 @@ mod tests {
} }
); );
// select different client type // select different client type and CommitmentConfig
let keypair = read_keypair_file(&keypair_file_name).unwrap(); let keypair = read_keypair_file(&keypair_file_name).unwrap();
let matches = build_args("1.0.0").get_matches_from(vec![ let matches = build_args("1.0.0").get_matches_from(vec![
"solana-bench-tps", "solana-bench-tps",
@ -687,7 +699,9 @@ mod tests {
&keypair_file_name, &keypair_file_name,
"-u", "-u",
"http://123.4.5.6:8899", "http://123.4.5.6:8899",
"--use-tpu-client", "--use-rpc-client",
"--commitment-config",
"finalized",
]); ]);
let actual = parse_args(&matches).unwrap(); let actual = parse_args(&matches).unwrap();
assert_eq!( assert_eq!(
@ -696,7 +710,8 @@ mod tests {
json_rpc_url: "http://123.4.5.6:8899".to_string(), json_rpc_url: "http://123.4.5.6:8899".to_string(),
websocket_url: "ws://123.4.5.6:8900/".to_string(), websocket_url: "ws://123.4.5.6:8900/".to_string(),
id: keypair, id: keypair,
external_client_type: ExternalClientType::TpuClient, external_client_type: ExternalClientType::RpcClient,
commitment_config: CommitmentConfig::finalized(),
..Config::default() ..Config::default()
} }
); );

View File

@ -118,7 +118,7 @@ Operate a configured testnet
- Enable UDP for tpu transactions - Enable UDP for tpu transactions
--client-type --client-type
- Specify backend client type for bench-tps. Valid options are (thin-client|rpc-client|tpu-client), thin-client is default - Specify backend client type for bench-tps. Valid options are (thin-client|rpc-client|tpu-client), tpu-client is default
sanity/start-specific options: sanity/start-specific options:
-F - Discard validator nodes that didn't bootup successfully -F - Discard validator nodes that didn't bootup successfully
@ -834,7 +834,7 @@ waitForNodeInit=true
extraPrimordialStakes=0 extraPrimordialStakes=0
disableQuic=false disableQuic=false
enableUdp=false enableUdp=false
clientType=thin-client clientType=tpu-client
maybeUseUnstakedConnection="" maybeUseUnstakedConnection=""
command=$1 command=$1

View File

@ -11,7 +11,7 @@ if [[ -n $4 ]]; then
fi fi
benchTpsExtraArgs="$5" benchTpsExtraArgs="$5"
clientIndex="$6" clientIndex="$6"
clientType="${7:-thin-client}" clientType="${7:-tpu-client}"
maybeUseUnstakedConnection="$8" maybeUseUnstakedConnection="$8"
missing() { missing() {
@ -43,19 +43,19 @@ skip)
exit 1 exit 1
esac esac
TPU_CLIENT=false THIN_CLIENT=false
RPC_CLIENT=false RPC_CLIENT=false
case "$clientType" in case "$clientType" in
thin-client) thin-client)
TPU_CLIENT=false THIN_CLIENT=true
RPC_CLIENT=false RPC_CLIENT=false
;; ;;
tpu-client) tpu-client)
TPU_CLIENT=true THIN_CLIENT=false
RPC_CLIENT=false RPC_CLIENT=false
;; ;;
rpc-client) rpc-client)
TPU_CLIENT=false THIN_CLIENT=false
RPC_CLIENT=true RPC_CLIENT=true
;; ;;
*) *)
@ -74,12 +74,11 @@ solana-bench-tps)
args=() args=()
if ${TPU_CLIENT}; then if ${THIN_CLIENT}; then
args+=(--use-tpu-client) args+=(--entrypoint "$entrypointIp:8001")
args+=(--use-thin-client)
elif ${RPC_CLIENT}; then elif ${RPC_CLIENT}; then
args+=(--use-rpc-client) args+=(--use-rpc-client)
else
args+=(--entrypoint "$entrypointIp:8001")
fi fi
if [[ -z "$maybeUseUnstakedConnection" ]]; then if [[ -z "$maybeUseUnstakedConnection" ]]; then