Plug in running blob pruning in migrator, related bug fixes and add todos

This commit is contained in:
Emilia Hane
2023-01-20 12:12:32 +01:00
parent d1b75e281f
commit d7fc24a9d5
4 changed files with 34 additions and 38 deletions

View File

@@ -915,19 +915,9 @@ where
}
// Prune blobs sidecars older than the blob data availability boundary in the background.
if beacon_chain.store.get_config().prune_blobs {
let store = beacon_chain.store.clone();
let log = log.clone();
let data_availability_boundary = beacon_chain.data_availability_boundary();
beacon_chain.task_executor.spawn_blocking(
move || {
if let Err(e) = store.try_prune_blobs(false, data_availability_boundary) {
error!(log, "Error pruning blobs in background"; "error" => ?e);
}
},
"prune_blobs_background",
);
}
beacon_chain
.store_migrator
.process_prune_blobs(beacon_chain.data_availability_boundary());
Ok(beacon_chain)
}