@@ -61,6 +61,42 @@ fn get_gas_price(tx: &OpTxEnvelope) -> Result<u128, RiseTransactionParsingError>
6161 }
6262}
6363
64+ impl PevmRise {
65+ fn build_evm_inner < DB : Database , const IS_PEVM : bool > (
66+ & self ,
67+ spec_id : OpSpecId ,
68+ block_env : BlockEnv ,
69+ db : DB ,
70+ ) -> OpEvm <
71+ Context <
72+ BlockEnv ,
73+ OpTransaction < TxEnv > ,
74+ CfgEnv < OpSpecId > ,
75+ DB ,
76+ crate :: journal:: Journal < DB , IS_PEVM > ,
77+ L1BlockInfo ,
78+ > ,
79+ ( ) ,
80+ > {
81+ let cfg = CfgEnv :: new_with_spec ( spec_id) . with_chain_id ( RISE_CHAIN_ID ) ;
82+ let journal_cfg = JournalCfg {
83+ spec : spec_id. into ( ) ,
84+ eip7708_disabled : cfg. amsterdam_eip7708_disabled ,
85+ eip7708_delayed_burn_disabled : cfg. amsterdam_eip7708_delayed_burn_disabled ,
86+ } ;
87+ Context {
88+ block : block_env,
89+ tx : OpTransaction :: default ( ) ,
90+ cfg,
91+ journaled_state : crate :: journal:: Journal :: < DB , IS_PEVM > :: new ( db, journal_cfg) ,
92+ chain : L1BlockInfo :: default ( ) ,
93+ local : LocalContext :: default ( ) ,
94+ error : Ok ( ( ) ) ,
95+ }
96+ . build_op ( )
97+ }
98+ }
99+
64100impl PevmChain for PevmRise {
65101 type Network = op_alloy_network:: Optimism ;
66102 type Transaction = op_alloy_rpc_types:: Transaction ;
@@ -76,6 +112,17 @@ impl PevmChain for PevmRise {
76112 > ,
77113 ( ) ,
78114 > ;
115+ type PevmEvm < DB : Database > = OpEvm <
116+ Context <
117+ BlockEnv ,
118+ op_revm:: OpTransaction < TxEnv > ,
119+ CfgEnv < op_revm:: OpSpecId > ,
120+ DB ,
121+ crate :: journal:: Journal < DB , true > ,
122+ op_revm:: L1BlockInfo ,
123+ > ,
124+ ( ) ,
125+ > ;
79126 type EvmSpecId = OpSpecId ;
80127 type EvmTx = OpTransaction < TxEnv > ;
81128 type EvmHaltReason = OpHaltReason ;
@@ -106,22 +153,16 @@ impl PevmChain for PevmRise {
106153 block_env : BlockEnv ,
107154 db : DB ,
108155 ) -> Self :: Evm < DB > {
109- let cfg = CfgEnv :: new_with_spec ( spec_id) . with_chain_id ( RISE_CHAIN_ID ) ;
110- let journal_cfg = JournalCfg {
111- spec : spec_id. into ( ) ,
112- eip7708_disabled : cfg. amsterdam_eip7708_disabled ,
113- eip7708_delayed_burn_disabled : cfg. amsterdam_eip7708_delayed_burn_disabled ,
114- } ;
115- Context {
116- block : block_env,
117- tx : OpTransaction :: default ( ) ,
118- cfg,
119- journaled_state : crate :: journal:: Journal :: new ( db, journal_cfg) ,
120- chain : L1BlockInfo :: default ( ) ,
121- local : LocalContext :: default ( ) ,
122- error : Ok ( ( ) ) ,
123- }
124- . build_op ( )
156+ self . build_evm_inner :: < DB , false > ( spec_id, block_env, db)
157+ }
158+
159+ fn build_pevm_evm < DB : Database > (
160+ & self ,
161+ spec_id : Self :: EvmSpecId ,
162+ block_env : BlockEnv ,
163+ db : DB ,
164+ ) -> Self :: PevmEvm < DB > {
165+ self . build_evm_inner :: < DB , true > ( spec_id, block_env, db)
125166 }
126167
127168 fn build_mv_memory ( & self , block_env : & BlockEnv , txs : & [ OpTransaction < TxEnv > ] ) -> MvMemory {
@@ -293,7 +334,7 @@ impl PevmChain for PevmRise {
293334 & tx. base
294335 }
295336
296- fn has_nonce < DB : Database > ( & self , evm : & mut Self :: Evm < DB > , tx : & Self :: EvmTx ) -> bool {
337+ fn has_nonce < DB : Database > ( & self , evm : & mut Self :: PevmEvm < DB > , tx : & Self :: EvmTx ) -> bool {
297338 let is_deposit = tx. is_deposit ( ) ;
298339 evm. ctx ( )
299340 . modify_cfg ( |cfg| cfg. disable_nonce_check = is_deposit) ;
0 commit comments