-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
change default bench-tps
client to tpu-client
#35335
Changes from 1 commit
83b183d
027a589
a2ba892
5d641ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ pub enum ExternalClientType { | |
|
||
impl Default for ExternalClientType { | ||
fn default() -> Self { | ||
Self::ThinClient | ||
Self::TpuClient | ||
} | ||
} | ||
|
||
|
@@ -167,19 +167,19 @@ pub fn build_args<'a>(version: &'_ str) -> App<'a, '_> { | |
.long("rpc-addr") | ||
.value_name("HOST:PORT") | ||
.takes_value(true) | ||
.conflicts_with("tpu_client") | ||
.conflicts_with("rpc_client") | ||
.requires("tpu_addr") | ||
.requires("thin_client") | ||
.help("Specify custom rpc_addr to create thin_client"), | ||
) | ||
.arg( | ||
Arg::with_name("tpu_addr") | ||
.long("tpu-addr") | ||
.value_name("HOST:PORT") | ||
.conflicts_with("tpu_client") | ||
.conflicts_with("rpc_client") | ||
.takes_value(true) | ||
.requires("rpc_addr") | ||
.requires("thin_client") | ||
.help("Specify custom tpu_addr to create thin_client"), | ||
) | ||
.arg( | ||
|
@@ -316,30 +316,30 @@ pub fn build_args<'a>(version: &'_ str) -> App<'a, '_> { | |
.arg( | ||
Arg::with_name("rpc_client") | ||
.long("use-rpc-client") | ||
.conflicts_with("tpu_client") | ||
.conflicts_with("thin_client") | ||
.takes_value(false) | ||
.help("Submit transactions with a RpcClient") | ||
) | ||
.arg( | ||
Arg::with_name("tpu_client") | ||
.long("use-tpu-client") | ||
Arg::with_name("thin_client") | ||
.long("use-thin-client") | ||
.conflicts_with("rpc_client") | ||
.takes_value(false) | ||
.help("Submit transactions with a TpuClient") | ||
.help("Submit transactions with a ThinClient") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, if we're going to remove this imminently, I think we should avoid exposing a flag for it in the first place. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ya if we remove it here we'd have to remove all references to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that works for me. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add a note here that usage of ThinClient is discouraged and that ThinClient will be deprecated? |
||
) | ||
.arg( | ||
Arg::with_name("tpu_disable_quic") | ||
.long("tpu-disable-quic") | ||
.takes_value(false) | ||
.help("Do not submit transactions via QUIC; only affects ThinClient (default) \ | ||
or TpuClient sends"), | ||
.help("Do not submit transactions via QUIC; only affects ThinClient \ | ||
or TpuClient (default) sends"), | ||
) | ||
.arg( | ||
Arg::with_name("tpu_connection_pool_size") | ||
.long("tpu-connection-pool-size") | ||
.takes_value(true) | ||
.help("Controls the connection pool size per remote address; only affects ThinClient (default) \ | ||
or TpuClient sends"), | ||
.help("Controls the connection pool size per remote address; only affects ThinClient \ | ||
or TpuClient (default) sends"), | ||
) | ||
.arg( | ||
Arg::with_name("compute_unit_price") | ||
|
@@ -442,11 +442,11 @@ pub fn parse_args(matches: &ArgMatches) -> Result<Config, &'static str> { | |
return Err("could not parse identity path"); | ||
} | ||
|
||
if matches.is_present("tpu_client") { | ||
args.external_client_type = ExternalClientType::TpuClient; | ||
} else if matches.is_present("rpc_client") { | ||
if matches.is_present("rpc_client") { | ||
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") { | ||
args.use_quic = false; | ||
|
@@ -679,15 +679,17 @@ mod tests { | |
} | ||
); | ||
|
||
// select different client type | ||
// select different client type and CommitmentConfig | ||
let keypair = read_keypair_file(&keypair_file_name).unwrap(); | ||
let matches = build_args("1.0.0").get_matches_from(vec![ | ||
"solana-bench-tps", | ||
"--identity", | ||
&keypair_file_name, | ||
"-u", | ||
"http://123.4.5.6:8899", | ||
"--use-tpu-client", | ||
"--use-rpc-client", | ||
"--commitment-config", | ||
"finalized", | ||
]); | ||
let actual = parse_args(&matches).unwrap(); | ||
assert_eq!( | ||
|
@@ -696,7 +698,8 @@ mod tests { | |
json_rpc_url: "http://123.4.5.6:8899".to_string(), | ||
websocket_url: "ws://123.4.5.6:8900/".to_string(), | ||
id: keypair, | ||
external_client_type: ExternalClientType::TpuClient, | ||
external_client_type: ExternalClientType::RpcClient, | ||
commitment_config: CommitmentConfig::finalized(), | ||
..Config::default() | ||
} | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should preserve the
--use-tpu-client
flag (and the variousconflicts_with
logic), even though it duplicates the (new) default behavior, to avoid breaking downstream users.