Skip to content

Commit

Permalink
beacon: add nil check for AccessEvents
Browse files Browse the repository at this point in the history
If Isthmus is activated, we attempt to add the L2ToL1MessagePasser
to state access events. Check that AccessEvents exists before attempting
to AddAccount
  • Loading branch information
vdamle committed Dec 19, 2024
1 parent 7ba3850 commit f101b66
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion consensus/beacon/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,10 @@ func (beacon *Beacon) FinalizeAndAssemble(chain consensus.ChainHeaderReader, hea
// State-root has just been computed, we can get an accurate storage-root now.
h := state.GetStorageRoot(params.OptimismL2ToL1MessagePasser)
header.WithdrawalsHash = &h
state.AccessEvents().AddAccount(params.OptimismL2ToL1MessagePasser, false) // include in execution witness
sa := state.AccessEvents()
if sa != nil {
sa.AddAccount(params.OptimismL2ToL1MessagePasser, false) // include in execution witness
}
}

// Assemble the final block.
Expand Down

0 comments on commit f101b66

Please sign in to comment.