Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deposit data check #413

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/commands/start_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@
),
default=RelayerTypes.DEFAULT,
help='Relayer type.',
prompt='Enter the relayer type',
envvar='RELAYER_TYPE',
)
@click.option(
Expand Down
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
Loading