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

Add block number check #160

Merged
merged 1 commit into from
Sep 15, 2023
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
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