Skip to content

Commit

Permalink
Don't log single oracle downtime
Browse files Browse the repository at this point in the history
Signed-off-by: cyc60 <[email protected]>
  • Loading branch information
cyc60 committed Jan 18, 2024
1 parent caec831 commit 6da768b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/exits/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import time
from random import shuffle

from aiohttp import ClientError
from eth_typing import BlockNumber, BLSPubkey
from web3 import Web3
from web3.types import HexStr
Expand All @@ -13,7 +14,7 @@
from src.common.metrics import metrics
from src.common.tasks import BaseTask
from src.common.typings import Oracles
from src.common.utils import get_current_timestamp, is_block_finalized
from src.common.utils import get_current_timestamp, is_block_finalized, warning_verbose
from src.config.settings import settings
from src.exits.consensus import get_validator_public_keys
from src.exits.execution import submit_exit_signatures
Expand Down Expand Up @@ -108,12 +109,16 @@ async def _fetch_outdated_indexes(oracles: Oracles, update_block: BlockNumber |
shuffle(endpoints)

for oracle_endpoint in endpoints:
response = await get_oracle_outdated_signatures_response(oracle_endpoint)
try:
response = await get_oracle_outdated_signatures_response(oracle_endpoint)
except ClientError as e:
warning_verbose(str(e))
continue
if not update_block or response['exit_signature_block_number'] >= update_block:
outdated_indexes = [val['index'] for val in response['validators']]
metrics.outdated_signatures.set(len(outdated_indexes))
return outdated_indexes
raise RuntimeError('Oracles have not synced exit signatures yet')
raise RuntimeError('Oracles are down or have not synced exit signatures yet')


async def _update_exit_signatures(
Expand Down

0 comments on commit 6da768b

Please sign in to comment.