starknet_committer: support both layouts in fetch_patricia_paths#13958
starknet_committer: support both layouts in fetch_patricia_paths#13958ArielElp wants to merge 1 commit into
Conversation
1ace527 to
61f0e7e
Compare
61f0e7e to
b6f331e
Compare
PR SummaryMedium Risk Overview Updates the traversal algorithm to cope with layouts where child hashes aren’t embedded in the parent value by queuing “hash-only” reads for unmodified children and deferring Adjusts call sites in Reviewed by Cursor Bugbot for commit 22de1c4. Bugbot is set up for automated code reviews on this repo. Configure here. |
yoavGrs
left a comment
There was a problem hiding this comment.
@yoavGrs made 1 comment.
Reviewable status: 0 of 4 files reviewed, 1 unresolved discussion (waiting on ArielElp).
a discussion (no related file):
Please separate moving the file from the changes made inside it. It’ll make it easier for me to review the changes.
yoavGrs
left a comment
There was a problem hiding this comment.
@yoavGrs reviewed 1 file, made 6 comments, and resolved 1 discussion.
Reviewable status: 1 of 4 files reviewed, 6 unresolved discussions (waiting on ArielElp).
crates/starknet_committer/src/db/facts_db/traversal.rs line 53 at r1 (raw file):
} // TODO(Rotem): Match the python logic of fetching the nodes.
What about this TODO?
On this point, is there a note in the test that we are collecting too many nodes?
Code quote:
// TODO(Rotem): Match the python logic of fetching the nodes.crates/starknet_committer/src/db/trie_traversal.rs line 57 at r1 (raw file):
#[cfg(test)] #[path = "facts_db/traversal_test.rs"]
The test should be beside the corresponding module.
Code quote:
"facts_db/traversal_test.rs"crates/starknet_committer/src/db/trie_traversal.rs line 61 at r1 (raw file):
/// Logs out a warning of a trivial modification. macro_rules! log_trivial_modification {
Move it down, please.
(Top-down Ordering)
Code quote:
macro_rules! log_trivial_modification crates/starknet_committer/src/db/trie_traversal.rs line 67 at r1 (raw file):
} /// Returns the Patricia inner nodes ([PreimageMap]) in the paths to the given `leaf_indices` in the
With the siblings?
Code quote:
in the paths to the given `leaf_indices`crates/starknet_committer/src/db/trie_traversal.rs line 101 at r1 (raw file):
/// Required for `patricia_update` function in Cairo. /// Extra preimages (more than the data required to verify merkle paths) are required to verify /// correctness of final tree topology; for more details see 'traverse_edge' in 'patricia.cairo'.
Not in this repo
Code quote:
see 'traverse_edge' in 'patricia.cairo'crates/starknet_committer/src/db/trie_traversal.rs line 129 at r1 (raw file):
while !current_traversal.is_empty() || !current_hash_only.is_empty() { read_hashes::<L, Layout>(¤t_hash_only, storage, key_context, &mut hash_by_index) .await?;
Can you read all the hashes for the waiting hash-only vector outside the loop?
Code quote:
read_hashes::<L, Layout>(¤t_hash_only, storage, key_context, &mut hash_by_index)
.await?;b6f331e to
22de1c4
Compare

No description provided.