Skip to content

Commit

Permalink
Add block number check
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeny-stakewise committed Sep 15, 2023
1 parent 3c049bc commit 989cc12
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/common/startup_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ async def wait_for_execution_node() -> None:
)
continue
block_number = await execution_client.eth.block_number
if block_number <= 0:
# There was a case when `block_number` equals to 0 although `syncing` is False.
logger.warning(
'Execution node %s. Current block number is %s',
execution_endpoint,
block_number,
)
continue
logger.info(
'Connected to execution node at %s. Current block number: %s',
execution_endpoint,
Expand All @@ -90,7 +98,7 @@ async def wait_for_execution_node() -> None:
)
if done:
return
logger.warning('Failed to connect to consensus nodes. Retrying in 10 seconds...')
logger.warning('Failed to connect to execution nodes. Retrying in 10 seconds...')
await asyncio.sleep(10)


Expand Down

0 comments on commit 989cc12

Please sign in to comment.