diff --git a/cmd/juno/dbcmd.go b/cmd/juno/dbcmd.go index f45e59d442..248e711e92 100644 --- a/cmd/juno/dbcmd.go +++ b/cmd/juno/dbcmd.go @@ -13,6 +13,7 @@ import ( "github.com/NethermindEth/juno/db/pebblev2" "github.com/NethermindEth/juno/migration" "github.com/NethermindEth/juno/utils" + "github.com/cockroachdb/pebble/v2/sstable/block" "github.com/olekukonko/tablewriter" "github.com/spf13/cobra" ) @@ -311,7 +312,7 @@ func openDB(path string) (db.KeyValueStore, error) { return nil, errors.New("database path does not exist") } - database, err := pebblev2.New(path) + database, err := pebblev2.New(path, pebblev2.WithCompression(block.ZstdCompression)) if err != nil { return nil, fmt.Errorf("failed to open db: %w", err) } diff --git a/node/node.go b/node/node.go index f4c5f2c96b..bcfc58fbab 100644 --- a/node/node.go +++ b/node/node.go @@ -38,6 +38,7 @@ import ( "github.com/NethermindEth/juno/utils" "github.com/NethermindEth/juno/validator" "github.com/NethermindEth/juno/vm" + "github.com/cockroachdb/pebble/v2/sstable/block" "github.com/consensys/gnark-crypto/ecc/stark-curve/ecdsa" "github.com/mitchellh/mapstructure" "github.com/sourcegraph/conc" @@ -151,6 +152,7 @@ func New(cfg *Config, version string, logLevel *utils.LogLevel) (*Node, error) { pebblev2.WithCacheSize(cfg.DBCacheSize), pebblev2.WithMaxOpenFiles(cfg.DBMaxHandles), pebblev2.WithLogger(cfg.Colour), + pebblev2.WithCompression(block.ZstdCompression), ) }