diff --git a/validator_client/lighthouse_validator_store/src/lib.rs b/validator_client/lighthouse_validator_store/src/lib.rs index d07f95f11c..b5104f6971 100644 --- a/validator_client/lighthouse_validator_store/src/lib.rs +++ b/validator_client/lighthouse_validator_store/src/lib.rs @@ -2,7 +2,7 @@ use account_utils::validator_definitions::{PasswordStorage, ValidatorDefinition} use doppelganger_service::DoppelgangerService; use initialized_validators::InitializedValidators; use logging::crit; -use parking_lot::{Mutex, RwLock}; +use parking_lot::Mutex; use serde::{Deserialize, Serialize}; use signing_method::Error as SigningError; use signing_method::{SignableMessage, SigningContext, SigningMethod}; @@ -14,6 +14,7 @@ use std::marker::PhantomData; use std::path::Path; use std::sync::Arc; use task_executor::TaskExecutor; +use tokio::sync::RwLock; use tracing::{error, info, warn}; use types::{ graffiti::GraffitiString, AbstractExecPayload, Address, AggregateAndProof, Attestation, @@ -565,8 +566,8 @@ impl ValidatorStore for LighthouseValidatorS /// /// - Unknown. /// - Known, but with an unknown index. - fn validator_index(&self, pubkey: &PublicKeyBytes) -> Option { - self.validators.read().get_index(pubkey) + fn validator_index(&self, pubkey: &PublicKeyBytes) -> impl Future> { + async { self.validators.read().await.get_index(pubkey) } } /// Returns all voting pubkeys for all enabled validators. diff --git a/validator_client/validator_store/src/lib.rs b/validator_client/validator_store/src/lib.rs index 9de3a6d66a..626679d8b0 100644 --- a/validator_client/validator_store/src/lib.rs +++ b/validator_client/validator_store/src/lib.rs @@ -46,7 +46,7 @@ pub trait ValidatorStore: Send + Sync { /// /// - Unknown. /// - Known, but with an unknown index. - fn validator_index(&self, pubkey: &PublicKeyBytes) -> Option; + fn validator_index(&self, pubkey: &PublicKeyBytes) -> impl Future> + Sync; /// Returns all voting pubkeys for all enabled validators. ///