Skip to content

Commit

Permalink
Run deposit data startup check for DVT
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeny-stakewise committed Sep 12, 2024
1 parent 9f49584 commit f28ca33
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/common/startup_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
15 changes: 15 additions & 0 deletions src/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit f28ca33

Please sign in to comment.