miner: restore GasUsed assignment in applyTransaction#34082
Merged
MariusVanDerWijden merged 2 commits intoMar 24, 2026
Conversation
The BAL refactoring in 5808d21 removed the line that sets header.GasUsed = gasPool.Used() after each transaction in the miner's applyTransaction. This caused all geth-proposed blocks to have GasUsed=0 in the header, which every other client rejects during validation.
The WithReader() call creates a deep copy (Copy()) of the StateDB per-tx. Mutations are captured from the copy, but the copy is discarded — so env.state never accumulates state changes across txs. This causes coinbase balance in BAL entries to not reflect priority fee accumulation from prior transactions. Fix: remove the stateCopy/WithReader path. Execute directly on env.state (which already has a tracked reader from makeEnv), matching the sequential state processor's approach.
MariusVanDerWijden
approved these changes
Mar 24, 2026
974844c
into
ethereum:bal-devnet-3
2 of 3 checks passed
jwasinger
pushed a commit
to jwasinger/go-ethereum
that referenced
this pull request
Mar 31, 2026
## Summary - The BAL refactoring in 5808d21 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
jwasinger
pushed a commit
to jwasinger/go-ethereum
that referenced
this pull request
Mar 31, 2026
## Summary - The BAL refactoring in 5808d21 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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
env.header.GasUsed = env.gasPool.Used()fromapplyTransaction(), causing all geth-proposed blocks to haveGasUsed=0in the headerTest plan
GasUsed=0viadebug_getBadBlockson besu