Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Nov 11, 2024
1 parent 9711730 commit 9711b73
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 86 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Bug Fixes

* [#1679](https://github.com/crypto-org-chain/cronos/pull/1679) Include no trace detail on insufficient balance fix.
* [#1685](https://github.com/crypto-org-chain/cronos/pull/1685) Fix versiondb corrupted data on startup.

### Improvements

Expand Down
1 change: 1 addition & 0 deletions app/versiondb.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func (app *App) setupVersionDB(
return nil, err
}

// see: https://github.com/crypto-org-chain/cronos/issues/1683
if err := versionDB.FixData(exposedKeys); err != nil {
return nil, err

Check warning on line 40 in app/versiondb.go

View check run for this annotation

Codecov / codecov/patch

app/versiondb.go#L40

Added line #L40 was not covered by tests
}
Expand Down
1 change: 0 additions & 1 deletion versiondb/client/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func ChangeSetGroupCmd(opts Options) *cobra.Command {
ChangeSetToVersionDBCmd(),
RestoreAppDBCmd(opts),
RestoreVersionDBCmd(),
FixDataCmd(),
)
return cmd
}
83 changes: 0 additions & 83 deletions versiondb/client/fixdata.go

This file was deleted.

4 changes: 2 additions & 2 deletions versiondb/tsrocksdb/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ func (s Store) fixDataStore(name string) error {
batch := grocksdb.NewWriteBatch()
defer batch.Destroy()

prefix := storePrefix(name)
for ; iter.Valid(); iter.Next() {
key := iter.Key()
if len(key) < TimestampSize {
Expand All @@ -280,8 +281,7 @@ func (s Store) fixDataStore(name string) error {
continue

Check warning on line 281 in versiondb/tsrocksdb/store.go

View check run for this annotation

Codecov / codecov/patch

versiondb/tsrocksdb/store.go#L281

Added line #L281 was not covered by tests
}

fmt.Println("[debug] fix key", string(key), "ts", binary.LittleEndian.Uint64(ts))
batch.PutCFWithTS(s.cfHandle, key, ts, iter.Value())
batch.PutCFWithTS(s.cfHandle, cloneAppend(prefix, key), ts, iter.Value())
}

return s.db.Write(defaultSyncWriteOpts, batch)
Expand Down

0 comments on commit 9711b73

Please sign in to comment.