diff --git a/beacon_chain/gossip_processing/block_processor.nim b/beacon_chain/gossip_processing/block_processor.nim index 47308b51b..bf992b165 100644 --- a/beacon_chain/gossip_processing/block_processor.nim +++ b/beacon_chain/gossip_processing/block_processor.nim @@ -700,12 +700,12 @@ proc storeBlock( for b in blobs: self.consensusManager.dag.db.putBlobSidecar(b[]) - # # write data columns now that block has been written. - # let data_columns = dataColumnsOpt.valueOr: DataColumnSidecars @[] - # for c in data_columns: - # self.consensusManager.dag.db.putDataColumnSidecar(c[]) - # debug "Data column written to database!", - # data_column = shortLog(c[]) + # write data columns now that block has been written. + let data_columns = dataColumnsOpt.valueOr: DataColumnSidecars @[] + for c in data_columns: + self.consensusManager.dag.db.putDataColumnSidecar(c[]) + debug "Data column written to database!", + data_column = shortLog(c[]) let addHeadBlockTick = Moment.now() diff --git a/beacon_chain/validators/message_router.nim b/beacon_chain/validators/message_router.nim index 172d1cc84..716b53d96 100644 --- a/beacon_chain/validators/message_router.nim +++ b/beacon_chain/validators/message_router.nim @@ -208,7 +208,13 @@ proc routeSignedBeaconBlock*( data_column = shortLog(data_columns[i]), error = res.error[] else: notice "Data columns sent", data_column = shortLog(dataColumnsOpt[].get()[i]) - dataColumnRefs = Opt.some(dataColumnsOpt[].get().mapIt(newClone(it))) + let + metadata = router[].network.metadata.custody_subnet_count.uint64 + custody_columns = router[].network.nodeId.get_custody_columns(metadata) + + for dc in data_columns: + if dc.index in custody_columns.get: + let dataColumnRefs = Opt.some(dataColumnsOpt[].get().mapIt(newClone(it))) let added = await router[].blockProcessor[].addBlock( MsgSource.api, ForkedSignedBeaconBlock.init(blck), blobRefs, dataColumnRefs)