Commit 5ec570fa authored by Mark Tyneway's avatar Mark Tyneway

op-chain-ops: base fee check

Check that the L2 genesis block base fee per gas
is not set to `nil`. If it is, it will cause a segfault
in `op-geth` on startup after the migration.

It is configured with the key: `"l2GenesisBlockBaseFeePerGas"`
parent f6cdc1d9
...@@ -2,6 +2,7 @@ package genesis ...@@ -2,6 +2,7 @@ package genesis
import ( import (
"bytes" "bytes"
"errors"
"fmt" "fmt"
"math/big" "math/big"
...@@ -53,6 +54,10 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, m ...@@ -53,6 +54,10 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, m
}, nil }, nil
} }
if config.L2GenesisBlockBaseFeePerGas == nil {
return nil, errors.New("must configure L2 genesis block base fee per gas")
}
underlyingDB := state.NewDatabaseWithConfig(ldb, &trie.Config{ underlyingDB := state.NewDatabaseWithConfig(ldb, &trie.Config{
Preimages: true, Preimages: true,
}) })
......
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