Skip to content

Commit

Permalink
Fix CI test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
lijunwangs committed Apr 22, 2024
1 parent e7cba76 commit 49f441a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
6 changes: 0 additions & 6 deletions bench-tps/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,6 @@ pub fn build_args<'a>(version: &'_ str) -> App<'a, '_> {
.takes_value(true)
.help("Controls the connection pool size per remote address; only affects TpuClient (default) sends"),
)
.arg(
Arg::with_name("tpu_max_connections_per_ipaddr_per_minute")
.long("tpu-max-connections-per-ipaddr-per-minute")
.takes_value(true)
.help("Controls the rate of the clients connections per IpAddr per minute."),
)
.arg(
Arg::with_name("compute_unit_price")
.long("compute-unit-price")
Expand Down
2 changes: 1 addition & 1 deletion streamer/src/nonblocking/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ async fn run_server(
if let Ok(Some(connection)) = timeout_connection {
let remote_address = connection.remote_address();

let do_rate_limiting = false;
let do_rate_limiting = true;
// first check overall connection rate limit:
if do_rate_limiting && !overall_connection_rate_limiter.check(&remote_address.ip()) {
stats.connection_throttled.fetch_add(1, Ordering::Relaxed);
Expand Down
16 changes: 15 additions & 1 deletion validator/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ use {
};

pub mod thread_args;
use thread_args::{thread_args, DefaultThreadArgs};
use {
solana_streamer::nonblocking::quic::DEFAULT_MAX_CONNECTIONS_PER_IPADDR_PER_MINUTE,
thread_args::{thread_args, DefaultThreadArgs},
};

const EXCLUDE_KEY: &str = "account-index-exclude-key";
const INCLUDE_KEY: &str = "account-index-include-key";
Expand Down Expand Up @@ -881,6 +884,14 @@ pub fn app<'a>(version: &'a str, default_args: &'a DefaultArgs) -> App<'a, 'a> {
.validator(is_parsable::<usize>)
.help("Controls the TPU connection pool size per remote address"),
)
.arg(
Arg::with_name("tpu_max_connections_per_ipaddr_per_minute")
.long("tpu-max-connections-per-ipaddr-per-minute")
.takes_value(true)
.default_value(&default_args.tpu_max_connections_per_ipaddr_per_minute)
.validator(is_parsable::<u32>)
.help("Controls the rate of the clients connections per IpAddr per minute."),
)
.arg(
Arg::with_name("staked_nodes_overrides")
.long("staked-nodes-overrides")
Expand Down Expand Up @@ -2202,6 +2213,7 @@ pub struct DefaultArgs {
pub accounts_shrink_optimize_total_space: String,
pub accounts_shrink_ratio: String,
pub tpu_connection_pool_size: String,
pub tpu_max_connections_per_ipaddr_per_minute: String,

// Exit subcommand
pub exit_min_idle_time: String,
Expand Down Expand Up @@ -2291,6 +2303,8 @@ impl DefaultArgs {
.to_string(),
accounts_shrink_ratio: DEFAULT_ACCOUNTS_SHRINK_RATIO.to_string(),
tpu_connection_pool_size: DEFAULT_TPU_CONNECTION_POOL_SIZE.to_string(),
tpu_max_connections_per_ipaddr_per_minute:
DEFAULT_MAX_CONNECTIONS_PER_IPADDR_PER_MINUTE.to_string(),
rpc_max_request_body_size: MAX_REQUEST_BODY_SIZE.to_string(),
exit_min_idle_time: "10".to_string(),
exit_max_delinquent_stake: "5".to_string(),
Expand Down

0 comments on commit 49f441a

Please sign in to comment.