Skip to content

Commit

Permalink
fix: Change default pruning options (#52)
Browse files Browse the repository at this point in the history
* Change default pruning settings

* Change config messages

* Change keep-every to 100k

* Updates

Co-authored-by: ValarDragon <[email protected]>
  • Loading branch information
mattverse and ValarDragon authored Jan 13, 2022
1 parent a686806 commit de1853f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
7 changes: 5 additions & 2 deletions server/config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
14 changes: 7 additions & 7 deletions store/types/pruning.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit de1853f

Please sign in to comment.