Skip to content

starknet_committer: abstract fetch_all_patricia_paths#13991

Open
ArielElp wants to merge 1 commit into
ariel/add_two_layer_storagefrom
ariel/abstract_fetch_all_patricia_paths
Open

starknet_committer: abstract fetch_all_patricia_paths#13991
ArielElp wants to merge 1 commit into
ariel/add_two_layer_storagefrom
ariel/abstract_fetch_all_patricia_paths

Conversation

@ArielElp
Copy link
Copy Markdown
Contributor

@ArielElp ArielElp commented May 7, 2026

No description provided.

Copy link
Copy Markdown
Contributor Author

ArielElp commented May 7, 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.

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

@cursor
Copy link
Copy Markdown

cursor Bot commented May 14, 2026

PR Summary

Medium Risk
Changes trie witness fetching and leaf conversion on a committer-critical path; behavior should match facts layout when FactsNodeLayout is used, but the abstraction touches all three tries.

Overview
fetch_all_patricia_paths is now public and parameterized by a DbLayout type instead of hardcoding facts-db leaf types and FactsNodeLayout. Patricia path fetches for classes, contracts, and per-contract storage use Layout::…DbLeaf and Layout::NodeLayout, with contract trie leaves converted via AsRef / Into when reading storage roots and building ContractState maps.

fetch_previous_and_new_patricia_paths still calls the helper with FactsNodeLayout only; its doc comment notes it only works with facts-layout storage.

Reviewed by Cursor Bugbot for commit 823105d. Bugbot is set up for automated code reviews on this repo. Configure here.

@ArielElp ArielElp changed the base branch from ariel/add_two_layer_storage to graphite-base/13991 May 14, 2026 11:56
Copy link
Copy Markdown
Contributor

@yoavGrs yoavGrs left a comment

Choose a reason for hiding this comment

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

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


crates/starknet_committer/src/patricia_merkle_tree/tree.rs line 129 at r1 (raw file):

        // prove regarding the contract storage.
        let Some(storage_root_hash) =
            leaves.get(idx).map(|leaf| leaf.clone().into().storage_root_hash)

Can you avoid cloning?

Code quote:

leaf.clone().into().storage_root_hash

@ArielElp ArielElp force-pushed the ariel/abstract_fetch_all_patricia_paths branch from 526b5f0 to b6e6d57 Compare May 18, 2026 11:36
@ArielElp ArielElp force-pushed the graphite-base/13991 branch from d746081 to 1fd7795 Compare May 18, 2026 11:36
@ArielElp ArielElp changed the base branch from graphite-base/13991 to ariel/add_two_layer_storage May 18, 2026 11:36
Copy link
Copy Markdown
Contributor Author

@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 partially reviewed 1 file and made 1 comment.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on yoavGrs).


crates/starknet_committer/src/patricia_merkle_tree/tree.rs line 129 at r1 (raw file):

Previously, yoavGrs wrote…

Can you avoid cloning?

Replaced the Clone bound with AsRef to circumvent cloning

@ArielElp ArielElp force-pushed the ariel/add_two_layer_storage branch from 1fd7795 to eb0084f Compare May 18, 2026 13:52
@ArielElp ArielElp force-pushed the ariel/abstract_fetch_all_patricia_paths branch from b6e6d57 to 815bf53 Compare May 18, 2026 13:52
Copy link
Copy Markdown
Contributor

@yoavGrs yoavGrs left a comment

Choose a reason for hiding this comment

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

:lgtm:

@yoavGrs reviewed 1 file and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on ArielElp).

@ArielElp ArielElp force-pushed the ariel/abstract_fetch_all_patricia_paths branch from 815bf53 to 8acac5f Compare May 19, 2026 12:37
@ArielElp ArielElp force-pushed the ariel/add_two_layer_storage branch from eb0084f to 7f68595 Compare May 19, 2026 12:37
@ArielElp ArielElp force-pushed the ariel/add_two_layer_storage branch from 7f68595 to adada4b Compare May 20, 2026 09:03
@ArielElp ArielElp force-pushed the ariel/abstract_fetch_all_patricia_paths branch 2 times, most recently from 9cc1634 to 56288b6 Compare May 20, 2026 09:25
@ArielElp ArielElp force-pushed the ariel/add_two_layer_storage branch from adada4b to 260ae4f Compare May 20, 2026 09:25
Copy link
Copy Markdown
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

@dorimedini-starkware reviewed 1 file and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on ArielElp).

@ArielElp ArielElp force-pushed the ariel/abstract_fetch_all_patricia_paths branch 4 times, most recently from d962c4f to b25db53 Compare May 26, 2026 10:08
@ArielElp ArielElp force-pushed the ariel/add_two_layer_storage branch from 827da80 to 55283c6 Compare May 26, 2026 10:08
@ArielElp ArielElp force-pushed the ariel/abstract_fetch_all_patricia_paths branch from b25db53 to bbe1511 Compare May 26, 2026 13:03
@ArielElp ArielElp force-pushed the ariel/add_two_layer_storage branch from 55283c6 to 9d10dee Compare May 26, 2026 13:03
@ArielElp ArielElp force-pushed the ariel/add_two_layer_storage branch from 9d10dee to dc4126c Compare May 26, 2026 13:11
@ArielElp ArielElp force-pushed the ariel/abstract_fetch_all_patricia_paths branch from bbe1511 to 823105d Compare May 26, 2026 13:11
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.

4 participants