Skip to content

Commit

Permalink
perf: run cache maintenance tasks on state update
Browse files Browse the repository at this point in the history
  • Loading branch information
Rjected committed Jan 16, 2025
1 parent 441e889 commit 0367a58
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/engine/tree/src/tree/cached_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ impl<S> CachedStateProvider<S> {
}
}

// run pending tasks on all caches
caches.storage_cache.run_pending_tasks();
caches.account_cache.run_pending_tasks();
caches.code_cache.run_pending_tasks();

// create a saved cache with the executed block hash, same metrics, and updated caches
let saved_cache = SavedCache { hash: executed_block_hash, caches, metrics };

Expand Down

0 comments on commit 0367a58

Please sign in to comment.