Reduce the number of block timestamp requests

The timestamps are only relevant within the candidate block range.
This commit is contained in:
Zahary Karadjov 2023-03-14 13:46:22 +02:00
parent 6fb48aca7d
commit 2ee15a38ed
No known key found for this signature in database
GPG Key ID: C1F42EAFF38D570F
1 changed files with 1 additions and 2 deletions

View File

@ -1918,9 +1918,8 @@ proc syncBlockRange(m: ELManager,
for i in 0 ..< blocksWithDeposits.len: for i in 0 ..< blocksWithDeposits.len:
let blk = blocksWithDeposits[i] let blk = blocksWithDeposits[i]
await fetchTimestamp(connection, rpcClient, blk)
if blk.number > fullSyncFromBlock: if blk.number > fullSyncFromBlock:
await fetchTimestamp(connection, rpcClient, blk)
let lastBlock = m.eth1Chain.blocks.peekLast let lastBlock = m.eth1Chain.blocks.peekLast
for n in max(lastBlock.number + 1, fullSyncFromBlock) ..< blk.number: for n in max(lastBlock.number + 1, fullSyncFromBlock) ..< blk.number:
debug "Obtaining block without deposits", blockNum = n debug "Obtaining block without deposits", blockNum = n