Skip to content

Commit ce73c51

Browse files
committed
Removed unused argument from Prune function;
1 parent a97125a commit ce73c51

4 files changed

Lines changed: 14 additions & 13 deletions

File tree

state/mocks/store.go

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

state/pruner.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ type Pruner struct {
4040

4141
// Preserve the number of state entries pruned.
4242
// Used to calculated correctly when to trigger compactions
43+
// TODO This is unused and should be removed from V1 and main as well.
4344
prunedStates uint64
4445
}
4546

@@ -370,7 +371,7 @@ func (p *Pruner) pruneBlocksToHeight(height int64) (uint64, int64, error) {
370371

371372
if pruned > 0 {
372373

373-
p.prunedStates, err = p.stateStore.PruneStates(base, height, evRetainHeight, p.prunedStates)
374+
_, err = p.stateStore.PruneStates(base, height, evRetainHeight)
374375
if err != nil {
375376
return 0, 0, ErrFailedToPruneStates{Height: height, Err: err}
376377
}

state/store.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ type Store interface {
8585
// Gets the height at which the store is bootstrapped after out of band statesync
8686
GetOfflineStateSyncHeight() (int64, error)
8787
// PruneStates takes the height from which to start pruning and which height stop at
88-
PruneStates(fromHeight, toHeight, evidenceThresholdHeight int64, previouslyPrunedStates uint64) (uint64, error)
88+
PruneStates(fromHeight, toHeight, evidenceThresholdHeight int64) (uint64, error)
8989
// PruneABCIResponses will prune all ABCI responses below the given height.
9090
PruneABCIResponses(targetRetainHeight int64, forceCompact bool) (int64, int64, error)
9191
// SaveApplicationRetainHeight persists the application retain height from the application
@@ -306,7 +306,7 @@ func (store dbStore) Bootstrap(state State) error {
306306
// encoding not preserving ordering: https://github.com/tendermint/tendermint/issues/4567
307307
// This will cause some old states to be left behind when doing incremental partial prunes,
308308
// specifically older checkpoints and LastHeightChanged targets.
309-
func (store dbStore) PruneStates(from int64, to int64, evidenceThresholdHeight int64, previosulyPrunedStates uint64) (uint64, error) {
309+
func (store dbStore) PruneStates(from int64, to int64, evidenceThresholdHeight int64) (uint64, error) {
310310
if from <= 0 || to <= 0 {
311311
return 0, fmt.Errorf("from height %v and to height %v must be greater than 0", from, to)
312312
}

state/store_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func TestPruneStates(t *testing.T) {
175175
makeAndSaveStates(t, 1, tc.makeHeights, stateStore)
176176

177177
// Test assertions
178-
_, err := stateStore.PruneStates(tc.pruneFrom, tc.pruneTo, tc.evidenceThresholdHeight, 0)
178+
_, err := stateStore.PruneStates(tc.pruneFrom, tc.pruneTo, tc.evidenceThresholdHeight)
179179
if tc.expectErr {
180180
require.Error(t, err)
181181
return

0 commit comments

Comments
 (0)