Skip to content

Commit

Permalink
Merge pull request ethereum-optimism#4160 from ethereum-optimism/feat…
Browse files Browse the repository at this point in the history
…/configurable-db-migrate

op-chain-ops: allow config of LevelDB in `op-migrate`
  • Loading branch information
mergify[bot] authored Dec 2, 2022
2 parents 014b91d + cae1605 commit 5acb97e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion op-chain-ops/cmd/op-migrate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ func main() {
Name: "no-check",
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 {
deployConfig := ctx.String("deploy-config")
Expand Down Expand Up @@ -140,9 +150,12 @@ func main() {
return err
}

dbCache := ctx.Int("db-cache")
dbHandles := ctx.Int("db-handles")

chaindataPath := filepath.Join(ctx.String("db-path"), "geth", "chaindata")
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 {
return err
}
Expand Down

0 comments on commit 5acb97e

Please sign in to comment.