@@ -98,7 +98,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
9898 }
9999 statedb .SetTxContext (tx .Hash (), i )
100100
101- receipt , err := ApplyTransactionWithEVM (msg , gp , statedb , blockNumber , blockHash , tx , usedGas , evm )
101+ receipt , err := ApplyTransactionWithEVM (msg , gp , statedb , blockNumber , blockHash , context . Time , tx , usedGas , evm )
102102 if err != nil {
103103 return nil , fmt .Errorf ("could not apply tx %d [%v]: %w" , i , tx .Hash ().Hex (), err )
104104 }
@@ -137,7 +137,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
137137// ApplyTransactionWithEVM attempts to apply a transaction to the given state database
138138// and uses the input parameters for its environment similar to ApplyTransaction. However,
139139// this method takes an already created EVM instance as input.
140- 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 ) {
140+ 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 ) {
141141 if hooks := evm .Config .Tracer ; hooks != nil {
142142 if hooks .OnTxStart != nil {
143143 hooks .OnTxStart (evm .GetVMContext (), tx , msg .From )
@@ -166,11 +166,11 @@ func ApplyTransactionWithEVM(msg *Message, gp *GasPool, statedb *state.StateDB,
166166 statedb .AccessEvents ().Merge (evm .AccessEvents )
167167 }
168168
169- return MakeReceipt (evm , result , statedb , blockNumber , blockHash , tx , * usedGas , root ), nil
169+ return MakeReceipt (evm , result , statedb , blockNumber , blockHash , blockTime , tx , * usedGas , root ), nil
170170}
171171
172172// MakeReceipt generates the receipt object for a transaction given its execution result.
173- 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 {
173+ 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 {
174174 // Create a new receipt for the transaction, storing the intermediate root and gas used
175175 // by the tx.
176176 receipt := & types.Receipt {Type : tx .Type (), PostState : root , CumulativeGasUsed : usedGas }
@@ -193,7 +193,7 @@ func MakeReceipt(evm *vm.EVM, result *ExecutionResult, statedb *state.StateDB, b
193193 }
194194
195195 // Set the receipt logs and create the bloom filter.
196- receipt .Logs = statedb .GetLogs (tx .Hash (), blockNumber .Uint64 (), blockHash )
196+ receipt .Logs = statedb .GetLogs (tx .Hash (), blockNumber .Uint64 (), blockHash , blockTime )
197197 receipt .Bloom = types .CreateBloom (receipt )
198198 receipt .BlockHash = blockHash
199199 receipt .BlockNumber = blockNumber
@@ -211,7 +211,7 @@ func ApplyTransaction(evm *vm.EVM, gp *GasPool, statedb *state.StateDB, header *
211211 return nil , err
212212 }
213213 // Create a new context to be used in the EVM environment
214- return ApplyTransactionWithEVM (msg , gp , statedb , header .Number , header .Hash (), tx , usedGas , evm )
214+ return ApplyTransactionWithEVM (msg , gp , statedb , header .Number , header .Hash (), header . Time , tx , usedGas , evm )
215215}
216216
217217// ProcessBeaconBlockRoot applies the EIP-4788 system call to the beacon block root
0 commit comments