Skip to content

starknet_patricia_storage: extend the storage trait to optionally flush to cache#12269

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

starknet_patricia_storage: extend the storage trait to optionally flush to cache#12269
nimrod-starkware wants to merge 1 commit intonimrod/parallel-reads/flush-to-cachefrom
nimrod/parallel-reads/flush-cache-storage-trait

Conversation

@nimrod-starkware
Copy link
Contributor

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

Note

Low Risk
Small, additive API change with a default no-op implementation; main risk is minor breakage for downstream crates that implement Storage and need to recompile/update.

Overview
Adds a new optional Storage::flush_to_cache(DbHashMap) method (default no-op) so callers can prime caches without coupling to concrete storage types.

Implements the hook for CachedStorage by delegating to its existing flush_to_cache helper, and simplifies that helper to write directly into the LRU cache (removing the Arc::get_mut path).

Written by Cursor Bugbot for commit 206bc01. 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

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@nimrod-starkware nimrod-starkware self-assigned this Feb 4, 2026
@nimrod-starkware nimrod-starkware marked this pull request as ready for review February 4, 2026 12:27
@nimrod-starkware nimrod-starkware changed the base branch from nimrod/parallel-reads/get-updated-skeleton-siblings to graphite-base/12269 February 4, 2026 13:34
@nimrod-starkware nimrod-starkware force-pushed the nimrod/parallel-reads/flush-cache-storage-trait branch from c1769a1 to 63b6032 Compare February 4, 2026 13:34
@nimrod-starkware nimrod-starkware changed the base branch from graphite-base/12269 to nimrod/parallel-reads/flush-to-cache February 4, 2026 13:34
@nimrod-starkware nimrod-starkware changed the title starknet_particia_storage: extend the storage trait to optionally flush to cache starknet_patricia_storage: extend the storage trait to optionally flush to cache Feb 4, 2026
@nimrod-starkware nimrod-starkware force-pushed the nimrod/parallel-reads/flush-to-cache branch from b1c945d to 464262a Compare February 5, 2026 08:27
@nimrod-starkware nimrod-starkware force-pushed the nimrod/parallel-reads/flush-cache-storage-trait branch 2 times, most recently from 180e776 to 6fb0189 Compare February 9, 2026 14:27
@nimrod-starkware nimrod-starkware force-pushed the nimrod/parallel-reads/flush-to-cache branch from 464262a to 589d52b Compare February 9, 2026 14:27
@nimrod-starkware nimrod-starkware force-pushed the nimrod/parallel-reads/flush-cache-storage-trait branch 2 times, most recently from e39bb60 to 5d9789c Compare February 10, 2026 08:44
@nimrod-starkware nimrod-starkware force-pushed the nimrod/parallel-reads/flush-to-cache branch 2 times, most recently from 5fc9927 to 8f17cc1 Compare February 10, 2026 09:07
@nimrod-starkware nimrod-starkware force-pushed the nimrod/parallel-reads/flush-cache-storage-trait branch from 5d9789c to 7ae348e Compare February 10, 2026 09:07
@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 force-pushed the nimrod/parallel-reads/flush-cache-storage-trait branch from 7ae348e to 79b85ab Compare February 10, 2026 09:44
@nimrod-starkware nimrod-starkware force-pushed the nimrod/parallel-reads/flush-cache-storage-trait branch from 79b85ab to 64731a2 Compare February 10, 2026 10:32
@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-reads/flush-to-cache branch from 6f9605d to b79b0e7 Compare February 10, 2026 12:34
@nimrod-starkware nimrod-starkware force-pushed the nimrod/parallel-reads/flush-cache-storage-trait branch 2 times, most recently from 62e5f98 to f54d0f8 Compare February 17, 2026 07:13
@nimrod-starkware nimrod-starkware force-pushed the nimrod/parallel-reads/flush-to-cache branch from b79b0e7 to 8fde07e Compare February 17, 2026 07:13
@nimrod-starkware nimrod-starkware force-pushed the nimrod/parallel-reads/flush-to-cache branch from 8fde07e to cc406a4 Compare February 19, 2026 09:21
@nimrod-starkware nimrod-starkware force-pushed the nimrod/parallel-reads/flush-cache-storage-trait branch from f54d0f8 to 206bc01 Compare February 19, 2026 09:21
@ArielElp ArielElp self-requested a review February 19, 2026 12:41
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 2 files and made 2 comments.
Reviewable status: all files reviewed (commit messages unreviewed), 2 unresolved discussions (waiting on nimrod-starkware).


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

    }

    pub fn flush_to_cache(&mut self, map: DbHashMap) {

remove this and keep the login in the trait implementation


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

        None::<NullStorage>
    }
    fn flush_to_cache(&mut self, map: DbHashMap) -> PatriciaStorageResult<()> {

newline + inline flush_to_cache below

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