Merge PR #7265: Tendermint Block Pruning

This commit is contained in:
Alexander Bezobchuk
2020-09-14 10:12:49 -04:00
committed by GitHub
parent 56e3bc1945
commit 7ae84898de
15 changed files with 295 additions and 6 deletions
+6
View File
@@ -125,6 +125,12 @@ func (st *Store) SetPruning(_ types.PruningOptions) {
panic("cannot set pruning options on an initialized IAVL store")
}
// SetPruning panics as pruning options should be provided at initialization
// since IAVl accepts pruning options directly.
func (st *Store) GetPruning() types.PruningOptions {
panic("cannot get pruning options on an initialized IAVL store")
}
// VersionExists returns whether or not a given version is stored.
func (st *Store) VersionExists(version int64) bool {
return st.tree.VersionExists(version)
+6 -1
View File
@@ -49,4 +49,9 @@ func (s Store) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.Cach
func (s *Store) Commit() (id types.CommitID) { return }
func (s *Store) SetPruning(pruning types.PruningOptions) {}
func (s Store) LastCommitID() (id types.CommitID) { return }
// GetPruning is a no-op as pruning options cannot be directly set on this store.
// They must be set on the root commit multi-store.
func (s *Store) GetPruning() types.PruningOptions { return types.PruningOptions{} }
func (s Store) LastCommitID() (id types.CommitID) { return }
+4
View File
@@ -31,3 +31,7 @@ func (cdsa commitDBStoreAdapter) LastCommitID() types.CommitID {
}
func (cdsa commitDBStoreAdapter) SetPruning(_ types.PruningOptions) {}
// GetPruning is a no-op as pruning options cannot be directly set on this store.
// They must be set on the root commit multi-store.
func (cdsa commitDBStoreAdapter) GetPruning() types.PruningOptions { return types.PruningOptions{} }
+5 -3
View File
@@ -27,9 +27,11 @@ func (ts *Store) Commit() (id types.CommitID) {
return
}
// Implements CommitStore
func (ts *Store) SetPruning(pruning types.PruningOptions) {
}
func (ts *Store) SetPruning(_ types.PruningOptions) {}
// GetPruning is a no-op as pruning options cannot be directly set on this store.
// They must be set on the root commit multi-store.
func (ts *Store) GetPruning() types.PruningOptions { return types.PruningOptions{} }
// Implements CommitStore
func (ts *Store) LastCommitID() (id types.CommitID) {
+1 -1
View File
@@ -21,8 +21,8 @@ type Committer interface {
Commit() CommitID
LastCommitID() CommitID
// TODO: Deprecate after 0.38.5
SetPruning(PruningOptions)
GetPruning() PruningOptions
}
// Stores of MultiStore must implement CommitStore.