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

Don't log single oracle downtime #271

Merged
merged 2 commits into from
Jan 18, 2024
Merged
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
12 changes: 9 additions & 3 deletions src/exits/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import time
from random import shuffle

from aiohttp import ClientError
from eth_typing import BlockNumber, BLSPubkey
from tenacity import RetryError
from web3 import Web3
from web3.types import HexStr

Expand All @@ -13,7 +15,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 +110,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, RetryError) 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
Loading