Commit 5acb97e0 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge pull request #4160 from ethereum-optimism/feat/configurable-db-migrate

op-chain-ops: allow config of LevelDB in `op-migrate`
parents 014b91d2 cae1605e
...@@ -80,6 +80,16 @@ func main() { ...@@ -80,6 +80,16 @@ func main() {
Name: "no-check", Name: "no-check",
Usage: "Do not perform sanity checks. This should only be used for testing", Usage: "Do not perform sanity checks. This should only be used for testing",
}, },
cli.IntFlag{
Name: "db-cache",
Usage: "LevelDB cache size in mb",
Value: 1024,
},
cli.IntFlag{
Name: "db-handles",
Usage: "LevelDB number of handles",
Value: 60,
},
}, },
Action: func(ctx *cli.Context) error { Action: func(ctx *cli.Context) error {
deployConfig := ctx.String("deploy-config") deployConfig := ctx.String("deploy-config")
...@@ -140,9 +150,12 @@ func main() { ...@@ -140,9 +150,12 @@ func main() {
return err return err
} }
dbCache := ctx.Int("db-cache")
dbHandles := ctx.Int("db-handles")
chaindataPath := filepath.Join(ctx.String("db-path"), "geth", "chaindata") chaindataPath := filepath.Join(ctx.String("db-path"), "geth", "chaindata")
ancientPath := filepath.Join(chaindataPath, "ancient") ancientPath := filepath.Join(chaindataPath, "ancient")
ldb, err := rawdb.NewLevelDBDatabaseWithFreezer(chaindataPath, int(1024), int(60), ancientPath, "", false) ldb, err := rawdb.NewLevelDBDatabaseWithFreezer(chaindataPath, dbCache, dbHandles, ancientPath, "", false)
if err != nil { if err != nil {
return err return err
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment