From b5abfe620a12bb9ac9c1a2819c89422d7995f244 Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Mon, 16 Jan 2023 08:35:09 +0100 Subject: [PATCH] Convert epochs_per_blob_prune to Epoch once --- beacon_node/src/config.rs | 3 ++- beacon_node/store/src/hot_cold_store.rs | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/beacon_node/src/config.rs b/beacon_node/src/config.rs index 14d40db03..6758ba3b4 100644 --- a/beacon_node/src/config.rs +++ b/beacon_node/src/config.rs @@ -418,7 +418,8 @@ pub fn get_config( if let Some(epochs_per_blob_prune) = clap_utils::parse_optional(cli_args, "epochs-per-blob-prune")? { - client_config.store.epochs_per_blob_prune = epochs_per_blob_prune; + client_config.store.epochs_per_blob_prune = + Epoch::new(epochs_per_blob_prune * E::slots_per_epoch()); } /* diff --git a/beacon_node/store/src/hot_cold_store.rs b/beacon_node/store/src/hot_cold_store.rs index b81610c90..6b2b193f8 100644 --- a/beacon_node/store/src/hot_cold_store.rs +++ b/beacon_node/store/src/hot_cold_store.rs @@ -1722,9 +1722,9 @@ impl, Cold: ItemStore> HotColdDB }; if !force { - let epochs_per_blob_prune = - Epoch::new(self.get_config().epochs_per_blob_prune * E::slots_per_epoch()); - if blob_info.last_pruned_epoch + epochs_per_blob_prune > blob_info.next_epoch_to_prune { + if blob_info.last_pruned_epoch + self.get_config().epochs_per_blob_prune + > blob_info.next_epoch_to_prune + { info!(self.log, "Blobs sidecars are pruned"); return Ok(()); }