diff --git a/rpc/src/rpc.rs b/rpc/src/rpc.rs index 0cd32ab3ff84b1..05bd4caa8d6088 100644 --- a/rpc/src/rpc.rs +++ b/rpc/src/rpc.rs @@ -146,6 +146,7 @@ pub struct JsonRpcConfig { pub enable_extended_tx_metadata_storage: bool, pub faucet_addr: Option, pub health_check_slot_distance: u64, + pub skip_preflight_health_check: bool, pub rpc_bigtable_config: Option, pub max_multiple_accounts: Option, pub account_indexes: AccountSecondaryIndexes, @@ -3695,21 +3696,23 @@ pub mod rpc_full { if !skip_preflight { verify_transaction(&transaction, &preflight_bank.feature_set)?; - match meta.health.check() { - RpcHealthStatus::Ok => (), - RpcHealthStatus::Unknown => { - inc_new_counter_info!("rpc-send-tx_health-unknown", 1); - return Err(RpcCustomError::NodeUnhealthy { - num_slots_behind: None, + if !meta.config.skip_preflight_health_check { + match meta.health.check() { + RpcHealthStatus::Ok => (), + RpcHealthStatus::Unknown => { + inc_new_counter_info!("rpc-send-tx_health-unknown", 1); + return Err(RpcCustomError::NodeUnhealthy { + num_slots_behind: None, + } + .into()); } - .into()); - } - RpcHealthStatus::Behind { num_slots } => { - inc_new_counter_info!("rpc-send-tx_health-behind", 1); - return Err(RpcCustomError::NodeUnhealthy { - num_slots_behind: Some(num_slots), + RpcHealthStatus::Behind { num_slots } => { + inc_new_counter_info!("rpc-send-tx_health-behind", 1); + return Err(RpcCustomError::NodeUnhealthy { + num_slots_behind: Some(num_slots), + } + .into()); } - .into()); } } diff --git a/validator/src/cli.rs b/validator/src/cli.rs index 9ebef5a0527db7..60cdc3044748f6 100644 --- a/validator/src/cli.rs +++ b/validator/src/cli.rs @@ -286,6 +286,14 @@ pub fn app<'a>(version: &'a str, default_args: &'a DefaultArgs) -> App<'a, 'a> { latest optimistically confirmed slot", ), ) + .arg( + Arg::with_name("skip_preflight_health_check") + .long("skip-preflight-health-check") + .takes_value(false) + .help( + "Skip health check when running a preflight check", + ), + ) .arg( Arg::with_name("rpc_faucet_addr") .long("rpc-faucet-address") diff --git a/validator/src/main.rs b/validator/src/main.rs index fd98392fc1766d..b2fb6a7ac275b9 100644 --- a/validator/src/main.rs +++ b/validator/src/main.rs @@ -1422,6 +1422,7 @@ pub fn main() { "rpc_max_request_body_size", usize )), + skip_preflight_health_check: matches.is_present("skip_preflight_health_check"), }, on_start_geyser_plugin_config_files, rpc_addrs: value_t!(matches, "rpc_port", u16).ok().map(|rpc_port| {