Commit 1c83162b authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

Merge pull request #4144 from ethereum-optimism/fix/ensure-monotonic

op-chain-ops: migrate db monotonic timestamp
parents c975c962 fcb58c1a
...@@ -58,6 +58,13 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, m ...@@ -58,6 +58,13 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, m
return nil, errors.New("must configure L2 genesis block base fee per gas") return nil, errors.New("must configure L2 genesis block base fee per gas")
} }
// Ensure monotonic timestamps
if uint64(config.L2OutputOracleStartingTimestamp) <= header.Time {
return nil, fmt.Errorf(
"L2 output oracle starting timestamp (%d) is less than the header timestamp (%d)", config.L2OutputOracleStartingTimestamp, header.Time,
)
}
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