diff --git a/beacon_chain/nimbus_beacon_node.nim b/beacon_chain/nimbus_beacon_node.nim index 15a5aa40d..feb8f9e9d 100644 --- a/beacon_chain/nimbus_beacon_node.nim +++ b/beacon_chain/nimbus_beacon_node.nim @@ -1411,6 +1411,24 @@ proc pruneBlobs(node: BeaconNode, slot: Slot) = count = count + 1 debug "pruned blobs", count, blobPruneEpoch +proc pruneDataColumns(node: BeaconNode, slot: Slot) = + let dataColumnPruneEpoch = (slot.epoch - + node.dag.cfg.MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS - 1) + if slot.is_epoch() and dataColumnPruneEpoch >= node.dag.cfg.DENEB_FORK_EPOCH: + var blocks: array[SLOTS_PER_EPOCH.int, BlockId] + var count = 0 + let startIndex = node.dag.getBlockRange( + dataColumnPruneEpoch.start_slot, 1, blocks.toopenArray(0, SLOTS_PER_EPOCH - 1)) + for i in startIndex..