From 51018a536f7fb8157baa1a87cc0114c3d0c8893f Mon Sep 17 00:00:00 2001 From: Stefan <22667037+qu0b@users.noreply.github.com> Date: Fri, 6 Mar 2026 15:08:07 +0100 Subject: [PATCH] miner: fix nil statedb panic in applyTransaction pre-amsterdam (#33968) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - When `accessList` is nil (pre-Amsterdam blocks), `stateCopy` is never assigned and passed as nil to `core.ApplyTransaction`, causing a nil pointer dereference at `state_processor.go:224` (`statedb.Database().TrieDB().IsVerkle()`) - This is a follow-up to 3e27b31d4 which fixed the `StateReaderTracker` type assertion panic but missed this second crash path in the same function - Fix: set `stateCopy = env.state` in the non-Amsterdam path so `ApplyTransaction` always receives a valid statedb ## Test plan - [x] Verified fix with 8-client Kurtosis network (`gloas_fork_epoch: 256`, pre-Amsterdam): 36+ slots, zero missed blocks, zero geth errors - [x] Both geth nodes (lighthouse + lodestar CLs) proposing blocks successfully with spamoor tx load 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 --- miner/worker.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/miner/worker.go b/miner/worker.go index 472802994b..6e5c92dddb 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -438,6 +438,8 @@ func (miner *Miner) applyTransaction(env *environment, tx *types.Transaction) (* prevReader = env.state.Reader() stateCopy = env.state.WithReader(state.NewReaderWithTracker(env.state.Reader())) env.evm.StateDB = stateCopy + } else { + stateCopy = env.state } mutations, receipt, err := core.ApplyTransaction(env.evm, env.gasPool, stateCopy, env.header, tx)