From f28ca3318911a8356cd9f49b19d7de6fd820f39e Mon Sep 17 00:00:00 2001 From: Evgeny Gusarov Date: Thu, 12 Sep 2024 13:14:44 +0300 Subject: [PATCH] Run deposit data startup check for DVT --- src/common/startup_check.py | 13 ++++++++----- src/config/settings.py | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/common/startup_check.py b/src/common/startup_check.py index 440a8364..48705f79 100644 --- a/src/common/startup_check.py +++ b/src/common/startup_check.py @@ -234,14 +234,17 @@ async def startup_checks() -> None: logger.info('Checking metrics server...') check_metrics_port() - if settings.validators_registration_mode == ValidatorsRegistrationMode.AUTO: + if settings.need_deposit_data_file: logger.info('Checking deposit data file...') await wait_for_deposit_data_file() - if settings.keystore_cls_str == LocalKeystore.__name__: - logger.info('Checking keystores dir...') - wait_for_keystores_dir() - logger.info('Found keystores dir') + if ( + settings.validators_registration_mode == ValidatorsRegistrationMode.AUTO + and settings.keystore_cls_str == LocalKeystore.__name__ + ): + logger.info('Checking keystores dir...') + wait_for_keystores_dir() + logger.info('Found keystores dir') await _check_validators_manager() diff --git a/src/config/settings.py b/src/config/settings.py index cf01bbc0..e50ebd21 100644 --- a/src/config/settings.py +++ b/src/config/settings.py @@ -267,6 +267,21 @@ def network_config(self) -> NetworkConfig: def is_genesis_vault(self) -> bool: return self.vault == settings.network_config.GENESIS_VAULT_CONTRACT_ADDRESS + @property + def need_deposit_data_file(self) -> bool: + if self.validators_registration_mode == ValidatorsRegistrationMode.AUTO: + return True + + # At this point validators_registration_mode is API + if self.relayer_type == RelayerTypes.DVT: + # Validator registration data is taken from deposit data file. + # DVT Relayer provides exit signature. + return True + + # Validator registration data is provided by Relayer. + # Validators manager signature is used instead of Merkle proof. + return False + settings = Settings()