Skip to content

Commit

Permalink
Merge branch 'feat/backward-compatibility-store-v2' of github.com-ran…
Browse files Browse the repository at this point in the history
…dy:cosmos/cosmos-sdk into feat/backward-compatibility-store-v2
  • Loading branch information
Randy Grok committed Jan 7, 2025
2 parents 7aaa559 + e6e4ee7 commit 4c15358
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 463 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i

* (baseapp) [#20291](https://github.com/cosmos/cosmos-sdk/pull/20291) Simulate nested messages.
* (client/keys) [#21829](https://github.com/cosmos/cosmos-sdk/pull/21829) Add support for importing hex key using standard input.
* (x/auth/ante) [#23128](https://github.com/cosmos/cosmos-sdk/pull/23128) Allow custom verifyIsOnCurve when validate tx for public key like ethsecp256k1.

### Improvements

Expand Down
8 changes: 5 additions & 3 deletions server/v2/store/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (s *Server[T]) DumpArchiveCmd() *cobra.Command {
Use: "dump <height> <format>",
Short: "Dump the snapshot as portable archive format",
Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, args []string) (err error) {
v := serverv2.GetViperFromCmd(cmd)
snapshotStore, err := snapshots.NewStore(filepath.Join(v.GetString(serverv2.FlagHome), "data", "snapshots"))
if err != nil {
Expand Down Expand Up @@ -220,7 +220,9 @@ func (s *Server[T]) DumpArchiveCmd() *cobra.Command {
if err != nil {
return err
}
defer fp.Close()
defer func() {
err = errors.Join(err, fp.Close())
}()

// since the chunk files are already compressed, we just use fastest compression here
gzipWriter, err := gzip.NewWriterLevel(fp, gzip.BestSpeed)
Expand Down Expand Up @@ -255,7 +257,7 @@ func (s *Server[T]) DumpArchiveCmd() *cobra.Command {
return fmt.Errorf("failed to close gzip writer: %w", err)
}

return fp.Close()
return nil
},
}

Expand Down
6 changes: 0 additions & 6 deletions store/v2/commitment/store_bench_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build rocksdb
// +build rocksdb

package commitment_test

import (
Expand All @@ -20,9 +17,6 @@ import (
var (
storeKeys = []string{"store1", "store2", "store3"}
dbBackends = map[string]func(dataDir string) (corestore.KVStoreWithBatch, error){
"rocksdb_opts": func(dataDir string) (corestore.KVStoreWithBatch, error) {
return dbm.NewRocksDB("test", dataDir)
},
"pebbledb_opts": func(dataDir string) (corestore.KVStoreWithBatch, error) {
return dbm.NewPebbleDB("test", dataDir)
},
Expand Down
1 change: 0 additions & 1 deletion store/v2/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ type DBType string

const (
DBTypeGoLevelDB DBType = "goleveldb"
DBTypeRocksDB DBType = "rocksdb"
DBTypePebbleDB DBType = "pebbledb"
DBTypePrefixDB DBType = "prefixdb"

Expand Down
4 changes: 0 additions & 4 deletions store/v2/db/pebbledb.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ func (db *PebbleDB) Get(key []byte) ([]byte, error) {
return nil, fmt.Errorf("failed to perform PebbleDB read: %w", err)
}

if len(bz) == 0 {
return nil, closer.Close()
}

return bz, closer.Close()
}

Expand Down
Loading

0 comments on commit 4c15358

Please sign in to comment.