Skip to content

Commit 8631d08

Browse files
Review fix
1 parent 901cdcd commit 8631d08

File tree

3 files changed

+9
-18
lines changed

3 files changed

+9
-18
lines changed

src/common/execution.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -83,23 +83,16 @@ async def update_oracles_cache() -> None:
8383
rewards_threshold = Web3.to_int(multicall_response[0][1])
8484
validators_threshold = Web3.to_int(multicall_response[1][1])
8585

86-
if _oracles_cache:
87-
_oracles_cache.config = config
88-
_oracles_cache.validators_threshold = validators_threshold
89-
_oracles_cache.rewards_threshold = rewards_threshold
90-
_oracles_cache.checkpoint_block = to_block
91-
else:
92-
_oracles_cache = OraclesCache(
93-
config=config,
94-
validators_threshold=validators_threshold,
95-
rewards_threshold=rewards_threshold,
96-
checkpoint_block=to_block,
97-
)
86+
_oracles_cache = OraclesCache(
87+
config=config,
88+
validators_threshold=validators_threshold,
89+
rewards_threshold=rewards_threshold,
90+
checkpoint_block=to_block,
91+
)
9892

9993

10094
async def get_oracles() -> Oracles:
101-
if not _oracles_cache:
102-
await update_oracles_cache()
95+
await update_oracles_cache()
10396

10497
oracles_cache = cast(OraclesCache, _oracles_cache)
10598

src/exits/tasks.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from src.common.contracts import keeper_contract
1010
from src.common.exceptions import NotEnoughOracleApprovalsError
11-
from src.common.execution import get_oracles, update_oracles_cache
11+
from src.common.execution import get_oracles
1212
from src.common.metrics import metrics
1313
from src.common.typings import Oracles
1414
from src.common.utils import get_current_timestamp, is_block_finalized
@@ -34,7 +34,6 @@ async def update_exit_signatures(
3434
keystores: Keystores,
3535
remote_signer_config: RemoteSignerConfiguration | None,
3636
) -> None:
37-
await update_oracles_cache()
3837
oracles = await get_oracles()
3938
update_block = await _fetch_last_update_block()
4039
if update_block and not await is_block_finalized(update_block):

src/validators/tasks.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from src.common.clients import ipfs_fetch_client
1010
from src.common.contracts import v2_pool_escrow_contract, validators_registry_contract
1111
from src.common.exceptions import NotEnoughOracleApprovalsError
12-
from src.common.execution import check_gas_price, get_oracles, update_oracles_cache
12+
from src.common.execution import check_gas_price, get_oracles
1313
from src.common.metrics import metrics
1414
from src.common.typings import Oracles
1515
from src.common.utils import MGNO_RATE, WAD, get_current_timestamp
@@ -72,7 +72,6 @@ async def register_validators(
7272
return
7373

7474
# get latest oracles
75-
await update_oracles_cache()
7675
oracles = await get_oracles()
7776

7877
validators_count = min(oracles.validators_approval_batch_limit, validators_count)

0 commit comments

Comments
 (0)