changed DA conditions

This commit is contained in:
Agnish Ghosh 2024-11-13 17:34:08 +07:00
parent 806d0a09cf
commit 916f9c0638
No known key found for this signature in database
GPG Key ID: 7BDDA05D1B25E9F8
1 changed files with 36 additions and 9 deletions

View File

@ -412,23 +412,50 @@ proc initFullNode(
Future[Result[void, VerifierError]] {.async: (raises: [CancelledError]).} =
withBlck(signedBlock):
when consensusFork >= ConsensusFork.Deneb:
if not dataColumnQuarantine[].checkForInitialDcSidecars(forkyBlck):
# We effectively check for whether there were blob transactions
# against this block or not, if we don't see all the blob kzg
# commitments there were no blobs known.
let
localSubnetCount =
if supernode:
DATA_COLUMN_SIDECAR_SUBNET_COUNT.uint64
else:
CUSTODY_REQUIREMENT.uint64
localCustodyColumns = get_custody_columns(node.network.nodeId,
max(SAMPLES_PER_SLOT.uint64,
localSubnetCount))
accumulatedColumns = dataColumnQuarantine[].accumulateDataColumns(forkyBlck)
if accumulatedColumns.len == 0:
return await blockProcessor[].addBlock(MsgSource.gossip, signedBlock,
Opt.none(BlobSidecars), Opt.none(DataColumnSidecars),
maybeFinalized = maybeFinalized)
elif supernode == true and accumulatedColumns.len <= localCustodyColumns.len div 2 :
# 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):
err(VerifierError.UnviableFork)
return err(VerifierError.UnviableFork)
else:
err(VerifierError.MissingParent)
else:
return err(VerifierError.MissingParent)
elif supernode == true and accumulatedColumns.len == localCustodyColumns.len:
let data_columns = dataColumnQuarantine[].popDataColumns(forkyBlck.root, forkyBlck)
await blockProcessor[].addBlock(MsgSource.gossip, signedBlock,
return await blockProcessor[].addBlock(MsgSource.gossip, signedBlock,
Opt.none(BlobSidecars), Opt.some(data_columns),
maybeFinalized = maybeFinalized)
elif supernode == true and accumulatedColumns.len >= localCustodyColumns.len div 2:
let data_columns = dataColumnQuarantine[].popDataColumns(forkyBlck.root, forkyBlck)
return await blockProcessor[].addBlock(MsgSource.gossip, signedBlock,
Opt.none(BlobSidecars), Opt.some(data_columns),
maybeFinalized = maybeFinalized)
elif supernode == false and accumulatedColumns.len <= localCustodyColumns.len:
# 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):
return err(VerifierError.UnviableFork)
else:
return err(VerifierError.MissingParent)
else:
return await blockProcessor[].addBlock(MsgSource.gossip, signedBlock,
Opt.none(BlobSidecars), Opt.none(DataColumnSidecars),
maybeFinalized = maybeFinalized)
else:
await blockProcessor[].addBlock(MsgSource.gossip, signedBlock,
return await blockProcessor[].addBlock(MsgSource.gossip, signedBlock,
Opt.none(BlobSidecars), Opt.none(DataColumnSidecars),
maybeFinalized = maybeFinalized)