@@ -89,6 +89,8 @@ pub struct TreeConfig {
8989 /// Whether to always compare trie updates from the state root task to the trie updates from
9090 /// the regular state root calculation.
9191 always_compare_trie_updates : bool ,
92+ /// Whether to disable state cache.
93+ disable_state_cache : bool ,
9294 /// Whether to disable parallel prewarming.
9395 disable_prewarming : bool ,
9496 /// Whether to disable the parallel sparse trie state root algorithm.
@@ -143,6 +145,7 @@ impl Default for TreeConfig {
143145 max_execute_block_batch_size : DEFAULT_MAX_EXECUTE_BLOCK_BATCH_SIZE ,
144146 legacy_state_root : false ,
145147 always_compare_trie_updates : false ,
148+ disable_state_cache : false ,
146149 disable_prewarming : false ,
147150 disable_parallel_sparse_trie : false ,
148151 state_provider_metrics : false ,
@@ -173,6 +176,7 @@ impl TreeConfig {
173176 max_execute_block_batch_size : usize ,
174177 legacy_state_root : bool ,
175178 always_compare_trie_updates : bool ,
179+ disable_state_cache : bool ,
176180 disable_prewarming : bool ,
177181 disable_parallel_sparse_trie : bool ,
178182 state_provider_metrics : bool ,
@@ -197,6 +201,7 @@ impl TreeConfig {
197201 max_execute_block_batch_size,
198202 legacy_state_root,
199203 always_compare_trie_updates,
204+ disable_state_cache,
200205 disable_prewarming,
201206 disable_parallel_sparse_trie,
202207 state_provider_metrics,
@@ -271,7 +276,12 @@ impl TreeConfig {
271276 self . disable_parallel_sparse_trie
272277 }
273278
274- /// Returns whether or not parallel prewarming should be used.
279+ /// Returns whether or not state cache is disabled.
280+ pub const fn disable_state_cache ( & self ) -> bool {
281+ self . disable_state_cache
282+ }
283+
284+ /// Returns whether or not parallel prewarming is disabled.
275285 pub const fn disable_prewarming ( & self ) -> bool {
276286 self . disable_prewarming
277287 }
@@ -363,6 +373,12 @@ impl TreeConfig {
363373 self
364374 }
365375
376+ /// Setter for whether to disable state cache.
377+ pub const fn without_state_cache ( mut self , disable_state_cache : bool ) -> Self {
378+ self . disable_state_cache = disable_state_cache;
379+ self
380+ }
381+
366382 /// Setter for whether to disable parallel prewarming.
367383 pub const fn without_prewarming ( mut self , disable_prewarming : bool ) -> Self {
368384 self . disable_prewarming = disable_prewarming;
0 commit comments