The PR introduces SavedCache::usage_guard, an Arc<()> that is meant to ensure the cached execution state for a parent block cannot be reused while prewarm tasks are still mutating it. ExecutionCache::get_cache_for only returns a cache when SavedCache::is_available() sees the guard's strong count at 1.
PayloadProcessor::spawn_caching_withcallsself.cache_for(env.parent_hash)to fetch the cached state.- Immediately after,
.split()consumes theSavedCacheand returns(ExecutionCache, CachedStateMetrics)so we can wire them into thePrewarmContext.