mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-09 03:17:55 +00:00
Plug in pruning of blobs into app
This commit is contained in:
@@ -914,6 +914,20 @@ 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();
|
||||
beacon_chain.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",
|
||||
);
|
||||
}
|
||||
|
||||
Ok(beacon_chain)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ pub struct StoreConfig {
|
||||
pub compact_on_prune: bool,
|
||||
/// Whether to prune payloads on initialization and finalization.
|
||||
pub prune_payloads: bool,
|
||||
/// Whether to prune blobs older than the blob data availability boundary.
|
||||
pub prune_blobs: bool,
|
||||
}
|
||||
|
||||
/// Variant of `StoreConfig` that gets written to disk. Contains immutable configuration params.
|
||||
@@ -50,6 +52,7 @@ impl Default for StoreConfig {
|
||||
compact_on_init: false,
|
||||
compact_on_prune: true,
|
||||
prune_payloads: true,
|
||||
prune_blobs: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user