From 6e89d8fd114df4006269b6b0234bb7964fd2014b Mon Sep 17 00:00:00 2001 From: cyc60 Date: Wed, 4 Oct 2023 20:27:26 +0300 Subject: [PATCH] Fix is_block_synced func Signed-off-by: cyc60 --- src/common/utils.py | 2 +- src/exits/tasks.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/utils.py b/src/common/utils.py index e8ef9bfa..6b80ac61 100644 --- a/src/common/utils.py +++ b/src/common/utils.py @@ -46,7 +46,7 @@ async def is_block_synced(block_number: BlockNumber): chain_head = await consensus_client.get_chain_finalized_head( settings.network_config.SLOTS_PER_EPOCH ) - return chain_head.execution_block < block_number + return chain_head.execution_block >= block_number def get_current_timestamp() -> Timestamp: diff --git a/src/exits/tasks.py b/src/exits/tasks.py index e0864c18..d30eeb0d 100644 --- a/src/exits/tasks.py +++ b/src/exits/tasks.py @@ -35,7 +35,7 @@ async def update_exit_signatures_periodically( ): oracles = await get_oracles() update_block = await _fetch_last_update_block() - if update_block and await is_block_synced(update_block): + if update_block and not await is_block_synced(update_block): logger.info('Waiting for block %d finalization...', update_block) return outdated_indexes = await _fetch_outdated_indexes(oracles, update_block)