Simplify conceptual design

This commit is contained in:
Emilia Hane
2023-01-16 20:53:09 +01:00
parent 0d13932663
commit 7103a257ce
5 changed files with 66 additions and 91 deletions

View File

@@ -918,9 +918,13 @@ where
if beacon_chain.store.get_config().prune_blobs {
let store = beacon_chain.store.clone();
let log = log.clone();
let current_slot = beacon_chain
.slot()
.map_err(|e| format!("Failed to get current slot: {:?}", e))?;
let current_epoch = current_slot.epoch(TEthSpec::slots_per_epoch());
beacon_chain.task_executor.spawn_blocking(
move || {
if let Err(e) = store.try_prune_blobs(false) {
if let Err(e) = store.try_prune_blobs(false, Some(current_epoch)) {
error!(log, "Error pruning blobs in background"; "error" => ?e);
}
},