dc quarantine activation, keeping blobs compatible
This commit is contained in:
parent
ca3bd3eeee
commit
742669052a
|
@ -407,26 +407,20 @@ proc initFullNode(
|
|||
maybeFinalized: bool):
|
||||
Future[Result[void, VerifierError]] {.async: (raises: [CancelledError]).} =
|
||||
withBlck(signedBlock):
|
||||
# when consensusFork >= ConsensusFork.Deneb:
|
||||
# if not blobQuarantine[].hasBlobs(forkyBlck):
|
||||
# # We don't have all the blobs for this block, so we have
|
||||
# # to put it in blobless quarantine.
|
||||
# if not quarantine[].addBlobless(dag.finalizedHead.slot, forkyBlck):
|
||||
# err(VerifierError.UnviableFork)
|
||||
# else:
|
||||
# err(VerifierError.MissingParent)
|
||||
# else:
|
||||
# let blobs = blobQuarantine[].popBlobs(forkyBlck.root, forkyBlck)
|
||||
# await blockProcessor[].addBlock(MsgSource.gossip, signedBlock,
|
||||
# Opt.some(blobs), Opt.none(DataColumnSidecars),
|
||||
# maybeFinalized = maybeFinalized)
|
||||
# else:
|
||||
# await blockProcessor[].addBlock(MsgSource.gossip, signedBlock,
|
||||
# Opt.none(BlobSidecars), Opt.none(DataColumnSidecars),
|
||||
# maybeFinalized = maybeFinalized)
|
||||
|
||||
when consensusFork >= ConsensusFork.Deneb:
|
||||
if not dataColumnQuarantine[].hasDataColumns(forkyBlck):
|
||||
if not blobQuarantine[].hasBlobs(forkyBlck):
|
||||
# We don't have all the blobs for this block, so we have
|
||||
# to put it in blobless quarantine.
|
||||
if not quarantine[].addBlobless(dag.finalizedHead.slot, forkyBlck):
|
||||
err(VerifierError.UnviableFork)
|
||||
else:
|
||||
err(VerifierError.MissingParent)
|
||||
elif blobQuarantine[].hasBlobs(forkyBlck):
|
||||
let blobs = blobQuarantine[].popBlobs(forkyBlck.root, forkyBlck)
|
||||
await blockProcessor[].addBlock(MsgSource.gossip, signedBlock,
|
||||
Opt.some(blobs), Opt.none(DataColumnSidecars),
|
||||
maybeFinalized = maybeFinalized)
|
||||
elif not dataColumnQuarantine[].hasDataColumns(forkyBlck):
|
||||
# We don't have all the data columns for this block, so we have
|
||||
# to put it in columnless quarantine.
|
||||
if not quarantine[].addColumnless(dag.finalizedHead.slot, forkyBlck):
|
||||
|
|
|
@ -133,6 +133,28 @@ proc getShortMap*[T](req: SyncRequest[T],
|
|||
res.add('|')
|
||||
res
|
||||
|
||||
proc getShortMap*[T](req: SyncRequest[T],
|
||||
data: openArray[ref DataColumnSidecar]): string =
|
||||
# Returns all slot numbers in ``data`` as a placement map
|
||||
var
|
||||
res = newStringOfCap(req.count * MAX_BLOBS_PER_BLOCK)
|
||||
cur: uint64 = 0
|
||||
for slot in req.slot..<req.slot+req.count:
|
||||
if cur >= lenu64(data):
|
||||
res.add('|')
|
||||
continue
|
||||
if slot == data[cur].signed_block_header.message.slot:
|
||||
for k in cur..<cur+MAX_BLOBS_PER_BLOCK:
|
||||
if k >= lenu64(data) or slot != data[k].signed_block_header.message.slot:
|
||||
res.add('|')
|
||||
break
|
||||
else:
|
||||
inc(cur)
|
||||
res.add('|')
|
||||
else:
|
||||
res.add('|')
|
||||
res
|
||||
|
||||
proc contains*[T](req: SyncRequest[T], slot: Slot): bool {.inline.} =
|
||||
slot >= req.slot and slot < req.slot + req.count
|
||||
|
||||
|
|
Loading…
Reference in New Issue