Skip to content

Commit

Permalink
Fix PruneEverything option
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaSripal committed Jan 21, 2020
1 parent 4da2201 commit 07ffaa9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions store/iavl/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ type Store struct {
// fails to load.
func LoadStore(db dbm.DB, id types.CommitID, pruning types.PruningOptions, lazyLoading bool) (types.CommitKVStore, error) {
var iavlOpts *iavl.Options
if pruning.KeepEvery() == 0 && pruning.KeepRecent() == 0 {
iavlOpts = iavl.DefaultOptions()
} else {
iavlOpts = iavl.PruningOptions(pruning.KeepEvery(), pruning.KeepRecent())
}
iavlOpts = iavl.PruningOptions(pruning.KeepEvery(), pruning.KeepRecent())
tree, err := iavl.NewMutableTreeWithOpts(
db,
dbm.NewMemDB(),
Expand Down
2 changes: 1 addition & 1 deletion store/types/pruning.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (po PruningOptions) KeepEvery() int64 {
// default pruning strategies
var (
// PruneEverything means all saved states will be deleted, storing only the current state
PruneEverything = NewPruningOptions(0, 0)
PruneEverything = NewPruningOptions(1, 0)
// PruneNothing means all historic states will be saved, nothing will be deleted
PruneNothing = NewPruningOptions(0, 1)
// PruneSyncable means only those states not needed for state syncing will be deleted (keeps last 100 + every 10000th)
Expand Down

2 comments on commit 07ffaa9

@tnachen
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also fix the tests?

@AdityaSripal
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, didn't realize this would break things. Looking into it now

Please sign in to comment.