Skip to content

Commit

Permalink
add better err reporting UnableToOpenVotingKeystore (#3781)
Browse files Browse the repository at this point in the history
## Issue Addressed

#3780 

## Proposed Changes

Add error reporting that notifies the node operator that the `voting_keystore_path` in their `validator_definitions.yml` file may be incorrect.

## Additional Info

There is more info in issue #3780 


Co-authored-by: Paul Hauner <[email protected]>
  • Loading branch information
infosecual and paulhauner committed Jan 17, 2023
1 parent 6ac1c5b commit 9a970ce
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion validator_client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use crate::beacon_node_fallback::{
};
use crate::doppelganger_service::DoppelgangerService;
use crate::graffiti_file::GraffitiFile;
use crate::initialized_validators::Error::UnableToOpenVotingKeystore;
use account_utils::validator_definitions::ValidatorDefinitions;
use attestation_service::{AttestationService, AttestationServiceBuilder};
use block_service::{BlockService, BlockServiceBuilder};
Expand Down Expand Up @@ -184,7 +185,16 @@ impl<T: EthSpec> ProductionValidatorClient<T> {
log.clone(),
)
.await
.map_err(|e| format!("Unable to initialize validators: {:?}", e))?;
.map_err(|e| {
match e {
UnableToOpenVotingKeystore(err) => {
format!("Unable to initialize validators: {:?}. If you have recently moved the location of your data directory \
make sure to update the location of voting_keystore_path in your validator_definitions.yml", err)
},
err => {
format!("Unable to initialize validators: {:?}", err)}
}
})?;

let voting_pubkeys: Vec<_> = validators.iter_voting_pubkeys().collect();

Expand Down

0 comments on commit 9a970ce

Please sign in to comment.