starknet_committer: create storage tries concurrently#13632
starknet_committer: create storage tries concurrently#13632nimrod-starkware merged 1 commit intomainfrom
Conversation
fd2835b to
9ab4585
Compare
99fe9ee to
ffd8c2b
Compare
ArielElp
left a comment
There was a problem hiding this comment.
@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_committer/src/db/trie_traversal.rs line 494 at r1 (raw file):
Send + Sync, for<'b> <Layout as NodeLayout<'b, <Layout as NodeLayoutFor<StarknetStorageValue>>::DbLeaf>>::NodeData: Send,
Lose these bounds everywhere in this file and add them at the trait level in db_layout.rs, add Send on NodeData and Send+Sync on SubTree. A little less general but worth it IMO, we only use simple types here.
Code quote:
for<'b> <Layout as NodeLayout<'b, <Layout as NodeLayoutFor<StarknetStorageValue>>::DbLeaf>>::SubTree:
Send + Sync,
for<'b> <Layout as NodeLayout<'b, <Layout as NodeLayoutFor<StarknetStorageValue>>::DbLeaf>>::NodeData:
Send,ffd8c2b to
108778e
Compare
9c65e69 to
0bd0e8d
Compare
0bd0e8d to
f5347be
Compare
108778e to
11b6b54
Compare
f5347be to
86480d5
Compare
11b6b54 to
1aa095e
Compare
86480d5 to
701127d
Compare
1aa095e to
4a27ae2
Compare
nimrod-starkware
left a comment
There was a problem hiding this comment.
@nimrod-starkware made 1 comment.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on ArielElp and nimrod-starkware).
crates/starknet_committer/src/db/trie_traversal.rs line 494 at r1 (raw file):
Previously, ArielElp wrote…
Lose these bounds everywhere in this file and add them at the trait level in db_layout.rs, add Send on NodeData and Send+Sync on SubTree. A little less general but worth it IMO, we only use simple types here.
Done.
701127d to
b1c33a3
Compare
4a27ae2 to
767c891
Compare
ArielElp
left a comment
There was a problem hiding this comment.
@ArielElp reviewed 3 files and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on nimrod-starkware).
767c891 to
b0023e2
Compare
b1c33a3 to
6633956
Compare
PR SummaryMedium Risk Overview Updates Reviewed by Cursor Bugbot for commit 8cca25e. Bugbot is set up for automated code reviews on this repo. Configure here. |
dorimedini-starkware
left a comment
There was a problem hiding this comment.
@dorimedini-starkware reviewed 3 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on nimrod-starkware).
crates/starknet_committer/src/db/trie_traversal.rs line 520 at r4 (raw file):
<Layout as NodeLayoutFor<StarknetStorageValue>>::DbLeaf: HasStaticPrefix<KeyContext = ContractAddress>, {
better to be consistent, at least in a single signature
Suggestion:
async fn create_storage_tries_concurrently<'a, S, Layout>(
storage: &mut S,
actual_storage_updates: &'a HashMap<ContractAddress, LeafModifications<StarknetStorageValue>>,
original_contracts_trie_leaves: &HashMap<NodeIndex, ContractState>,
warn_on_trivial_modifications: bool,
storage_tries_sorted_indices: &'a HashMap<ContractAddress, SortedLeafIndices<'a>>,
) -> ForestResult<HashMap<ContractAddress, OriginalSkeletonTreeImpl<'a>>>
where
S: ImmutableReadOnlyStorage,
Layout: NodeLayoutFor<StarknetStorageValue> + Send + 'static,
<Layout as NodeLayoutFor<StarknetStorageValue>>::DbLeaf:
HasStaticPrefix<KeyContext = ContractAddress>,
{b0023e2 to
f06cd35
Compare
6633956 to
51ca741
Compare
nimrod-starkware
left a comment
There was a problem hiding this comment.
@nimrod-starkware made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on dorimedini-starkware).
crates/starknet_committer/src/db/trie_traversal.rs line 520 at r4 (raw file):
Previously, dorimedini-starkware wrote…
better to be consistent, at least in a single signature
Done.
dorimedini-starkware
left a comment
There was a problem hiding this comment.
@dorimedini-starkware reviewed 1 file and all commit messages, and resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on nimrod-starkware).
f06cd35 to
f636314
Compare
51ca741 to
fa2b94b
Compare
f636314 to
f32b92e
Compare
dorimedini-starkware
left a comment
There was a problem hiding this comment.
@dorimedini-starkware reviewed 1 file and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on nimrod-starkware).
fa2b94b to
c9282b4
Compare
f32b92e to
c1ab4af
Compare
c1ab4af to
6253637
Compare
c9282b4 to
1b7c56c
Compare
6253637 to
8cca25e
Compare
nimrod-starkware
left a comment
There was a problem hiding this comment.
@nimrod-starkware reviewed all commit messages.
Reviewable status: 3 of 4 files reviewed, all discussions resolved.
dorimedini-starkware
left a comment
There was a problem hiding this comment.
@dorimedini-starkware reviewed 1 file and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on nimrod-starkware).

Note
Medium Risk
Introduces a new concurrent code path for building per-contract storage tries and tightens
NodeLayouttrait bounds (Send/Sync), which can affect implementors and has typical concurrency/correctness risks despite the new path currently being unused (dead_code).Overview
Adds scaffolding to build per-contract storage trie original skeletons concurrently via
ImmutableReadOnlyStorage::gather: introducesTrieReadTaskimplementingStorageTaskand a newcreate_storage_tries_concurrentlyhelper that fans out one task per contract and collects results.Updates
starknet_patricia::NodeLayoutto requireSendonNodeDataandSend + SynconSubTreeto support cross-task execution.Reviewed by Cursor Bugbot for commit 767c891. Bugbot is set up for automated code reviews on this repo. Configure here.