File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff 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" ) ;
Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments