Remove blockBlobsVerifier (#4829)
Having a separate 'blockBlobsVerifier' function for post-Deneb blocks is no longer of any benefit. This commit removes it.
This commit is contained in:
parent
b51152153a
commit
8f2f40f0af
|
@ -330,8 +330,8 @@ proc initFullNode(
|
||||||
config.dumpEnabled, config.dumpDirInvalid, config.dumpDirIncoming,
|
config.dumpEnabled, config.dumpDirInvalid, config.dumpDirIncoming,
|
||||||
rng, taskpool, consensusManager, node.validatorMonitor,
|
rng, taskpool, consensusManager, node.validatorMonitor,
|
||||||
blobQuarantine, getBeaconTime)
|
blobQuarantine, getBeaconTime)
|
||||||
blockVerifier =
|
blockVerifier = proc(signedBlock: ForkedSignedBeaconBlock,
|
||||||
proc(signedBlock: ForkedSignedBeaconBlock, maybeFinalized: bool):
|
blobs: BlobSidecars, maybeFinalized: bool):
|
||||||
Future[Result[void, VerifierError]] =
|
Future[Result[void, VerifierError]] =
|
||||||
# The design with a callback for block verification is unusual compared
|
# The design with a callback for block verification is unusual compared
|
||||||
# to the rest of the application, but fits with the general approach
|
# to the rest of the application, but fits with the general approach
|
||||||
|
@ -339,22 +339,10 @@ proc initFullNode(
|
||||||
# that should probably be reimagined more holistically in the future.
|
# that should probably be reimagined more holistically in the future.
|
||||||
let resfut = newFuture[Result[void, VerifierError]]("blockVerifier")
|
let resfut = newFuture[Result[void, VerifierError]]("blockVerifier")
|
||||||
blockProcessor[].addBlock(MsgSource.gossip, signedBlock,
|
blockProcessor[].addBlock(MsgSource.gossip, signedBlock,
|
||||||
BlobSidecars @[],
|
blobs,
|
||||||
resfut,
|
resfut,
|
||||||
maybeFinalized = maybeFinalized)
|
maybeFinalized = maybeFinalized)
|
||||||
resfut
|
resfut
|
||||||
blockBlobsVerifier = proc(signedBlock: ForkedSignedBeaconBlock,
|
|
||||||
blobs: BlobSidecars,
|
|
||||||
maybeFinalized: bool):
|
|
||||||
Future[Result[void, VerifierError]] =
|
|
||||||
# The design with a callback for block verification is unusual compared
|
|
||||||
# to the rest of the application, but fits with the general approach
|
|
||||||
# taken in the sync/request managers - this is an architectural compromise
|
|
||||||
# that should probably be reimagined more holistically in the future.
|
|
||||||
let resfut = newFuture[Result[void, VerifierError]]("blockVerifier")
|
|
||||||
blockProcessor[].addBlock(MsgSource.gossip, signedBlock,
|
|
||||||
blobs, resfut, maybeFinalized = maybeFinalized)
|
|
||||||
resfut
|
|
||||||
processor = Eth2Processor.new(
|
processor = Eth2Processor.new(
|
||||||
config.doppelgangerDetection,
|
config.doppelgangerDetection,
|
||||||
blockProcessor, node.validatorMonitor, dag, attestationPool,
|
blockProcessor, node.validatorMonitor, dag, attestationPool,
|
||||||
|
@ -363,11 +351,11 @@ proc initFullNode(
|
||||||
syncManager = newSyncManager[Peer, PeerId](
|
syncManager = newSyncManager[Peer, PeerId](
|
||||||
node.network.peerPool, dag.cfg.DENEB_FORK_EPOCH, SyncQueueKind.Forward, getLocalHeadSlot,
|
node.network.peerPool, dag.cfg.DENEB_FORK_EPOCH, SyncQueueKind.Forward, getLocalHeadSlot,
|
||||||
getLocalWallSlot, getFirstSlotAtFinalizedEpoch, getBackfillSlot,
|
getLocalWallSlot, getFirstSlotAtFinalizedEpoch, getBackfillSlot,
|
||||||
getFrontfillSlot, dag.tail.slot, blockVerifier, blockBlobsVerifier)
|
getFrontfillSlot, dag.tail.slot, blockVerifier)
|
||||||
backfiller = newSyncManager[Peer, PeerId](
|
backfiller = newSyncManager[Peer, PeerId](
|
||||||
node.network.peerPool, dag.cfg.DENEB_FORK_EPOCH, SyncQueueKind.Backward, getLocalHeadSlot,
|
node.network.peerPool, dag.cfg.DENEB_FORK_EPOCH, SyncQueueKind.Backward, getLocalHeadSlot,
|
||||||
getLocalWallSlot, getFirstSlotAtFinalizedEpoch, getBackfillSlot,
|
getLocalWallSlot, getFirstSlotAtFinalizedEpoch, getBackfillSlot,
|
||||||
getFrontfillSlot, dag.backfill.slot, blockVerifier, blockBlobsVerifier,
|
getFrontfillSlot, dag.backfill.slot, blockVerifier,
|
||||||
maxHeadAge = 0)
|
maxHeadAge = 0)
|
||||||
router = (ref MessageRouter)(
|
router = (ref MessageRouter)(
|
||||||
processor: processor,
|
processor: processor,
|
||||||
|
|
|
@ -32,13 +32,9 @@ const
|
||||||
|
|
||||||
type
|
type
|
||||||
BlockVerifier* =
|
BlockVerifier* =
|
||||||
proc(signedBlock: ForkedSignedBeaconBlock, maybeFinalized: bool):
|
|
||||||
Future[Result[void, VerifierError]] {.gcsafe, raises: [Defect].}
|
|
||||||
BlockBlobsVerifier* =
|
|
||||||
proc(signedBlock: ForkedSignedBeaconBlock, blobs: BlobSidecars,
|
proc(signedBlock: ForkedSignedBeaconBlock, blobs: BlobSidecars,
|
||||||
maybeFinalized: bool):
|
maybeFinalized: bool):
|
||||||
Future[Result[void, VerifierError]] {.gcsafe, raises: [Defect].}
|
Future[Result[void, VerifierError]] {.gcsafe, raises: [Defect].}
|
||||||
|
|
||||||
RequestManager* = object
|
RequestManager* = object
|
||||||
network*: Eth2Node
|
network*: Eth2Node
|
||||||
inpQueue*: AsyncQueue[FetchRecord]
|
inpQueue*: AsyncQueue[FetchRecord]
|
||||||
|
@ -95,7 +91,9 @@ proc fetchAncestorBlocksFromNetwork(rman: RequestManager,
|
||||||
gotUnviableBlock = false
|
gotUnviableBlock = false
|
||||||
|
|
||||||
for b in ublocks:
|
for b in ublocks:
|
||||||
let ver = await rman.blockVerifier(b[], false)
|
let ver = await rman.blockVerifier(b[], BlobSidecars @[], false)
|
||||||
|
# TODO:
|
||||||
|
# blob handling for Deneb blocks
|
||||||
if ver.isErr():
|
if ver.isErr():
|
||||||
case ver.error()
|
case ver.error()
|
||||||
of VerifierError.MissingParent:
|
of VerifierError.MissingParent:
|
||||||
|
|
|
@ -64,7 +64,6 @@ type
|
||||||
queue: SyncQueue[A]
|
queue: SyncQueue[A]
|
||||||
syncFut: Future[void]
|
syncFut: Future[void]
|
||||||
blockVerifier: BlockVerifier
|
blockVerifier: BlockVerifier
|
||||||
blockBlobsVerifier: BlockBlobsVerifier
|
|
||||||
inProgress*: bool
|
inProgress*: bool
|
||||||
insSyncSpeed*: float
|
insSyncSpeed*: float
|
||||||
avgSyncSpeed*: float
|
avgSyncSpeed*: float
|
||||||
|
@ -99,8 +98,7 @@ proc initQueue[A, B](man: SyncManager[A, B]) =
|
||||||
man.queue = SyncQueue.init(A, man.direction, man.getFirstSlot(),
|
man.queue = SyncQueue.init(A, man.direction, man.getFirstSlot(),
|
||||||
man.getLastSlot(), man.chunkSize,
|
man.getLastSlot(), man.chunkSize,
|
||||||
man.getSafeSlot, man.blockVerifier,
|
man.getSafeSlot, man.blockVerifier,
|
||||||
man.blockBlobsVerifier, 1,
|
1, man.ident)
|
||||||
man.ident)
|
|
||||||
of SyncQueueKind.Backward:
|
of SyncQueueKind.Backward:
|
||||||
let
|
let
|
||||||
firstSlot = man.getFirstSlot()
|
firstSlot = man.getFirstSlot()
|
||||||
|
@ -113,8 +111,7 @@ proc initQueue[A, B](man: SyncManager[A, B]) =
|
||||||
Slot(firstSlot - 1'u64)
|
Slot(firstSlot - 1'u64)
|
||||||
man.queue = SyncQueue.init(A, man.direction, startSlot, lastSlot,
|
man.queue = SyncQueue.init(A, man.direction, startSlot, lastSlot,
|
||||||
man.chunkSize, man.getSafeSlot,
|
man.chunkSize, man.getSafeSlot,
|
||||||
man.blockVerifier, man.blockBlobsVerifier, 1,
|
man.blockVerifier, 1, man.ident)
|
||||||
man.ident)
|
|
||||||
|
|
||||||
proc newSyncManager*[A, B](pool: PeerPool[A, B],
|
proc newSyncManager*[A, B](pool: PeerPool[A, B],
|
||||||
denebEpoch: Epoch,
|
denebEpoch: Epoch,
|
||||||
|
@ -126,7 +123,6 @@ proc newSyncManager*[A, B](pool: PeerPool[A, B],
|
||||||
getFrontfillSlotCb: GetSlotCallback,
|
getFrontfillSlotCb: GetSlotCallback,
|
||||||
progressPivot: Slot,
|
progressPivot: Slot,
|
||||||
blockVerifier: BlockVerifier,
|
blockVerifier: BlockVerifier,
|
||||||
blockBlobsVerifier: BlockBlobsVerifier,
|
|
||||||
maxHeadAge = uint64(SLOTS_PER_EPOCH * 1),
|
maxHeadAge = uint64(SLOTS_PER_EPOCH * 1),
|
||||||
chunkSize = uint64(SLOTS_PER_EPOCH),
|
chunkSize = uint64(SLOTS_PER_EPOCH),
|
||||||
flags: set[SyncManagerFlag] = {},
|
flags: set[SyncManagerFlag] = {},
|
||||||
|
@ -150,7 +146,6 @@ proc newSyncManager*[A, B](pool: PeerPool[A, B],
|
||||||
maxHeadAge: maxHeadAge,
|
maxHeadAge: maxHeadAge,
|
||||||
chunkSize: chunkSize,
|
chunkSize: chunkSize,
|
||||||
blockVerifier: blockVerifier,
|
blockVerifier: blockVerifier,
|
||||||
blockBlobsVerifier: blockBlobsVerifier,
|
|
||||||
notInSyncEvent: newAsyncEvent(),
|
notInSyncEvent: newAsyncEvent(),
|
||||||
direction: direction,
|
direction: direction,
|
||||||
ident: ident,
|
ident: ident,
|
||||||
|
|
|
@ -25,12 +25,8 @@ logScope:
|
||||||
type
|
type
|
||||||
GetSlotCallback* = proc(): Slot {.gcsafe, raises: [Defect].}
|
GetSlotCallback* = proc(): Slot {.gcsafe, raises: [Defect].}
|
||||||
ProcessingCallback* = proc() {.gcsafe, raises: [Defect].}
|
ProcessingCallback* = proc() {.gcsafe, raises: [Defect].}
|
||||||
BlockVerifier* =
|
BlockVerifier* = proc(signedBlock: ForkedSignedBeaconBlock,
|
||||||
proc(signedBlock: ForkedSignedBeaconBlock, maybeFinalized: bool):
|
blobs: BlobSidecars, maybeFinalized: bool):
|
||||||
Future[Result[void, VerifierError]] {.gcsafe, raises: [Defect].}
|
|
||||||
BlockBlobsVerifier* =
|
|
||||||
proc(signedBlock: ForkedSignedBeaconBlock, blobs: BlobSidecars,
|
|
||||||
maybeFinalized: bool):
|
|
||||||
Future[Result[void, VerifierError]] {.gcsafe, raises: [Defect].}
|
Future[Result[void, VerifierError]] {.gcsafe, raises: [Defect].}
|
||||||
|
|
||||||
SyncQueueKind* {.pure.} = enum
|
SyncQueueKind* {.pure.} = enum
|
||||||
|
@ -79,7 +75,6 @@ type
|
||||||
readyQueue: HeapQueue[SyncResult[T]]
|
readyQueue: HeapQueue[SyncResult[T]]
|
||||||
rewind: Option[RewindPoint]
|
rewind: Option[RewindPoint]
|
||||||
blockVerifier: BlockVerifier
|
blockVerifier: BlockVerifier
|
||||||
blockBlobsVerifier: BlockBlobsVerifier
|
|
||||||
ident*: string
|
ident*: string
|
||||||
|
|
||||||
chronicles.formatIt SyncQueueKind: toLowerAscii($it)
|
chronicles.formatIt SyncQueueKind: toLowerAscii($it)
|
||||||
|
@ -198,7 +193,6 @@ proc init*[T](t1: typedesc[SyncQueue], t2: typedesc[T],
|
||||||
start, final: Slot, chunkSize: uint64,
|
start, final: Slot, chunkSize: uint64,
|
||||||
getSafeSlotCb: GetSlotCallback,
|
getSafeSlotCb: GetSlotCallback,
|
||||||
blockVerifier: BlockVerifier,
|
blockVerifier: BlockVerifier,
|
||||||
blockBlobsVerifier: BlockBlobsVerifier,
|
|
||||||
syncQueueSize: int = -1,
|
syncQueueSize: int = -1,
|
||||||
ident: string = "main"): SyncQueue[T] =
|
ident: string = "main"): SyncQueue[T] =
|
||||||
## Create new synchronization queue with parameters
|
## Create new synchronization queue with parameters
|
||||||
|
@ -270,7 +264,6 @@ proc init*[T](t1: typedesc[SyncQueue], t2: typedesc[T],
|
||||||
inpSlot: start,
|
inpSlot: start,
|
||||||
outSlot: start,
|
outSlot: start,
|
||||||
blockVerifier: blockVerifier,
|
blockVerifier: blockVerifier,
|
||||||
blockBlobsVerifier: blockBlobsVerifier,
|
|
||||||
ident: ident
|
ident: ident
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -684,9 +677,9 @@ proc push*[T](sq: SyncQueue[T], sr: SyncRequest[T],
|
||||||
var i=0
|
var i=0
|
||||||
for blk in sq.blocks(item):
|
for blk in sq.blocks(item):
|
||||||
if reqres.get().blobs.isNone():
|
if reqres.get().blobs.isNone():
|
||||||
res = await sq.blockVerifier(blk[], maybeFinalized)
|
res = await sq.blockVerifier(blk[], BlobSidecars @[], maybeFinalized)
|
||||||
else:
|
else:
|
||||||
res = await sq.blockBlobsVerifier(blk[], reqres.get().blobs.get()[i], maybeFinalized)
|
res = await sq.blockVerifier(blk[], reqres.get().blobs.get()[i], maybeFinalized)
|
||||||
inc(i)
|
inc(i)
|
||||||
|
|
||||||
if res.isOk():
|
if res.isOk():
|
||||||
|
|
|
@ -49,7 +49,8 @@ proc collector(queue: AsyncQueue[BlockEntry]): BlockVerifier =
|
||||||
# in the async queue, similar to how BlockProcessor does it - as far as
|
# in the async queue, similar to how BlockProcessor does it - as far as
|
||||||
# testing goes, this is risky because it might introduce differences between
|
# testing goes, this is risky because it might introduce differences between
|
||||||
# the BlockProcessor and this test
|
# the BlockProcessor and this test
|
||||||
proc verify(signedBlock: ForkedSignedBeaconBlock, maybeFinalized: bool):
|
proc verify(signedBlock: ForkedSignedBeaconBlock, blobs: BlobSidecars,
|
||||||
|
maybeFinalized: bool):
|
||||||
Future[Result[void, VerifierError]] =
|
Future[Result[void, VerifierError]] =
|
||||||
let fut = newFuture[Result[void, VerifierError]]()
|
let fut = newFuture[Result[void, VerifierError]]()
|
||||||
try: queue.addLastNoWait(BlockEntry(blck: signedBlock, resfut: fut))
|
try: queue.addLastNoWait(BlockEntry(blck: signedBlock, resfut: fut))
|
||||||
|
@ -94,7 +95,7 @@ suite "SyncManager test suite":
|
||||||
var queue = SyncQueue.init(SomeTPeer, kind,
|
var queue = SyncQueue.init(SomeTPeer, kind,
|
||||||
Slot(0), Slot(0), 1'u64,
|
Slot(0), Slot(0), 1'u64,
|
||||||
getStaticSlotCb(Slot(0)),
|
getStaticSlotCb(Slot(0)),
|
||||||
collector(aq), nil)
|
collector(aq))
|
||||||
check:
|
check:
|
||||||
len(queue) == 1
|
len(queue) == 1
|
||||||
pendingLen(queue) == 0
|
pendingLen(queue) == 0
|
||||||
|
@ -190,7 +191,7 @@ suite "SyncManager test suite":
|
||||||
var queue = SyncQueue.init(SomeTPeer, kind,
|
var queue = SyncQueue.init(SomeTPeer, kind,
|
||||||
item[0], item[1], item[2],
|
item[0], item[1], item[2],
|
||||||
getStaticSlotCb(item[0]),
|
getStaticSlotCb(item[0]),
|
||||||
collector(aq), nil)
|
collector(aq))
|
||||||
check:
|
check:
|
||||||
len(queue) == item[4]
|
len(queue) == item[4]
|
||||||
pendingLen(queue) == item[5]
|
pendingLen(queue) == item[5]
|
||||||
|
@ -214,11 +215,11 @@ suite "SyncManager test suite":
|
||||||
of SyncQueueKind.Forward:
|
of SyncQueueKind.Forward:
|
||||||
SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
||||||
Slot(0), Slot(1), 1'u64,
|
Slot(0), Slot(1), 1'u64,
|
||||||
getStaticSlotCb(Slot(0)), collector(aq), nil)
|
getStaticSlotCb(Slot(0)), collector(aq))
|
||||||
of SyncQueueKind.Backward:
|
of SyncQueueKind.Backward:
|
||||||
SyncQueue.init(SomeTPeer, SyncQueueKind.Backward,
|
SyncQueue.init(SomeTPeer, SyncQueueKind.Backward,
|
||||||
Slot(1), Slot(0), 1'u64,
|
Slot(1), Slot(0), 1'u64,
|
||||||
getStaticSlotCb(Slot(1)), collector(aq), nil)
|
getStaticSlotCb(Slot(1)), collector(aq))
|
||||||
|
|
||||||
let p1 = SomeTPeer()
|
let p1 = SomeTPeer()
|
||||||
let p2 = SomeTPeer()
|
let p2 = SomeTPeer()
|
||||||
|
@ -312,11 +313,11 @@ suite "SyncManager test suite":
|
||||||
of SyncQueueKind.Forward:
|
of SyncQueueKind.Forward:
|
||||||
SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
||||||
start, finish, chunkSize,
|
start, finish, chunkSize,
|
||||||
getStaticSlotCb(start), collector(aq), nil)
|
getStaticSlotCb(start), collector(aq))
|
||||||
of SyncQueueKind.Backward:
|
of SyncQueueKind.Backward:
|
||||||
SyncQueue.init(SomeTPeer, SyncQueueKind.Backward,
|
SyncQueue.init(SomeTPeer, SyncQueueKind.Backward,
|
||||||
finish, start, chunkSize,
|
finish, start, chunkSize,
|
||||||
getStaticSlotCb(finish), collector(aq), nil)
|
getStaticSlotCb(finish), collector(aq))
|
||||||
chain = createChain(start, finish)
|
chain = createChain(start, finish)
|
||||||
validatorFut =
|
validatorFut =
|
||||||
case kkind
|
case kkind
|
||||||
|
@ -383,12 +384,12 @@ suite "SyncManager test suite":
|
||||||
of SyncQueueKind.Forward:
|
of SyncQueueKind.Forward:
|
||||||
SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
||||||
startSlot, finishSlot, chunkSize,
|
startSlot, finishSlot, chunkSize,
|
||||||
getStaticSlotCb(startSlot), collector(aq), nil,
|
getStaticSlotCb(startSlot), collector(aq),
|
||||||
queueSize)
|
queueSize)
|
||||||
of SyncQueueKind.Backward:
|
of SyncQueueKind.Backward:
|
||||||
SyncQueue.init(SomeTPeer, SyncQueueKind.Backward,
|
SyncQueue.init(SomeTPeer, SyncQueueKind.Backward,
|
||||||
finishSlot, startSlot, chunkSize,
|
finishSlot, startSlot, chunkSize,
|
||||||
getStaticSlotCb(finishSlot), collector(aq), nil,
|
getStaticSlotCb(finishSlot), collector(aq),
|
||||||
queueSize)
|
queueSize)
|
||||||
validatorFut =
|
validatorFut =
|
||||||
case kkind
|
case kkind
|
||||||
|
@ -491,11 +492,11 @@ suite "SyncManager test suite":
|
||||||
of SyncQueueKind.Forward:
|
of SyncQueueKind.Forward:
|
||||||
SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
||||||
start, finish, chunkSize,
|
start, finish, chunkSize,
|
||||||
getFowardSafeSlotCb, collector(aq), nil)
|
getFowardSafeSlotCb, collector(aq))
|
||||||
of SyncQueueKind.Backward:
|
of SyncQueueKind.Backward:
|
||||||
SyncQueue.init(SomeTPeer, SyncQueueKind.Backward,
|
SyncQueue.init(SomeTPeer, SyncQueueKind.Backward,
|
||||||
finish, start, chunkSize,
|
finish, start, chunkSize,
|
||||||
getBackwardSafeSlotCb, collector(aq), nil)
|
getBackwardSafeSlotCb, collector(aq))
|
||||||
chain = createChain(start, finish)
|
chain = createChain(start, finish)
|
||||||
validatorFut =
|
validatorFut =
|
||||||
case kkind
|
case kkind
|
||||||
|
@ -584,11 +585,11 @@ suite "SyncManager test suite":
|
||||||
of SyncQueueKind.Forward:
|
of SyncQueueKind.Forward:
|
||||||
SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
||||||
start, finish, chunkSize,
|
start, finish, chunkSize,
|
||||||
getFowardSafeSlotCb, collector(aq), nil)
|
getFowardSafeSlotCb, collector(aq))
|
||||||
of SyncQueueKind.Backward:
|
of SyncQueueKind.Backward:
|
||||||
SyncQueue.init(SomeTPeer, SyncQueueKind.Backward,
|
SyncQueue.init(SomeTPeer, SyncQueueKind.Backward,
|
||||||
finish, start, chunkSize,
|
finish, start, chunkSize,
|
||||||
getBackwardSafeSlotCb, collector(aq), nil)
|
getBackwardSafeSlotCb, collector(aq))
|
||||||
chain = createChain(start, finish)
|
chain = createChain(start, finish)
|
||||||
validatorFut = failingValidator(aq)
|
validatorFut = failingValidator(aq)
|
||||||
|
|
||||||
|
@ -735,7 +736,7 @@ suite "SyncManager test suite":
|
||||||
chain = createChain(startSlot, finishSlot)
|
chain = createChain(startSlot, finishSlot)
|
||||||
queue = SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
queue = SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
||||||
startSlot, finishSlot, chunkSize,
|
startSlot, finishSlot, chunkSize,
|
||||||
getStaticSlotCb(startSlot), collector(aq), nil,
|
getStaticSlotCb(startSlot), collector(aq),
|
||||||
queueSize)
|
queueSize)
|
||||||
validatorFut = forwardValidator(aq)
|
validatorFut = forwardValidator(aq)
|
||||||
|
|
||||||
|
@ -850,7 +851,7 @@ suite "SyncManager test suite":
|
||||||
chain = createChain(startSlot, finishSlot)
|
chain = createChain(startSlot, finishSlot)
|
||||||
queue = SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
queue = SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
||||||
startSlot, finishSlot, chunkSize,
|
startSlot, finishSlot, chunkSize,
|
||||||
getStaticSlotCb(startSlot), collector(aq), nil,
|
getStaticSlotCb(startSlot), collector(aq),
|
||||||
queueSize)
|
queueSize)
|
||||||
validatorFut = forwardValidator(aq)
|
validatorFut = forwardValidator(aq)
|
||||||
|
|
||||||
|
@ -909,7 +910,7 @@ suite "SyncManager test suite":
|
||||||
chain = createChain(startSlot, finishSlot)
|
chain = createChain(startSlot, finishSlot)
|
||||||
queue = SyncQueue.init(SomeTPeer, SyncQueueKind.Backward,
|
queue = SyncQueue.init(SomeTPeer, SyncQueueKind.Backward,
|
||||||
finishSlot, startSlot, chunkSize,
|
finishSlot, startSlot, chunkSize,
|
||||||
getSafeSlot, collector(aq), nil, queueSize)
|
getSafeSlot, collector(aq), queueSize)
|
||||||
validatorFut = backwardValidator(aq)
|
validatorFut = backwardValidator(aq)
|
||||||
|
|
||||||
let
|
let
|
||||||
|
@ -1097,7 +1098,7 @@ suite "SyncManager test suite":
|
||||||
var queue = SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
var queue = SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
||||||
Slot(0), Slot(0xFFFF_FFFF_FFFF_FFFFF'u64),
|
Slot(0), Slot(0xFFFF_FFFF_FFFF_FFFFF'u64),
|
||||||
1'u64, getStaticSlotCb(Slot(0)),
|
1'u64, getStaticSlotCb(Slot(0)),
|
||||||
collector(aq), nil, 2)
|
collector(aq), 2)
|
||||||
let finalizedSlot = start_slot(Epoch(0'u64))
|
let finalizedSlot = start_slot(Epoch(0'u64))
|
||||||
let startSlot = start_slot(Epoch(0'u64)) + 1'u64
|
let startSlot = start_slot(Epoch(0'u64)) + 1'u64
|
||||||
let finishSlot = start_slot(Epoch(2'u64))
|
let finishSlot = start_slot(Epoch(2'u64))
|
||||||
|
@ -1109,7 +1110,7 @@ suite "SyncManager test suite":
|
||||||
var queue = SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
var queue = SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
||||||
Slot(0), Slot(0xFFFF_FFFF_FFFF_FFFFF'u64),
|
Slot(0), Slot(0xFFFF_FFFF_FFFF_FFFFF'u64),
|
||||||
1'u64, getStaticSlotCb(Slot(0)),
|
1'u64, getStaticSlotCb(Slot(0)),
|
||||||
collector(aq), nil, 2)
|
collector(aq), 2)
|
||||||
let finalizedSlot = start_slot(Epoch(1'u64))
|
let finalizedSlot = start_slot(Epoch(1'u64))
|
||||||
let startSlot = start_slot(Epoch(1'u64)) + 1'u64
|
let startSlot = start_slot(Epoch(1'u64)) + 1'u64
|
||||||
let finishSlot = start_slot(Epoch(3'u64))
|
let finishSlot = start_slot(Epoch(3'u64))
|
||||||
|
@ -1121,7 +1122,7 @@ suite "SyncManager test suite":
|
||||||
var queue = SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
var queue = SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
||||||
Slot(0), Slot(0xFFFF_FFFF_FFFF_FFFFF'u64),
|
Slot(0), Slot(0xFFFF_FFFF_FFFF_FFFFF'u64),
|
||||||
1'u64, getStaticSlotCb(Slot(0)),
|
1'u64, getStaticSlotCb(Slot(0)),
|
||||||
collector(aq), nil, 2)
|
collector(aq), 2)
|
||||||
let finalizedSlot = start_slot(Epoch(0'u64))
|
let finalizedSlot = start_slot(Epoch(0'u64))
|
||||||
let failSlot = Slot(0xFFFF_FFFF_FFFF_FFFFF'u64)
|
let failSlot = Slot(0xFFFF_FFFF_FFFF_FFFFF'u64)
|
||||||
let failEpoch = epoch(failSlot)
|
let failEpoch = epoch(failSlot)
|
||||||
|
@ -1139,7 +1140,7 @@ suite "SyncManager test suite":
|
||||||
var queue = SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
var queue = SyncQueue.init(SomeTPeer, SyncQueueKind.Forward,
|
||||||
Slot(0), Slot(0xFFFF_FFFF_FFFF_FFFFF'u64),
|
Slot(0), Slot(0xFFFF_FFFF_FFFF_FFFFF'u64),
|
||||||
1'u64, getStaticSlotCb(Slot(0)),
|
1'u64, getStaticSlotCb(Slot(0)),
|
||||||
collector(aq), nil, 2)
|
collector(aq), 2)
|
||||||
let finalizedSlot = start_slot(Epoch(1'u64))
|
let finalizedSlot = start_slot(Epoch(1'u64))
|
||||||
let failSlot = Slot(0xFFFF_FFFF_FFFF_FFFFF'u64)
|
let failSlot = Slot(0xFFFF_FFFF_FFFF_FFFFF'u64)
|
||||||
let failEpoch = epoch(failSlot)
|
let failEpoch = epoch(failSlot)
|
||||||
|
@ -1158,7 +1159,7 @@ suite "SyncManager test suite":
|
||||||
let getSafeSlot = getStaticSlotCb(Slot(1024))
|
let getSafeSlot = getStaticSlotCb(Slot(1024))
|
||||||
var queue = SyncQueue.init(SomeTPeer, SyncQueueKind.Backward,
|
var queue = SyncQueue.init(SomeTPeer, SyncQueueKind.Backward,
|
||||||
Slot(1024), Slot(0),
|
Slot(1024), Slot(0),
|
||||||
1'u64, getSafeSlot, collector(aq), nil, 2)
|
1'u64, getSafeSlot, collector(aq), 2)
|
||||||
let safeSlot = getSafeSlot()
|
let safeSlot = getSafeSlot()
|
||||||
for i in countdown(1023, 0):
|
for i in countdown(1023, 0):
|
||||||
check queue.getRewindPoint(Slot(i), safeSlot) == safeSlot
|
check queue.getRewindPoint(Slot(i), safeSlot) == safeSlot
|
||||||
|
|
Loading…
Reference in New Issue