Skip to content

Commit

Permalink
Merge pull request #78 from sei-protocol/IgnoreVersion
Browse files Browse the repository at this point in the history
Set Earliest Version Ignore Version
  • Loading branch information
Kbhat1 authored Nov 27, 2024
2 parents bfe1190 + cf2c44b commit a340563
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions ss/pebbledb/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ func (db *Database) GetLatestVersion() (int64, error) {
return int64(binary.LittleEndian.Uint64(bz)), closer.Close()
}

func (db *Database) SetEarliestVersion(version int64) error {
if version > db.earliestVersion {
func (db *Database) SetEarliestVersion(version int64, ignoreVersion bool) error {
if version > db.earliestVersion || ignoreVersion {
db.earliestVersion = version

var ts [VersionSize]byte
Expand Down Expand Up @@ -486,7 +486,7 @@ func (db *Database) Prune(version int64) error {
}
}

return db.SetEarliestVersion(earliestVersion)
return db.SetEarliestVersion(earliestVersion, false)
}

func (db *Database) Iterator(storeKey string, version int64, start, end []byte) (types.DBIterator, error) {
Expand Down
2 changes: 1 addition & 1 deletion ss/rocksdb/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func (db *Database) GetLatestVersion() (int64, error) {
return int64(binary.LittleEndian.Uint64(bz)), nil
}

func (db *Database) SetEarliestVersion(version int64) error {
func (db *Database) SetEarliestVersion(version int64, ignoreVersion bool) error {
panic("not implemented")
}

Expand Down
2 changes: 1 addition & 1 deletion ss/sqlite/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (db *Database) GetEarliestVersion() (int64, error) {
panic("not implemented")
}

func (db *Database) SetEarliestVersion(version int64) error {
func (db *Database) SetEarliestVersion(version int64, ignoreVersion bool) error {
panic("not implemented")
}

Expand Down
2 changes: 1 addition & 1 deletion ss/types/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type StateStore interface {
GetLatestVersion() (int64, error)
SetLatestVersion(version int64) error
GetEarliestVersion() (int64, error)
SetEarliestVersion(version int64) error
SetEarliestVersion(version int64, ignoreVersion bool) error
GetLatestMigratedKey() ([]byte, error)
SetLatestMigratedKey(key []byte) error
GetLatestMigratedModule() (string, error)
Expand Down

0 comments on commit a340563

Please sign in to comment.