Fix names
This commit is contained in:
parent
322ec3d2f9
commit
6ef2e71468
|
@ -74,7 +74,7 @@ type
|
|||
pending*: Table[uint64, SyncRequest[T]]
|
||||
waiters: seq[SyncWaiter[T]]
|
||||
syncUpdate*: SyncUpdateCallback[T]
|
||||
getFirstSlotAFE*: GetSlotCallback
|
||||
getFinalizedSlot*: GetSlotCallback
|
||||
debtsQueue: HeapQueue[SyncRequest[T]]
|
||||
debtsCount: uint64
|
||||
readyQueue: HeapQueue[SyncResult[T]]
|
||||
|
@ -91,7 +91,7 @@ type
|
|||
toleranceValue: uint64
|
||||
getLocalHeadSlot: GetSlotCallback
|
||||
getLocalWallSlot: GetSlotCallback
|
||||
getFirstSlotAFE: GetSlotCallback
|
||||
getFinalizedSlot: GetSlotCallback
|
||||
syncUpdate: SyncUpdateCallback[A]
|
||||
chunkSize: uint64
|
||||
queue: SyncQueue[A]
|
||||
|
@ -208,7 +208,7 @@ proc isEmpty*[T](sr: SyncRequest[T]): bool {.inline.} =
|
|||
proc init*[T](t1: typedesc[SyncQueue], t2: typedesc[T],
|
||||
start, last: Slot, chunkSize: uint64,
|
||||
updateCb: SyncUpdateCallback[T],
|
||||
fsafeCb: GetSlotCallback,
|
||||
getFinalizedSlotCb: GetSlotCallback,
|
||||
queueSize: int = -1): SyncQueue[T] =
|
||||
## Create new synchronization queue with parameters
|
||||
##
|
||||
|
@ -268,7 +268,7 @@ proc init*[T](t1: typedesc[SyncQueue], t2: typedesc[T],
|
|||
chunkSize: chunkSize,
|
||||
queueSize: queueSize,
|
||||
syncUpdate: updateCb,
|
||||
getFirstSlotAFE: fsafeCb,
|
||||
getFinalizedSlot: getFinalizedSlotCb,
|
||||
waiters: newSeq[SyncWaiter[T]](),
|
||||
counter: 1'u64,
|
||||
pending: initTable[uint64, SyncRequest[T]](),
|
||||
|
@ -449,7 +449,7 @@ proc push*[T](sq: SyncQueue[T], sr: SyncRequest[T],
|
|||
# of blocks with holes or `block_pool` is in incomplete state. We going
|
||||
# to rewind to the first slot at latest finalized epoch.
|
||||
let req = item.request
|
||||
let finalizedSlot = sq.getFirstSlotAFE()
|
||||
let finalizedSlot = sq.getFinalizedSlot()
|
||||
if finalizedSlot < req.slot:
|
||||
warn "Unexpected missing parent, rewind happens",
|
||||
peer = req.item, rewind_to_slot = finalizedSlot,
|
||||
|
@ -566,7 +566,7 @@ proc speed*(start, finish: SyncMoment): float {.inline.} =
|
|||
proc newSyncManager*[A, B](pool: PeerPool[A, B],
|
||||
getLocalHeadSlotCb: GetSlotCallback,
|
||||
getLocalWallSlotCb: GetSlotCallback,
|
||||
getFSAFECb: GetSlotCallback,
|
||||
getFinalizedSlotCb: GetSlotCallback,
|
||||
updateLocalBlocksCb: UpdateLocalBlocksCallback,
|
||||
maxWorkers = 10,
|
||||
maxStatusAge = uint64(SLOTS_PER_EPOCH * 4),
|
||||
|
@ -586,8 +586,8 @@ proc newSyncManager*[A, B](pool: PeerPool[A, B],
|
|||
peer.updateScore(PeerScoreGoodBlocks)
|
||||
return res
|
||||
|
||||
let queue = SyncQueue.init(A, getFSAFECb(), getLocalWallSlotCb(),
|
||||
chunkSize, syncUpdate, getFSAFECb, 2)
|
||||
let queue = SyncQueue.init(A, getFinalizedSlotCb(), getLocalWallSlotCb(),
|
||||
chunkSize, syncUpdate, getFinalizedSlotCb, 2)
|
||||
|
||||
result = SyncManager[A, B](
|
||||
pool: pool,
|
||||
|
@ -596,7 +596,7 @@ proc newSyncManager*[A, B](pool: PeerPool[A, B],
|
|||
getLocalHeadSlot: getLocalHeadSlotCb,
|
||||
syncUpdate: syncUpdate,
|
||||
getLocalWallSlot: getLocalWallSlotCb,
|
||||
getFirstSlotAFE: getFSAFECb,
|
||||
getFinalizedSlot: getFinalizedSlotCb,
|
||||
maxHeadAge: maxHeadAge,
|
||||
maxRecurringFailures: maxRecurringFailures,
|
||||
sleepTime: sleepTime,
|
||||
|
@ -875,9 +875,9 @@ 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, man.getFirstSlotAFE(), wallSlot,
|
||||
man.queue = SyncQueue.init(A, man.getFinalizedSlot(), wallSlot,
|
||||
man.chunkSize, man.syncUpdate,
|
||||
man.getFirstSlotAFE, 2)
|
||||
man.getFinalizedSlot, 2)
|
||||
|
||||
debug "Synchronization loop starting new worker", peer = peer,
|
||||
wall_head_slot = wallSlot, local_head_slot = headSlot,
|
||||
|
|
Loading…
Reference in New Issue