From 322ec3d2f94497127e9f1bc2f8f5daefb31221a1 Mon Sep 17 00:00:00 2001 From: cheatfate Date: Sat, 4 Jul 2020 09:55:45 +0300 Subject: [PATCH] Forward sync should always start from finalized epoch's first slot. --- beacon_chain/sync_manager.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beacon_chain/sync_manager.nim b/beacon_chain/sync_manager.nim index ed5535d1f..92de6da9f 100644 --- a/beacon_chain/sync_manager.nim +++ b/beacon_chain/sync_manager.nim @@ -586,7 +586,7 @@ proc newSyncManager*[A, B](pool: PeerPool[A, B], peer.updateScore(PeerScoreGoodBlocks) return res - let queue = SyncQueue.init(A, getLocalHeadSlotCb(), getLocalWallSlotCb(), + let queue = SyncQueue.init(A, getFSAFECb(), getLocalWallSlotCb(), chunkSize, syncUpdate, getFSAFECb, 2) result = SyncManager[A, B]( @@ -875,7 +875,7 @@ proc sync*[A, B](man: SyncManager[A, B]) {.async.} = debug "Synchronization lost, restoring", wall_head_slot = wallSlot, local_head_slot = headSlot, queue_last_slot = man.queue.lastSlot, topics = "syncman" - man.queue = SyncQueue.init(A, headSlot, wallSlot, + man.queue = SyncQueue.init(A, man.getFirstSlotAFE(), wallSlot, man.chunkSize, man.syncUpdate, man.getFirstSlotAFE, 2)