Prune blobs in bg after canonical head update

This commit is contained in:
Emilia Hane 2023-01-14 17:24:18 +01:00
parent 8752deeced
commit 2f565d25b2
No known key found for this signature in database
GPG Key ID: E73394F9C09206FA

View File

@ -793,6 +793,19 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
.execution_status
.is_optimistic_or_invalid();
if self.store.get_config().prune_blobs {
let store = self.store.clone();
let log = self.log.clone();
self.task_executor.spawn_blocking(
move || {
if let Err(e) = store.try_prune_blobs(false) {
error!(log, "Error pruning blobs in background"; "error" => ?e);
}
},
"prune_blobs_background",
);
}
// Detect and potentially report any re-orgs.
let reorg_distance = detect_reorg(
&old_snapshot.beacon_state,