@@ -97,7 +97,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
9797 }
9898 statedb .SetTxContext (tx .Hash (), i )
9999
100- receipt , err := ApplyTransactionWithEVM (msg , gp , statedb , blockNumber , blockHash , tx , usedGas , evm )
100+ receipt , err := ApplyTransactionWithEVM (msg , gp , statedb , blockNumber , blockHash , context . Time , tx , usedGas , evm )
101101 if err != nil {
102102 return nil , fmt .Errorf ("could not apply tx %d [%v]: %w" , i , tx .Hash ().Hex (), err )
103103 }
@@ -136,7 +136,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
136136// ApplyTransactionWithEVM attempts to apply a transaction to the given state database
137137// and uses the input parameters for its environment similar to ApplyTransaction. However,
138138// this method takes an already created EVM instance as input.
139- func ApplyTransactionWithEVM (msg * Message , gp * GasPool , statedb * state.StateDB , blockNumber * big.Int , blockHash common.Hash , tx * types.Transaction , usedGas * uint64 , evm * vm.EVM ) (receipt * types.Receipt , err error ) {
139+ func ApplyTransactionWithEVM (msg * Message , gp * GasPool , statedb * state.StateDB , blockNumber * big.Int , blockHash common.Hash , blockTime uint64 , tx * types.Transaction , usedGas * uint64 , evm * vm.EVM ) (receipt * types.Receipt , err error ) {
140140 if hooks := evm .Config .Tracer ; hooks != nil {
141141 if hooks .OnTxStart != nil {
142142 hooks .OnTxStart (evm .GetVMContext (), tx , msg .From )
@@ -165,11 +165,11 @@ func ApplyTransactionWithEVM(msg *Message, gp *GasPool, statedb *state.StateDB,
165165 statedb .AccessEvents ().Merge (evm .AccessEvents )
166166 }
167167
168- return MakeReceipt (evm , result , statedb , blockNumber , blockHash , tx , * usedGas , root ), nil
168+ return MakeReceipt (evm , result , statedb , blockNumber , blockHash , blockTime , tx , * usedGas , root ), nil
169169}
170170
171171// MakeReceipt generates the receipt object for a transaction given its execution result.
172- func MakeReceipt (evm * vm.EVM , result * ExecutionResult , statedb * state.StateDB , blockNumber * big.Int , blockHash common.Hash , tx * types.Transaction , usedGas uint64 , root []byte ) * types.Receipt {
172+ func MakeReceipt (evm * vm.EVM , result * ExecutionResult , statedb * state.StateDB , blockNumber * big.Int , blockHash common.Hash , blockTime uint64 , tx * types.Transaction , usedGas uint64 , root []byte ) * types.Receipt {
173173 // Create a new receipt for the transaction, storing the intermediate root and gas used
174174 // by the tx.
175175 receipt := & types.Receipt {Type : tx .Type (), PostState : root , CumulativeGasUsed : usedGas }
@@ -192,7 +192,7 @@ func MakeReceipt(evm *vm.EVM, result *ExecutionResult, statedb *state.StateDB, b
192192 }
193193
194194 // Set the receipt logs and create the bloom filter.
195- receipt .Logs = statedb .GetLogs (tx .Hash (), blockNumber .Uint64 (), blockHash )
195+ receipt .Logs = statedb .GetLogs (tx .Hash (), blockNumber .Uint64 (), blockHash , blockTime )
196196 receipt .Bloom = types .CreateBloom (receipt )
197197 receipt .BlockHash = blockHash
198198 receipt .BlockNumber = blockNumber
@@ -210,7 +210,7 @@ func ApplyTransaction(evm *vm.EVM, gp *GasPool, statedb *state.StateDB, header *
210210 return nil , err
211211 }
212212 // Create a new context to be used in the EVM environment
213- return ApplyTransactionWithEVM (msg , gp , statedb , header .Number , header .Hash (), tx , usedGas , evm )
213+ return ApplyTransactionWithEVM (msg , gp , statedb , header .Number , header .Hash (), header . Time , tx , usedGas , evm )
214214}
215215
216216// ProcessBeaconBlockRoot applies the EIP-4788 system call to the beacon block root
0 commit comments