From f0cae305d638768a0c680435009a468bbf244660 Mon Sep 17 00:00:00 2001 From: Agnish Ghosh Date: Wed, 19 Jun 2024 20:42:31 +0530 Subject: [PATCH] add: pruneDataColumns at the end of slot --- beacon_chain/nimbus_beacon_node.nim | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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..