File tree Expand file tree Collapse file tree 3 files changed +20
-6
lines changed Expand file tree Collapse file tree 3 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,8 @@ async def check_hot_wallet_balance() -> None:
34
34
35
35
if hot_wallet_balance < hot_wallet_min_balance :
36
36
logger .warning (
37
- 'Wallet balance is too low. At least %s %s is recommended.' ,
37
+ 'Wallet %s balance is too low. At least %s %s is recommended.' ,
38
+ hot_wallet .address ,
38
39
Web3 .from_wei (hot_wallet_min_balance , 'ether' ),
39
40
symbol ,
40
41
)
Original file line number Diff line number Diff line change 7
7
from web3 .types import HexStr
8
8
9
9
from src .common .contracts import keeper_contract
10
+ from src .common .exceptions import NotEnoughOracleApprovalsError
10
11
from src .common .execution import get_oracles
11
12
from src .common .metrics import metrics
12
13
from src .common .typings import Oracles
13
- from src .common .utils import get_current_timestamp , is_block_finalized , log_verbose
14
+ from src .common .utils import get_current_timestamp , is_block_finalized
14
15
from src .config .settings import settings
15
16
from src .exits .consensus import get_validator_public_keys
16
17
from src .exits .execution import submit_exit_signatures
@@ -139,8 +140,14 @@ async def _update_exit_signatures(
139
140
oracles_approval = await send_signature_rotation_requests (oracles , oracles_request )
140
141
logger .info ('Fetched updated signature for validators: count=%d' , len (validators ))
141
142
break
142
- except Exception as e :
143
- log_verbose (e )
143
+ except NotEnoughOracleApprovalsError as e :
144
+ logger .error (
145
+ 'Failed to fetch oracle approvals. Received %d out of %d, '
146
+ 'the oracles with endpoints %s have failed to respond.' ,
147
+ e .num_votes ,
148
+ e .threshold ,
149
+ ', ' .join (e .failed_endpoints ),
150
+ )
144
151
145
152
tx_hash = await submit_exit_signatures (oracles_approval )
146
153
if not tx_hash :
Original file line number Diff line number Diff line change 10
10
from sw_utils .decorators import retry_aiohttp_errors
11
11
from web3 import Web3
12
12
13
+ from src .common .exceptions import NotEnoughOracleApprovalsError
13
14
from src .common .typings import OracleApproval , Oracles , OraclesApproval
14
15
from src .common .utils import format_error , process_oracles_approvals , warning_verbose
15
16
from src .config .settings import (
@@ -32,6 +33,7 @@ async def send_signature_rotation_requests(
32
33
random .shuffle (endpoints )
33
34
34
35
approvals : dict [ChecksumAddress , OracleApproval ] = {}
36
+ failed_endpoints : list [str ] = []
35
37
async with aiohttp .ClientSession () as session :
36
38
for address , replicas in endpoints :
37
39
try :
@@ -45,10 +47,14 @@ async def send_signature_rotation_requests(
45
47
address ,
46
48
format_error (e ),
47
49
)
50
+ failed_endpoints .extend (replicas )
48
51
continue
49
52
approvals [address ] = response
50
-
51
- return process_oracles_approvals (approvals , oracles .validators_threshold )
53
+ try :
54
+ return process_oracles_approvals (approvals , oracles .validators_threshold )
55
+ except NotEnoughOracleApprovalsError as e :
56
+ e .failed_endpoints = failed_endpoints
57
+ raise
52
58
53
59
54
60
# pylint: disable=duplicate-code
You can’t perform that action at this time.
0 commit comments