@@ -913,42 +913,55 @@ pub fn execute(
913
913
. transpose ( ) ?
914
914
. unwrap_or ( SnapshotVersion :: default ( ) ) ;
915
915
916
- let ( full_snapshot_archive_interval_slots, incremental_snapshot_archive_interval_slots) = match (
917
- !matches. is_present ( "no_incremental_snapshots" ) ,
918
- value_t_or_exit ! ( matches, "snapshot_interval_slots" , u64 ) ,
919
- ) {
920
- ( _, 0 ) => {
916
+ let ( full_snapshot_archive_interval_slots, incremental_snapshot_archive_interval_slots) =
917
+ if matches. is_present ( "no_snapshots" ) {
921
918
// snapshots are disabled
922
919
(
923
920
DISABLED_SNAPSHOT_ARCHIVE_INTERVAL ,
924
921
DISABLED_SNAPSHOT_ARCHIVE_INTERVAL ,
925
922
)
926
- }
927
- ( true , incremental_snapshot_interval_slots) => {
928
- // incremental snapshots are enabled
929
- // use --snapshot-interval-slots for the incremental snapshot interval
930
- (
931
- value_t_or_exit ! ( matches, "full_snapshot_interval_slots" , u64 ) ,
932
- incremental_snapshot_interval_slots,
933
- )
934
- }
935
- ( false , full_snapshot_interval_slots) => {
936
- // incremental snapshots are *disabled*
937
- // use --snapshot-interval-slots for the *full* snapshot interval
938
- // also warn if --full-snapshot-interval-slots was specified
939
- if matches. occurrences_of ( "full_snapshot_interval_slots" ) > 0 {
940
- warn ! (
941
- "Incremental snapshots are disabled, yet --full-snapshot-interval-slots was specified! \
942
- Note that --full-snapshot-interval-slots is *ignored* when incremental snapshots are disabled. \
943
- Use --snapshot-interval-slots instead.",
944
- ) ;
923
+ } else {
924
+ match (
925
+ !matches. is_present ( "no_incremental_snapshots" ) ,
926
+ value_t_or_exit ! ( matches, "snapshot_interval_slots" , u64 ) ,
927
+ ) {
928
+ ( _, 0 ) => {
929
+ // snapshots are disabled
930
+ warn ! (
931
+ "Snapshot generation was disabled with `--snapshot-interval-slots 0`, \
932
+ which is now deprecated. Use `--no-snapshots` instead.",
933
+ ) ;
934
+ (
935
+ DISABLED_SNAPSHOT_ARCHIVE_INTERVAL ,
936
+ DISABLED_SNAPSHOT_ARCHIVE_INTERVAL ,
937
+ )
938
+ }
939
+ ( true , incremental_snapshot_interval_slots) => {
940
+ // incremental snapshots are enabled
941
+ // use --snapshot-interval-slots for the incremental snapshot interval
942
+ (
943
+ value_t_or_exit ! ( matches, "full_snapshot_interval_slots" , u64 ) ,
944
+ incremental_snapshot_interval_slots,
945
+ )
946
+ }
947
+ ( false , full_snapshot_interval_slots) => {
948
+ // incremental snapshots are *disabled*
949
+ // use --snapshot-interval-slots for the *full* snapshot interval
950
+ // also warn if --full-snapshot-interval-slots was specified
951
+ if matches. occurrences_of ( "full_snapshot_interval_slots" ) > 0 {
952
+ warn ! (
953
+ "Incremental snapshots are disabled, yet --full-snapshot-interval-slots was specified! \
954
+ Note that --full-snapshot-interval-slots is *ignored* when incremental snapshots are disabled. \
955
+ Use --snapshot-interval-slots instead.",
956
+ ) ;
957
+ }
958
+ (
959
+ full_snapshot_interval_slots,
960
+ DISABLED_SNAPSHOT_ARCHIVE_INTERVAL ,
961
+ )
962
+ }
945
963
}
946
- (
947
- full_snapshot_interval_slots,
948
- DISABLED_SNAPSHOT_ARCHIVE_INTERVAL ,
949
- )
950
- }
951
- } ;
964
+ } ;
952
965
953
966
validator_config. snapshot_config = SnapshotConfig {
954
967
usage : if full_snapshot_archive_interval_slots == DISABLED_SNAPSHOT_ARCHIVE_INTERVAL {
0 commit comments