From 0d13932663fdd0234c1b3632383717b533538c65 Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Mon, 16 Jan 2023 13:59:39 +0100 Subject: [PATCH] Fix epoch constructor misconception --- beacon_node/src/config.rs | 3 +-- beacon_node/store/src/hot_cold_store.rs | 4 ++-- consensus/types/src/slot_epoch.rs | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/beacon_node/src/config.rs b/beacon_node/src/config.rs index 6758ba3b4..14d40db03 100644 --- a/beacon_node/src/config.rs +++ b/beacon_node/src/config.rs @@ -418,8 +418,7 @@ 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 = - Epoch::new(epochs_per_blob_prune * E::slots_per_epoch()); + client_config.store.epochs_per_blob_prune = epochs_per_blob_prune; } /* diff --git a/beacon_node/store/src/hot_cold_store.rs b/beacon_node/store/src/hot_cold_store.rs index 6b2b193f8..e53499438 100644 --- a/beacon_node/store/src/hot_cold_store.rs +++ b/beacon_node/store/src/hot_cold_store.rs @@ -1722,8 +1722,8 @@ impl, Cold: ItemStore> HotColdDB }; if !force { - if blob_info.last_pruned_epoch + self.get_config().epochs_per_blob_prune - > blob_info.next_epoch_to_prune + if blob_info.last_pruned_epoch.as_u64() + self.get_config().epochs_per_blob_prune + > blob_info.next_epoch_to_prune.as_u64() { info!(self.log, "Blobs sidecars are pruned"); return Ok(()); diff --git a/consensus/types/src/slot_epoch.rs b/consensus/types/src/slot_epoch.rs index 2716367c7..06f99b988 100644 --- a/consensus/types/src/slot_epoch.rs +++ b/consensus/types/src/slot_epoch.rs @@ -76,8 +76,8 @@ impl Slot { } impl Epoch { - pub const fn new(slot: u64) -> Epoch { - Epoch(slot) + pub const fn new(epoch: u64) -> Epoch { + Epoch(epoch) } pub fn max_value() -> Epoch {