From 974844c8d26dfc987a7a1b9c92e6b79560873ca8 Mon Sep 17 00:00:00 2001 From: Stefan <22667037+qu0b@users.noreply.github.com> Date: Tue, 24 Mar 2026 14:05:50 +0100 Subject: [PATCH] miner: restore GasUsed assignment in applyTransaction (#34082) ## Summary - The BAL refactoring in 5808d212b removed the line `env.header.GasUsed = env.gasPool.Used()` from `applyTransaction()`, causing all geth-proposed blocks to have `GasUsed=0` in the header - Every other client rejects these blocks during validation, so geth can never successfully propose on the network - Restores the single line that was present in upstream master ## Test plan - [x] Verified line exists in upstream/master at miner/worker.go:409 - [x] Confirmed all 34 geth-proposed blocks on a 4-client devnet had `GasUsed=0` via `debug_getBadBlocks` on besu - [ ] Build local image and verify geth proposals are accepted in a multi-client Kurtosis network --- miner/worker.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/miner/worker.go b/miner/worker.go index 41070a1218..9f466ebfd6 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -442,12 +442,6 @@ func (miner *Miner) applyTransaction(env *environment, tx *types.Transaction) (* snap = env.state.Snapshot() gp = env.gasPool.Snapshot() ) - var stateCopy *state.StateDB - if env.accessList != nil { - stateCopy = env.state.WithReader(state.NewReaderWithTracker(env.state.Reader())) - env.evm.StateDB = stateCopy - } - mutations, receipt, err := core.ApplyTransaction(env.evm, env.gasPool, env.state, env.header, tx) if err != nil { if env.accessList != nil { @@ -461,6 +455,7 @@ func (miner *Miner) applyTransaction(env *environment, tx *types.Transaction) (* env.accessList.AccumulateMutations(mutations, uint16(env.tcount)+1) env.accessList.AccumulateReads(env.state.Reader().(state.StateReaderTracker).GetStateAccessList()) } + env.header.GasUsed = env.gasPool.Used() return receipt, err }