diff --git a/src/config/settings.py b/src/config/settings.py index 04005553..b8a87555 100644 --- a/src/config/settings.py +++ b/src/config/settings.py @@ -50,6 +50,7 @@ class Settings(metaclass=Singleton): keystores_password_file: Path remote_signer_url: str | None remote_signer_public_keys_url: str | None + remote_signer_use_deposit_data: bool dappnode: bool = False hashi_vault_key_paths: list[str] | None hashi_vault_url: str | None @@ -167,6 +168,9 @@ def set( self.remote_signer_public_keys_url: str = decouple_config( 'REMOTE_SIGNER_PUBLIC_KEYS_URL', default=None ) + self.remote_signer_use_deposit_data: bool = decouple_config( + 'REMOTE_SIGNER_USE_DEPOSIT_DATA', default=False, cast=bool + ) self.dappnode = dappnode # hashi vault configuration diff --git a/src/validators/keystores/remote.py b/src/validators/keystores/remote.py index c337bbe1..34d925a2 100644 --- a/src/validators/keystores/remote.py +++ b/src/validators/keystores/remote.py @@ -13,6 +13,7 @@ from src.config.settings import REMOTE_SIGNER_TIMEOUT, settings from src.validators.keystores.base import BaseKeystore +from src.validators.utils import load_deposit_data logger = logging.getLogger(__name__) @@ -50,6 +51,10 @@ def __init__(self, public_keys: list[HexStr]): @staticmethod async def load() -> 'BaseKeystore': + if settings.remote_signer_use_deposit_data: + deposit_data = load_deposit_data(settings.vault, settings.deposit_data_file) + return RemoteSignerKeystore(deposit_data.public_keys) + public_keys = await RemoteSignerKeystore._get_remote_signer_public_keys() return RemoteSignerKeystore(public_keys)