Skip to content

Commit 1f3d1da

Browse files
committed
Disable blob pruning when set
1 parent d798a1e commit 1f3d1da

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

beacon_node/src/config.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,12 @@ pub fn get_config<E: EthSpec>(
827827

828828
client_config.chain.complete_blob_backfill = cli_args.get_flag("complete-blob-backfill");
829829

830+
// Ensure `prune_blobs` is false whenever complete-blob-backfill is set. This overrides any
831+
// setting of `--prune-blobs true` applied earlier in flag parsing.
832+
if client_config.chain.complete_blob_backfill {
833+
client_config.store.prune_blobs = false;
834+
}
835+
830836
// Backfill sync rate-limiting
831837
client_config.beacon_processor.enable_backfill_rate_limiting =
832838
!cli_args.get_flag("disable-backfill-rate-limiting");

lighthouse/tests/beacon_node.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,23 @@ fn complete_blob_backfill_flag() {
402402
CommandLineTest::new()
403403
.flag("complete-blob-backfill", None)
404404
.run_with_zero_port()
405-
.with_config(|config| assert!(config.chain.complete_blob_backfill));
405+
.with_config(|config| {
406+
assert!(config.chain.complete_blob_backfill);
407+
assert!(!config.store.prune_blobs);
408+
});
409+
}
410+
411+
// Even if `--prune-blobs true` is provided, `--complete-blob-backfill` should override it to false.
412+
#[test]
413+
fn complete_blob_backfill_and_prune_blobs_true() {
414+
CommandLineTest::new()
415+
.flag("complete-blob-backfill", None)
416+
.flag("prune-blobs", Some("true"))
417+
.run_with_zero_port()
418+
.with_config(|config| {
419+
assert!(config.chain.complete_blob_backfill);
420+
assert!(!config.store.prune_blobs);
421+
});
406422
}
407423

408424
// Tests for Eth1 flags.

0 commit comments

Comments
 (0)