diff --git a/server/config/toml.go b/server/config/toml.go index 9e8eeadaf1ef..8bee256dda86 100644 --- a/server/config/toml.go +++ b/server/config/toml.go @@ -20,15 +20,18 @@ const DefaultConfigTemplate = `# This is a TOML config file. # specified in this config (e.g. 0.25token1;0.0001token2). minimum-gas-prices = "{{ .BaseConfig.MinGasPrices }}" -# default: the last 100 states are kept in addition to every 500th state; pruning at 10 block intervals +# default: only the last 100,000 states(approximately 1 week worth of state) are kept; pruning at 100 block intervals # nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) -# everything: all saved states will be deleted, storing only the current state; pruning at 10 block intervals +# everything: all saved states will be deleted, storing only the current state; pruning at 10 block intervals. # custom: allow pruning options to be manually specified through 'pruning-keep-recent', 'pruning-keep-every', and 'pruning-interval' pruning = "{{ .BaseConfig.Pruning }}" # These are applied if and only if the pruning strategy is custom. +# pruning-keep-recent = N means keep all of the last N states pruning-keep-recent = "{{ .BaseConfig.PruningKeepRecent }}" +# pruning-keep-every = N means keep every Nth state, in addition to keep-recent pruning-keep-every = "{{ .BaseConfig.PruningKeepEvery }}" +# pruning-interval = N means we delete old states from disk every Nth block. pruning-interval = "{{ .BaseConfig.PruningInterval }}" # HaltHeight contains a non-zero block height at which a node will gracefully diff --git a/server/start.go b/server/start.go index bda8b6ed8117..f2dfaf246e84 100644 --- a/server/start.go +++ b/server/start.go @@ -86,7 +86,7 @@ Pruning options can be provided via the '--pruning' flag or alternatively with ' For '--pruning' the options are as follows: -default: the last 100 states are kept in addition to every 500th state; pruning at 10 block intervals +default: only the last 100,000 states(approximately 1 week worth of state) are kept; pruning at 100 block intervals nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) everything: all saved states will be deleted, storing only the current state; pruning at 10 block intervals custom: allow pruning options to be manually specified through 'pruning-keep-recent', 'pruning-keep-every', and 'pruning-interval' diff --git a/store/types/pruning.go b/store/types/pruning.go index 4419acb950d8..439a59502428 100644 --- a/store/types/pruning.go +++ b/store/types/pruning.go @@ -11,17 +11,17 @@ const ( ) var ( - // PruneDefault defines a pruning strategy where the last 362880 heights are - // kept in addition to every 100th and where to-be pruned heights are pruned - // at every 10th height. The last 362880 heights are kept assuming the typical - // block time is 5s and typical unbonding period is 21 days. If these values + // PruneDefault defines a pruning strategy where the last 100,000 heights are + // kept where to-be pruned heights are pruned at every 10th height. + // The last 100000 heights are kept(approximately 1 week worth of state) assuming the typical + // block time is 6s. If these values // do not match the applications' requirements, use the "custom" option. - PruneDefault = NewPruningOptions(362880, 100, 10) + PruneDefault = NewPruningOptions(100_000, 0, 100) // PruneEverything defines a pruning strategy where all committed heights are - // deleted, storing only the current height and where to-be pruned heights are + // deleted, storing only the current height and last 10 states. To-be pruned heights are // pruned at every 10th height. - PruneEverything = NewPruningOptions(0, 0, 10) + PruneEverything = NewPruningOptions(10, 0, 10) // PruneNothing defines a pruning strategy where all heights are kept on disk. PruneNothing = NewPruningOptions(0, 1, 0)