Skip to content

starknet_patricia_storage: flush explictly to cache#12267

Open
nimrod-starkware wants to merge 1 commit intonimrod/parallel-storage-tries/parallel_based_on_configfrom
nimrod/parallel-reads/flush-to-cache
Open

starknet_patricia_storage: flush explictly to cache#12267
nimrod-starkware wants to merge 1 commit intonimrod/parallel-storage-tries/parallel_based_on_configfrom
nimrod/parallel-reads/flush-to-cache

Conversation

@nimrod-starkware
Copy link
Contributor

@nimrod-starkware nimrod-starkware commented Feb 4, 2026

Note

Medium Risk
Introduces a new mutable cache update path that bulk-inserts entries and can change runtime caching behavior; it also uses Arc::get_mut(...).expect(...), so incorrect sharing assumptions could cause panics.

Overview
CachedStorage gains a new flush_to_cache(map: DbHashMap) method that explicitly bulk-populates the LRU cache with a set of key/value pairs, bypassing the existing per-write caching behavior.

This enables callers to proactively warm/refresh the cache from a batch map rather than relying on set/mset updates only.

Written by Cursor Bugbot for commit cc406a4. This will update automatically on new commits. Configure here.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

nimrod-starkware commented Feb 4, 2026

@nimrod-starkware nimrod-starkware force-pushed the nimrod/parallel-reads/remove-dup-storage-trie branch from dd43526 to df90d58 Compare February 9, 2026 15:13
@nimrod-starkware nimrod-starkware force-pushed the nimrod/parallel-reads/flush-to-cache branch 2 times, most recently from 0517529 to 5fc9927 Compare February 10, 2026 08:44
@nimrod-starkware nimrod-starkware force-pushed the nimrod/parallel-reads/remove-dup-storage-trie branch 2 times, most recently from 57e4671 to dddb7d7 Compare February 10, 2026 09:07
@nimrod-starkware nimrod-starkware force-pushed the nimrod/parallel-reads/flush-to-cache branch from 5fc9927 to 8f17cc1 Compare February 10, 2026 09:07
@nimrod-starkware nimrod-starkware changed the base branch from nimrod/parallel-reads/remove-dup-storage-trie to graphite-base/12267 February 10, 2026 09:44
@nimrod-starkware nimrod-starkware force-pushed the nimrod/parallel-reads/flush-to-cache branch from 8f17cc1 to 7a53b42 Compare February 10, 2026 09:44
@nimrod-starkware nimrod-starkware changed the base branch from graphite-base/12267 to nimrod/parallel-storage-tries/parallel_based_on_config February 10, 2026 09:44
@nimrod-starkware nimrod-starkware force-pushed the nimrod/parallel-reads/flush-to-cache branch from 7a53b42 to 6f9605d Compare February 10, 2026 10:32
@nimrod-starkware nimrod-starkware force-pushed the nimrod/parallel-storage-tries/parallel_based_on_config branch from ea60323 to 0e6beb1 Compare February 10, 2026 10:32
@nimrod-starkware nimrod-starkware force-pushed the nimrod/parallel-reads/flush-to-cache branch 2 times, most recently from b79b0e7 to 8fde07e Compare February 17, 2026 07:13
@nimrod-starkware nimrod-starkware force-pushed the nimrod/parallel-storage-tries/parallel_based_on_config branch from 1e445a0 to a662b3c Compare February 17, 2026 07:13
Copy link
Contributor

@ArielElp ArielElp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ArielElp reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on nimrod-starkware).


crates/starknet_patricia_storage/src/map_storage.rs line 227 at r1 (raw file):

    pub fn flush_to_cache(&mut self, map: DbHashMap) {
        let cache =
            Arc::get_mut(&mut self.cache).expect("Failed to get mutable reference to cache.");

We no longer need Arc::get_mut, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments