Skip to content

Commit c0d6ec8

Browse files
Fix chain head
1 parent e89b97c commit c0d6ec8

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/commands/start/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ async def process_block(self, interrupt_handler: InterruptHandler) -> None:
130130
chain_head=chain_head, interrupt_handler=interrupt_handler
131131
)
132132
await scan_validators_events(block_number=chain_head.block_number, is_startup=False)
133-
subtasks = [self.validator_registration_subtask.process(chain_head=chain_head)]
133+
subtasks = [self.validator_registration_subtask.process()]
134134
if not settings.disable_withdrawals:
135135
subtasks.append(self.validator_withdrawal_subtask.process())
136136
await asyncio.gather(*subtasks)

src/validators/tasks.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from web3.types import BlockNumber, Gwei, Wei
1010

1111
from src.common.clients import execution_client
12+
from src.common.consensus import get_chain_latest_head
1213
from src.common.contracts import VaultContract, validators_registry_contract
1314
from src.common.execution import check_gas_price
1415
from src.common.harvest import get_harvest_params
@@ -46,13 +47,14 @@ def __init__(
4647
self.keystore = keystore
4748
self.relayer = relayer
4849

49-
async def process(self, chain_head: ChainHead) -> None:
50+
async def process(self) -> None:
5051
if self.keystore:
5152
await update_unused_validator_keys_metric(
5253
keystore=self.keystore,
5354
)
5455
harvest_params = await get_harvest_params(settings.vault)
5556

57+
chain_head = await get_chain_latest_head()
5658
vault_assets = await get_vault_assets(harvest_params=harvest_params, chain_head=chain_head)
5759
vault_assets = Gwei(max(0, vault_assets - settings.vault_min_balance_gwei))
5860

0 commit comments

Comments
 (0)