Skip to content

Commit

Permalink
Use signature_validity_period for validators deadline
Browse files Browse the repository at this point in the history
Signed-off-by: cyc60 <[email protected]>
  • Loading branch information
cyc60 committed Sep 6, 2023
1 parent f12fa06 commit 99be7d0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/common/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ async def get_oracles() -> Oracles:
if exit_signature_recover_threshold > validators_threshold:
raise ValueError('Invalid exit signature threshold')

exit_signature_deadline = config['exit_signature_deadline']
signature_validity_period = config['signature_validity_period']

if exit_signature_deadline < 0:
raise ValueError('Invalid exit signature deadline')
if signature_validity_period < 0:
raise ValueError('Invalid signature validity period')

if len(public_keys) != len(set(public_keys)):
raise ValueError('Duplicate public keys in oracles config')
Expand All @@ -87,7 +87,7 @@ async def get_oracles() -> Oracles:
rewards_threshold=rewards_threshold,
validators_threshold=validators_threshold,
exit_signature_recover_threshold=exit_signature_recover_threshold,
exit_signature_deadline=exit_signature_deadline,
signature_validity_period=signature_validity_period,
public_keys=public_keys,
endpoints=endpoints,
validators_approval_batch_limit=validators_approval_batch_limit,
Expand Down
2 changes: 1 addition & 1 deletion src/common/typings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Oracles:
rewards_threshold: int
validators_threshold: int
exit_signature_recover_threshold: int
exit_signature_deadline: int
signature_validity_period: int
public_keys: list[HexStr]
endpoints: list[list[str]]

Expand Down
2 changes: 1 addition & 1 deletion src/exits/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ async def get_oracles_approval(
) -> OraclesApproval:
"""Fetches approval from oracles."""
fork = await consensus_client.get_consensus_fork()
deadline = datetime.now(timezone.utc) + timedelta(seconds=oracles.exit_signature_deadline)
deadline = datetime.now(timezone.utc) + timedelta(seconds=oracles.signature_validity_period)

# get exit signature shards
request = SignatureRotationRequest(
Expand Down
3 changes: 1 addition & 2 deletions src/validators/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ async def register_validators(keystores: Keystores, deposit_data: DepositData) -
while True:
latest_registry_root = await validators_registry_contract.get_registry_root()
latest_deadline = datetime.now(timezone.utc) + timedelta(
seconds=settings.exit_signature_deadline
seconds=oracles.signature_validity_period
)

if (
not registry_root
or registry_root != latest_registry_root
Expand Down

0 comments on commit 99be7d0

Please sign in to comment.