mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-29 14:22:55 +00:00
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
This commit is contained in:
parent
b3113baec8
commit
974844c8d2
1 changed files with 1 additions and 6 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue