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