fix a few more things

This commit is contained in:
Agnish Ghosh 2024-11-14 11:14:40 +07:00
parent 7cb4e37120
commit f17f5ecf94
No known key found for this signature in database
GPG Key ID: 7BDDA05D1B25E9F8
2 changed files with 24 additions and 23 deletions

View File

@ -392,9 +392,10 @@ proc processDataColumnSidecar*(
debug "Data column validated, putting data column in quarantine" debug "Data column validated, putting data column in quarantine"
self.dataColumnQuarantine[].put(newClone(dataColumnSidecar)) self.dataColumnQuarantine[].put(newClone(dataColumnSidecar))
self.dag.db.putDataColumnSidecar(dataColumnSidecar) if self.dataColumnQuarantine[].supernode == false:
debug "Validated column belongs to custody, attempting to persist", self.dag.db.putDataColumnSidecar(dataColumnSidecar)
data_column = shortLog(dataColumnSidecar) debug "Validated column belongs to custody, attempting to persist",
data_column = shortLog(dataColumnSidecar)
let block_root = hash_tree_root(block_header) let block_root = hash_tree_root(block_header)
if (let o = self.quarantine[].popColumnless(block_root); o.isSome): if (let o = self.quarantine[].popColumnless(block_root); o.isSome):
@ -412,16 +413,16 @@ proc processDataColumnSidecar*(
Opt.none(BlobSidecars), Opt.none(BlobSidecars),
Opt.some(self.dataColumnQuarantine[].popDataColumns(block_root, forkyBlck))) Opt.some(self.dataColumnQuarantine[].popDataColumns(block_root, forkyBlck)))
elif self.dataColumnQuarantine[].hasEnoughDataColumns(forkyBlck): elif self.dataColumnQuarantine[].hasEnoughDataColumns(forkyBlck):
# let let
# columns = self.dataColumnQuarantine[].gatherDataColumns(block_root) columns = self.dataColumnQuarantine[].gatherDataColumns(block_root)
# if columns.len >= (NUMBER_OF_COLUMNS div 2) and if columns.len >= (NUMBER_OF_COLUMNS div 2) and
# self.dataColumnQuarantine[].supernode: self.dataColumnQuarantine[].supernode:
# let let
# reconstructed_columns = reconstructed_columns =
# self.processReconstructionFromGossip(forkyBlck, columns.mapIt(it[])) self.processReconstructionFromGossip(forkyBlck, columns.mapIt(it[]))
# for rc in reconstructed_columns.get: for rc in reconstructed_columns.get:
# if rc notin self.dataColumnQuarantine[].gatherDataColumns(block_root).mapIt(it[]): if rc notin self.dataColumnQuarantine[].gatherDataColumns(block_root).mapIt(it[]):
# self.dataColumnQuarantine[].put(newClone(rc)) self.dataColumnQuarantine[].put(newClone(rc))
self.blockProcessor[].enqueueBlock( self.blockProcessor[].enqueueBlock(
MsgSource.gossip, columnless, MsgSource.gossip, columnless,
Opt.none(BlobSidecars), Opt.none(BlobSidecars),

View File

@ -560,17 +560,17 @@ proc getMissingDataColumns(rman: RequestManager): seq[DataColumnIdentifier] =
if id.index in local_custody and id notin fetches and if id.index in local_custody and id notin fetches and
len(forkyBlck.message.body.blob_kzg_commitments) != 0: len(forkyBlck.message.body.blob_kzg_commitments) != 0:
fetches.add(id) fetches.add(id)
# else: else:
# # this is a programming error and it not should occur # this is a programming error and it not should occur
# warn "missing data column handler found columnless block with all data columns", warn "missing data column handler found columnless block with all data columns",
# blk = columnless.root, blk = columnless.root,
# commitments=len(forkyBlck.message.body.blob_kzg_commitments) commitments=len(forkyBlck.message.body.blob_kzg_commitments)
# ready.add(columnless.root) ready.add(columnless.root)
# for root in ready: for root in ready:
# let columnless = rman.quarantine[].popColumnless(root).valueOr: let columnless = rman.quarantine[].popColumnless(root).valueOr:
# continue continue
# discard rman.blockVerifier(columnless, false) discard rman.blockVerifier(columnless, false)
fetches fetches
proc requestManagerDataColumnLoop( proc requestManagerDataColumnLoop(