diff --git a/rpc/src/rpc.rs b/rpc/src/rpc.rs index 1aedda8d0920ce..13426eb20abf69 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, @@ -3703,21 +3704,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 d2b70583d20592..a70f90f0e2c889 100644 --- a/validator/src/cli.rs +++ b/validator/src/cli.rs @@ -285,6 +285,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 8467bcaa9d2570..60c07b1bb49fc1 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| {