@@ -69,6 +69,7 @@ impl<P: Platform> BlockContext<P> {
6969 attribs : types:: PayloadBuilderAttributes < P > ,
7070 base_state : StateProviderBox ,
7171 chainspec : Arc < types:: ChainSpec < P > > ,
72+ cached : Option < ExecutionCache > ,
7273 ) -> Result < Self , Error < P > > {
7374 let block_env = P :: next_block_environment_context :: < P > (
7475 & chainspec,
@@ -81,8 +82,11 @@ impl<P: Platform> BlockContext<P> {
8182 . next_evm_env ( & parent, & block_env)
8283 . map_err ( Error :: EvmEnv ) ?;
8384
85+ let execution_cached = cached. unwrap_or_default ( ) ;
86+ let provider =
87+ CachedStateProvider :: new_with_caches ( base_state, execution_cached) ;
8488 let mut base_state = State :: builder ( )
85- . with_database ( StateProviderDatabase ( base_state ) )
89+ . with_database ( StateProviderDatabase ( provider ) )
8690 . with_bundle_update ( )
8791 . build ( ) ;
8892
@@ -202,7 +206,8 @@ struct BlockContextInner<P: Platform> {
202206 ///
203207 /// This state has no changes made to it during the payload building process
204208 /// through any of the created checkpoints.
205- base_state : State < StateProviderDatabase < StateProviderBox > > ,
209+ base_state :
210+ State < StateProviderDatabase < CachedStateProvider < StateProviderBox > > > ,
206211
207212 /// The EVM factory configured for the environment in which we are building
208213 /// the payload. This type is used to create individual EVM instances that
0 commit comments