mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 13:21:37 +00:00
miner: fix BAL mutation tracking in applyTransaction
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.
This commit is contained in:
parent
8461385e0d
commit
f16dd7e07f
1 changed files with 0 additions and 6 deletions
|
|
@ -442,12 +442,6 @@ func (miner *Miner) applyTransaction(env *environment, tx *types.Transaction) (*
|
||||||
snap = env.state.Snapshot()
|
snap = env.state.Snapshot()
|
||||||
gp = env.gasPool.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)
|
mutations, receipt, err := core.ApplyTransaction(env.evm, env.gasPool, env.state, env.header, tx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if env.accessList != nil {
|
if env.accessList != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue