From f101b66559f592faf3b201958e157a5245b7aced Mon Sep 17 00:00:00 2001 From: Vinod Damle <5338861+vdamle@users.noreply.github.com> Date: Thu, 19 Dec 2024 11:07:12 -0500 Subject: [PATCH] beacon: add nil check for AccessEvents If Isthmus is activated, we attempt to add the L2ToL1MessagePasser to state access events. Check that AccessEvents exists before attempting to AddAccount --- consensus/beacon/consensus.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/consensus/beacon/consensus.go b/consensus/beacon/consensus.go index 5200289a5c..35f6e0cd9a 100644 --- a/consensus/beacon/consensus.go +++ b/consensus/beacon/consensus.go @@ -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.