Skip to content

Commit

Permalink
testing: use rocksdb everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrus committed Nov 2, 2023
1 parent 38d83c9 commit da8fa2d
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ updates:
# CometBFT is manualy kept up to date.
- dependency-name: github.com/cometbft/cometbft
- dependency-name: github.com/cometbft/cometbft-db
# RocksDB is manualy kept up to date.
- dependency-name: github.com/linxGnu/grocksdb

# Manage Rust pacakge versions.
- package-ecosystem: cargo
Expand Down
1 change: 1 addition & 0 deletions go/consensus/cometbft/abci/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@ func InitStateStorage(cfg *ApplicationConfig) (storage.LocalBackend, storage.Nod

switch cfg.StorageBackend {
case storageDB.BackendNameBadgerDB:
case storageDB.BackendNameRocksDB:
default:
return nil, nil, nil, fmt.Errorf("unsupported storage backend: %s", cfg.StorageBackend)
}
Expand Down
1 change: 0 additions & 1 deletion go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ replace (

golang.org/x/crypto/curve25519 => github.com/oasisprotocol/curve25519-voi/primitives/x25519 v0.0.0-20210505121811-294cf0fbfb43
golang.org/x/crypto/ed25519 => github.com/oasisprotocol/curve25519-voi/primitives/ed25519 v0.0.0-20210505121811-294cf0fbfb43

)

require (
Expand Down
4 changes: 2 additions & 2 deletions go/oasis-node/cmd/debug/byzantine/storage_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ func newStorageNode(namespace common.Namespace, datadir string) (*storageWorker,
defer close(initCh)

cfg := &storage.Config{
Backend: database.BackendNameBadgerDB,
DB: filepath.Join(datadir, database.DefaultFileName(database.BackendNameBadgerDB)),
Backend: database.BackendNameRocksDB,
DB: filepath.Join(datadir, database.DefaultFileName(database.BackendNameRocksDB)),
Namespace: namespace,
MaxCacheSize: 64 * 1024 * 1024,
}
Expand Down
2 changes: 1 addition & 1 deletion go/oasis-test-runner/oasis/compute.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func (net *Network) NewCompute(cfg *ComputeCfg) (*Compute, error) {
cfg.RuntimeProvisioner = runtimeConfig.RuntimeProvisionerSandboxed
}
if cfg.StorageBackend == "" {
cfg.StorageBackend = database.BackendNameBadgerDB
cfg.StorageBackend = database.BackendNameRocksDB
}
// Initialize runtime state paths.
for i, path := range cfg.RuntimeStatePaths {
Expand Down
4 changes: 2 additions & 2 deletions go/worker/storage/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type CheckpointerConfig struct {

// Validate validates the configuration settings.
func (c *Config) Validate() error {
if c.Backend != "badger" {
if c.Backend != "badger" && c.Backend != "rocksdb" {
return fmt.Errorf("unknown storage backend: %s", c.Backend)
}

Expand All @@ -44,7 +44,7 @@ func (c *Config) Validate() error {
// DefaultConfig returns the default configuration settings.
func DefaultConfig() Config {
return Config{
Backend: "badger",
Backend: "rocksdb",
MaxCacheSize: "64mb",
FetcherCount: 4,
PublicRPCEnabled: false,
Expand Down
2 changes: 1 addition & 1 deletion go/worker/storage/crashing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestCrashingBackendDoNotInterfere(t *testing.T) {

var (
cfg = api.Config{
Backend: database.BackendNameBadgerDB,
Backend: database.BackendNameRocksDB,
Namespace: testNs,
MaxCacheSize: 16 * 1024 * 1024,
}
Expand Down
3 changes: 3 additions & 0 deletions go/worker/storage/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ func NewLocalBackend(
case database.BackendNameBadgerDB:
cfg.DB = GetLocalBackendDBDir(dataDir, cfg.Backend)
impl, err = database.New(cfg)
case database.BackendNameRocksDB:
cfg.DB = GetLocalBackendDBDir(dataDir, cfg.Backend)
impl, err = database.New(cfg)
default:
err = fmt.Errorf("storage: unsupported backend: '%v'", cfg.Backend)
}
Expand Down

0 comments on commit da8fa2d

Please sign in to comment.