Remove support to monitor all validators in a cluster for delinquency
This feature is no longer useful with hundreds of validators
This commit is contained in:
		@@ -91,7 +91,7 @@ fn get_config() -> Config {
 | 
			
		||||
                .takes_value(true)
 | 
			
		||||
                .validator(is_pubkey_or_keypair)
 | 
			
		||||
                .multiple(true)
 | 
			
		||||
                .help("Monitor a specific validator only instead of the entire cluster"),
 | 
			
		||||
                .help("Validator identities to monitor for delinquency")
 | 
			
		||||
        )
 | 
			
		||||
        .arg(
 | 
			
		||||
            Arg::with_name("no_duplicate_notifications")
 | 
			
		||||
@@ -135,12 +135,10 @@ fn get_config() -> Config {
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    info!("RPC URL: {}", config.json_rpc_url);
 | 
			
		||||
    if !config.validator_identity_pubkeys.is_empty() {
 | 
			
		||||
    info!(
 | 
			
		||||
        "Monitored validators: {:?}",
 | 
			
		||||
        config.validator_identity_pubkeys
 | 
			
		||||
    );
 | 
			
		||||
    }
 | 
			
		||||
    config
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -152,11 +150,11 @@ fn get_cluster_info(rpc_client: &RpcClient) -> ClientResult<(u64, Hash, RpcVoteA
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
fn main() -> Result<(), Box<dyn error::Error>> {
 | 
			
		||||
    let config = get_config();
 | 
			
		||||
 | 
			
		||||
    solana_logger::setup_with_default("solana=info");
 | 
			
		||||
    solana_metrics::set_panic_hook("watchtower");
 | 
			
		||||
 | 
			
		||||
    let config = get_config();
 | 
			
		||||
 | 
			
		||||
    let rpc_client = RpcClient::new(config.json_rpc_url.clone());
 | 
			
		||||
    let notifier = Notifier::default();
 | 
			
		||||
    let mut last_transaction_count = 0;
 | 
			
		||||
@@ -226,14 +224,6 @@ fn main() -> Result<(), Box<dyn error::Error>> {
 | 
			
		||||
                    ));
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                if config.validator_identity_pubkeys.is_empty() {
 | 
			
		||||
                    if !vote_accounts.delinquent.is_empty() {
 | 
			
		||||
                        failures.push((
 | 
			
		||||
                            "delinquent",
 | 
			
		||||
                            format!("{} delinquent validators", vote_accounts.delinquent.len()),
 | 
			
		||||
                        ));
 | 
			
		||||
                    }
 | 
			
		||||
                } else {
 | 
			
		||||
                let mut errors = vec![];
 | 
			
		||||
                for validator_identity in config.validator_identity_pubkeys.iter() {
 | 
			
		||||
                    let formatted_validator_identity =
 | 
			
		||||
@@ -261,10 +251,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
 | 
			
		||||
                                // find some more SOL
 | 
			
		||||
                                failures.push((
 | 
			
		||||
                                    "balance",
 | 
			
		||||
                                        format!(
 | 
			
		||||
                                            "{} has {} SOL",
 | 
			
		||||
                                            formatted_validator_identity, balance
 | 
			
		||||
                                        ),
 | 
			
		||||
                                    format!("{} has {} SOL", formatted_validator_identity, balance),
 | 
			
		||||
                                ));
 | 
			
		||||
                            }
 | 
			
		||||
                        })
 | 
			
		||||
@@ -279,7 +266,6 @@ fn main() -> Result<(), Box<dyn error::Error>> {
 | 
			
		||||
                if !errors.is_empty() {
 | 
			
		||||
                    failures.push(("delinquent", errors.join(",")));
 | 
			
		||||
                }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                for failure in failures.iter() {
 | 
			
		||||
                    error!("{} sanity failure: {}", failure.0, failure.1);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user