From f17f5ecf948090bfbc22b80e879f09287b00a09b Mon Sep 17 00:00:00 2001 From: Agnish Ghosh Date: Thu, 14 Nov 2024 11:14:40 +0700 Subject: [PATCH] fix a few more things --- .../gossip_processing/eth2_processor.nim | 27 ++++++++++--------- beacon_chain/sync/request_manager.nim | 20 +++++++------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/beacon_chain/gossip_processing/eth2_processor.nim b/beacon_chain/gossip_processing/eth2_processor.nim index 8a88b4b42..3274f44fd 100644 --- a/beacon_chain/gossip_processing/eth2_processor.nim +++ b/beacon_chain/gossip_processing/eth2_processor.nim @@ -392,9 +392,10 @@ proc processDataColumnSidecar*( debug "Data column validated, putting data column in quarantine" self.dataColumnQuarantine[].put(newClone(dataColumnSidecar)) - self.dag.db.putDataColumnSidecar(dataColumnSidecar) - debug "Validated column belongs to custody, attempting to persist", - data_column = shortLog(dataColumnSidecar) + if self.dataColumnQuarantine[].supernode == false: + self.dag.db.putDataColumnSidecar(dataColumnSidecar) + debug "Validated column belongs to custody, attempting to persist", + data_column = shortLog(dataColumnSidecar) let block_root = hash_tree_root(block_header) if (let o = self.quarantine[].popColumnless(block_root); o.isSome): @@ -412,16 +413,16 @@ proc processDataColumnSidecar*( Opt.none(BlobSidecars), Opt.some(self.dataColumnQuarantine[].popDataColumns(block_root, forkyBlck))) elif self.dataColumnQuarantine[].hasEnoughDataColumns(forkyBlck): - # let - # columns = self.dataColumnQuarantine[].gatherDataColumns(block_root) - # if columns.len >= (NUMBER_OF_COLUMNS div 2) and - # self.dataColumnQuarantine[].supernode: - # let - # reconstructed_columns = - # self.processReconstructionFromGossip(forkyBlck, columns.mapIt(it[])) - # for rc in reconstructed_columns.get: - # if rc notin self.dataColumnQuarantine[].gatherDataColumns(block_root).mapIt(it[]): - # self.dataColumnQuarantine[].put(newClone(rc)) + let + columns = self.dataColumnQuarantine[].gatherDataColumns(block_root) + if columns.len >= (NUMBER_OF_COLUMNS div 2) and + self.dataColumnQuarantine[].supernode: + let + reconstructed_columns = + self.processReconstructionFromGossip(forkyBlck, columns.mapIt(it[])) + for rc in reconstructed_columns.get: + if rc notin self.dataColumnQuarantine[].gatherDataColumns(block_root).mapIt(it[]): + self.dataColumnQuarantine[].put(newClone(rc)) self.blockProcessor[].enqueueBlock( MsgSource.gossip, columnless, Opt.none(BlobSidecars), diff --git a/beacon_chain/sync/request_manager.nim b/beacon_chain/sync/request_manager.nim index ed1cf2a24..40adddb08 100644 --- a/beacon_chain/sync/request_manager.nim +++ b/beacon_chain/sync/request_manager.nim @@ -560,17 +560,17 @@ proc getMissingDataColumns(rman: RequestManager): seq[DataColumnIdentifier] = if id.index in local_custody and id notin fetches and len(forkyBlck.message.body.blob_kzg_commitments) != 0: fetches.add(id) - # else: - # # this is a programming error and it not should occur - # warn "missing data column handler found columnless block with all data columns", - # blk = columnless.root, - # commitments=len(forkyBlck.message.body.blob_kzg_commitments) - # ready.add(columnless.root) + else: + # this is a programming error and it not should occur + warn "missing data column handler found columnless block with all data columns", + blk = columnless.root, + commitments=len(forkyBlck.message.body.blob_kzg_commitments) + ready.add(columnless.root) - # for root in ready: - # let columnless = rman.quarantine[].popColumnless(root).valueOr: - # continue - # discard rman.blockVerifier(columnless, false) + for root in ready: + let columnless = rman.quarantine[].popColumnless(root).valueOr: + continue + discard rman.blockVerifier(columnless, false) fetches proc requestManagerDataColumnLoop(