diff --git a/beacon_chain/nimbus_beacon_node.nim b/beacon_chain/nimbus_beacon_node.nim index 820bbdaba..663efdcd0 100644 --- a/beacon_chain/nimbus_beacon_node.nim +++ b/beacon_chain/nimbus_beacon_node.nim @@ -1149,6 +1149,24 @@ proc updateGossipStatus(node: BeaconNode, slot: Slot) {.async.} = node.updateBlocksGossipStatus(slot, isBehind) node.updateLightClientGossipStatus(slot, isBehind) +proc pruneBlobs(node: BeaconNode, slot: Slot) = + let blobPruneEpoch = (slot.epoch - + MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS - 1) + if slot.is_epoch() and blobPruneEpoch >= node.dag.cfg.DENEB_FORK_EPOCH: + var blocks: array[SLOTS_PER_EPOCH.int, BlockId] + var count = 0 + let startIndex = node.dag.getBlockRange( + blobPruneEpoch.start_slot, 1, blocks.toOpenArray(0, SLOTS_PER_EPOCH - 1)) + for i in startIndex..= node.dag.cfg.DENEB_FORK_EPOCH: - var blocks: array[SLOTS_PER_EPOCH.int, BlockId] - var count = 0 - let - startIndex = node.dag.getBlockRange(blobPruneEpoch.start_slot, 1, - blocks.toOpenArray(0, SLOTS_PER_EPOCH - 1)) - for i in startIndex..