@@ -4,17 +4,18 @@ use alloy_rlp::{Decodable, Encodable};
4
4
use async_trait:: async_trait;
5
5
use jsonrpsee:: core:: RpcResult ;
6
6
use reth_chainspec:: EthereumHardforks ;
7
+ use reth_evm:: ConfigureEvmEnv ;
7
8
use reth_primitives:: {
8
- revm :: env :: tx_env_with_recovered , Address , Block , BlockId , BlockNumberOrTag , Bytes ,
9
- TransactionSignedEcRecovered , Withdrawals , B256 , U256 ,
9
+ Address , Block , BlockId , BlockNumberOrTag , Bytes , TransactionSignedEcRecovered , Withdrawals ,
10
+ B256 , U256 ,
10
11
} ;
11
12
use reth_provider:: {
12
13
BlockReaderIdExt , ChainSpecProvider , EvmEnvProvider , HeaderProvider , StateProviderFactory ,
13
14
TransactionVariant ,
14
15
} ;
15
16
use reth_revm:: database:: StateProviderDatabase ;
16
17
use reth_rpc_api:: DebugApiServer ;
17
- use reth_rpc_eth_api:: helpers:: { EthApiSpec , EthTransactions , TraceExt } ;
18
+ use reth_rpc_eth_api:: helpers:: { Call , EthApiSpec , EthTransactions , TraceExt } ;
18
19
use reth_rpc_eth_types:: { revm_utils:: prepare_call_env, EthApiError , EthResult , StateCacheDb } ;
19
20
use reth_rpc_server_types:: { result:: internal_rpc_err, ToRpcResult } ;
20
21
use reth_rpc_types:: {
@@ -99,9 +100,13 @@ where
99
100
let mut transactions = transactions. into_iter ( ) . enumerate ( ) . peekable ( ) ;
100
101
while let Some ( ( index, tx) ) = transactions. next ( ) {
101
102
let tx_hash = tx. hash ;
102
- let tx = tx_env_with_recovered ( & tx ) ;
103
+
103
104
let env = EnvWithHandlerCfg {
104
- env : Env :: boxed ( cfg. cfg_env . clone ( ) , block_env. clone ( ) , tx) ,
105
+ env : Env :: boxed (
106
+ cfg. cfg_env . clone ( ) ,
107
+ block_env. clone ( ) ,
108
+ Call :: evm_config ( this. eth_api ( ) ) . tx_env ( & tx) ,
109
+ ) ,
105
110
handler_cfg : cfg. handler_cfg ,
106
111
} ;
107
112
let ( result, state_changes) = this. trace_transaction (
@@ -240,7 +245,11 @@ where
240
245
) ?;
241
246
242
247
let env = EnvWithHandlerCfg {
243
- env : Env :: boxed ( cfg. cfg_env . clone ( ) , block_env, tx_env_with_recovered ( & tx) ) ,
248
+ env : Env :: boxed (
249
+ cfg. cfg_env . clone ( ) ,
250
+ block_env,
251
+ Call :: evm_config ( this. eth_api ( ) ) . tx_env ( & tx) ,
252
+ ) ,
244
253
handler_cfg : cfg. handler_cfg ,
245
254
} ;
246
255
@@ -453,6 +462,7 @@ where
453
462
}
454
463
455
464
let this = self . clone ( ) ;
465
+
456
466
self . inner
457
467
. eth_api
458
468
. spawn_with_state_at_block ( at. into ( ) , move |state| {
@@ -467,9 +477,12 @@ where
467
477
468
478
// Execute all transactions until index
469
479
for tx in transactions {
470
- let tx = tx_env_with_recovered ( & tx) ;
471
480
let env = EnvWithHandlerCfg {
472
- env : Env :: boxed ( cfg. cfg_env . clone ( ) , block_env. clone ( ) , tx) ,
481
+ env : Env :: boxed (
482
+ cfg. cfg_env . clone ( ) ,
483
+ block_env. clone ( ) ,
484
+ Call :: evm_config ( this. eth_api ( ) ) . tx_env ( & tx) ,
485
+ ) ,
473
486
handler_cfg : cfg. handler_cfg ,
474
487
} ;
475
488
let ( res, _) = this. inner . eth_api . transact ( & mut db, env) ?;
0 commit comments