Skip to content

Commit 4d92d24

Browse files
authored
core/genesis: warn log if there is no L2toL1MP storage with Isthmus (#590)
* panic if there is no L2toL1MP storage * use warning log instead of panic this allows for lightweight genesis allocs to be used in testing
1 parent 36501a7 commit 4d92d24

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/genesis.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,8 +667,9 @@ func (g *Genesis) toBlockWithRoot(stateRoot, storageRootMessagePasser common.Has
667667
// If Isthmus is active at genesis, set the WithdrawalRoot to the storage root of the L2ToL1MessagePasser contract.
668668
if g.Config.IsOptimismIsthmus(g.Timestamp) {
669669
if storageRootMessagePasser == (common.Hash{}) {
670-
// if there was no MessagePasser contract storage, set the WithdrawalsHash to the empty hash
671-
storageRootMessagePasser = types.EmptyWithdrawalsHash
670+
// if there was no MessagePasser contract storage, something is wrong
671+
// (it should at least store an implementation address and owner address)
672+
log.Warn("isthmus: no storage root for L2ToL1MessagePasser contract")
672673
}
673674
head.WithdrawalsHash = &storageRootMessagePasser
674675
}

0 commit comments

Comments
 (0)