Skip to content

Commit 0cf5f9d

Browse files
committed
feat: add Backup interface to Store and reorder Rollback interface definition
1 parent 97d49c6 commit 0cf5f9d

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

pkg/store/types.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ type Batch interface {
3333
// Store is minimal interface for storing and retrieving blocks, commits and state.
3434
type Store interface {
3535
Rollback
36+
Backup
3637
Reader
3738

3839
// SetMetadata saves arbitrary value in the store.
@@ -71,11 +72,7 @@ type Reader interface {
7172
GetMetadata(ctx context.Context, key string) ([]byte, error)
7273
}
7374

74-
type Rollback interface {
75-
// Rollback deletes x height from the ev-node store.
76-
// Aggregator is used to determine if the rollback is performed on the aggregator node.
77-
Rollback(ctx context.Context, height uint64, aggregator bool) error
78-
75+
type Backup interface {
7976
// Backup writes a consistent backup stream to writer. The returned version can be used
8077
// as the starting point for incremental backups.
8178
Backup(ctx context.Context, writer io.Writer, since uint64) (uint64, error)
@@ -86,3 +83,9 @@ type Rollback interface {
8683
// Close safely closes underlying data storage, to ensure that data is actually saved.
8784
Close() error
8885
}
86+
87+
type Rollback interface {
88+
// Rollback deletes x height from the ev-node store.
89+
// Aggregator is used to determine if the rollback is performed on the aggregator node.
90+
Rollback(ctx context.Context, height uint64, aggregator bool) error
91+
}

0 commit comments

Comments
 (0)