@@ -100,7 +100,6 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, tra
100100 context := NewEVMBlockContext (header , p .bc , nil )
101101 evm := vm .NewEVM (context , tracingStateDB , tradingState , p .config , cfg )
102102 signer := types .MakeSigner (p .config , blockNumber )
103- coinbaseOwner := getCoinbaseOwner (p .bc , statedb , header , nil )
104103
105104 if p .config .IsPrague (block .Number ()) {
106105 ProcessParentBlockHash (block .ParentHash (), evm )
@@ -146,7 +145,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, tra
146145 }
147146 statedb .SetTxContext (tx .Hash (), i )
148147
149- receipt , gas , tokenFeeUsed , err := ApplyTransactionWithEVM (msg , gp , statedb , blockNumber , blockHash , tx , usedGas , evm , balanceFee , coinbaseOwner )
148+ receipt , gas , tokenFeeUsed , err := ApplyTransactionWithEVM (msg , gp , statedb , blockNumber , blockHash , tx , usedGas , evm , balanceFee )
150149 if err != nil {
151150 return nil , nil , 0 , fmt .Errorf ("could not apply tx %d [%v]: %w" , i , tx .Hash ().Hex (), err )
152151 }
@@ -207,7 +206,6 @@ func (p *StateProcessor) ProcessBlockNoValidator(cBlock *CalculatedBlock, stated
207206 context := NewEVMBlockContext (header , p .bc , nil )
208207 evm := vm .NewEVM (context , tracingStateDB , tradingState , p .config , cfg )
209208 signer := types .MakeSigner (p .config , blockNumber )
210- coinbaseOwner := getCoinbaseOwner (p .bc , statedb , header , nil )
211209
212210 if p .config .IsPrague (block .Number ()) {
213211 ProcessParentBlockHash (block .ParentHash (), evm )
@@ -253,7 +251,7 @@ func (p *StateProcessor) ProcessBlockNoValidator(cBlock *CalculatedBlock, stated
253251 }
254252 statedb .SetTxContext (tx .Hash (), i )
255253
256- receipt , gas , tokenFeeUsed , err := ApplyTransactionWithEVM (msg , gp , statedb , blockNumber , blockHash , tx , usedGas , evm , balanceFee , coinbaseOwner )
254+ receipt , gas , tokenFeeUsed , err := ApplyTransactionWithEVM (msg , gp , statedb , blockNumber , blockHash , tx , usedGas , evm , balanceFee )
257255 if err != nil {
258256 return nil , nil , 0 , err
259257 }
@@ -279,7 +277,7 @@ func (p *StateProcessor) ProcessBlockNoValidator(cBlock *CalculatedBlock, stated
279277// ApplyTransactionWithEVM attempts to apply a transaction to the given state database
280278// and uses the input parameters for its environment similar to ApplyTransaction. However,
281279// this method takes an already created EVM instance as input.
282- func ApplyTransactionWithEVM (msg * Message , gp * GasPool , statedb * state.StateDB , blockNumber * big.Int , blockHash common.Hash , tx * types.Transaction , usedGas * uint64 , evm * vm.EVM , balanceFee * big.Int , coinbaseOwner common. Address ) (receipt * types.Receipt , gasUsed uint64 , tokenFeeUsed bool , err error ) {
280+ func ApplyTransactionWithEVM (msg * Message , gp * GasPool , statedb * state.StateDB , blockNumber * big.Int , blockHash common.Hash , tx * types.Transaction , usedGas * uint64 , evm * vm.EVM , balanceFee * big.Int ) (receipt * types.Receipt , gasUsed uint64 , tokenFeeUsed bool , err error ) {
283281 if hooks := evm .Config .Tracer ; hooks != nil {
284282 if hooks .OnTxStart != nil {
285283 hooks .OnTxStart (evm .GetVMContext (), tx , msg .From )
@@ -458,6 +456,7 @@ func ApplyTransactionWithEVM(msg *Message, gp *GasPool, statedb *state.StateDB,
458456 // End Bypass denylist address
459457
460458 // Apply the transaction to the current state (included in the env)
459+ coinbaseOwner := statedb .GetOwner (evm .Context .Coinbase )
461460 result , err := ApplyMessage (evm , msg , gp , coinbaseOwner )
462461 if err != nil {
463462 return nil , 0 , false , err
@@ -506,17 +505,6 @@ func MakeReceipt(evm *vm.EVM, result *ExecutionResult, statedb *state.StateDB, b
506505 return receipt
507506}
508507
509- func getCoinbaseOwner (bc * BlockChain , statedb * state.StateDB , header * types.Header , author * common.Address ) common.Address {
510- // If we don't have an explicit author (i.e. not mining), extract from the header
511- var beneficiary common.Address
512- if author == nil {
513- beneficiary , _ = bc .Engine ().Author (header ) // Ignore error, we're past header validation
514- } else {
515- beneficiary = * author
516- }
517- return statedb .GetOwner (beneficiary )
518- }
519-
520508// ApplyTransaction attempts to apply a transaction to the given state database
521509// and uses the input parameters for its environment. It returns the receipt
522510// for the transaction, gas used and an error if the transaction failed,
@@ -534,8 +522,7 @@ func ApplyTransaction(tokensFee map[common.Address]*big.Int, evm *vm.EVM, gp *Ga
534522 if err != nil {
535523 return nil , 0 , false , err
536524 }
537- coinbaseOwner := statedb .GetOwner (evm .Context .Coinbase )
538- return ApplyTransactionWithEVM (msg , gp , statedb , header .Number , header .Hash (), tx , usedGas , evm , balanceFee , coinbaseOwner )
525+ return ApplyTransactionWithEVM (msg , gp , statedb , header .Number , header .Hash (), tx , usedGas , evm , balanceFee )
539526}
540527
541528func ApplySignTransaction (msg * Message , config * params.ChainConfig , statedb * state.StateDB , blockNumber * big.Int , blockHash common.Hash , tx * types.Transaction , usedGas * uint64 , evm * vm.EVM ) (receipt * types.Receipt , gasUsed uint64 , tokenFeeUsed bool , err error ) {
0 commit comments