Skip to content

Commit

Permalink
beacon: add nil check for AccessEvents (#453)
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

Co-authored-by: Vinod Damle <5338861+vdamle@users.noreply.github.com>
  • Loading branch information
vdamle and vdamle authored Dec 19, 2024
1 parent 7ba3850 commit 928070c
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 928070c

Please sign in to comment.