-
Notifications
You must be signed in to change notification settings - Fork 65
starknet_committer,starknet_patricia: enrich subtree trait to support fetch nodes #10751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
baa03f6 to
b6c3f76
Compare
f3cd943 to
fec938d
Compare
b6c3f76 to
a7ecd43
Compare
fec938d to
525d944
Compare
a7ecd43 to
815ce74
Compare
nimrod-starkware
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nimrod-starkware reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @ArielElp and @yoavGrs)
crates/starknet_patricia/src/patricia_merkle_tree/traversal.rs line 109 at r1 (raw file):
/// When should_traverse_unmodified_children is false, this function is used to get the hash /// of the unmodified child (in this case NodeData will be HashOutput). fn unmodified_child_hash(data: Self::NodeData) -> Option<HashOutput>;
Does that make sense?
Suggestion:
/// When should_traverse_unmodified_children is false, this function is used to get the hash
/// of the unmodified child (in this case NodeData will be HashOutput).
fn unmodified_child_data(data: Self::NodeData) -> Option<Self::NodeData>;crates/starknet_patricia/src/patricia_merkle_tree/traversal.rs line 109 at r1 (raw file):
/// When should_traverse_unmodified_children is false, this function is used to get the hash /// of the unmodified child (in this case NodeData will be HashOutput). fn unmodified_child_hash(data: Self::NodeData) -> Option<HashOutput>;
These two methods are coupled.
WDYT of this:
- Delete
should_traverse_unmodified_children. - Change the signature to
unmodified_child_data(data: Self::NodeData) -> Option<Self::NodeData>.
Where if the return value is Some(...) then it means we should traverse the children, otherwise we should not.
If that works and makes sense please update the doc
Code quote:
/// Indicates whether unmodified children should be traversed during the construction of the
/// original skeleton tree.
fn should_traverse_unmodified_children() -> bool;
/// When should_traverse_unmodified_children is false, this function is used to get the hash
/// of the unmodified child (in this case NodeData will be HashOutput).
fn unmodified_child_hash(data: Self::NodeData) -> Option<HashOutput>;crates/starknet_patricia/src/patricia_merkle_tree/traversal.rs line 117 at r1 (raw file):
) -> DbKeyPrefix; fn get_root_suffix(&self) -> Vec<u8>;
please doc
Suggestion:
fn get_root_suffix(&self) -> Vec<u8>;crates/starknet_patricia/src/patricia_merkle_tree/traversal.rs line 120 at r1 (raw file):
// Need when deserializing the root node from a raw DbValue. fn get_root_context(&self) -> Self::NodeContext;
doc
Suggestion:
/// Returns [Self::NodeContext] needed to deserialize the root node from a raw [DbValue].
fn get_root_context(&self) -> Self::NodeContext;crates/starknet_patricia/src/patricia_merkle_tree/traversal.rs line 120 at r1 (raw file):
// Need when deserializing the root node from a raw DbValue. fn get_root_context(&self) -> Self::NodeContext;
Can this be static?
Suggestion:
fn get_root_context() -> Self::NodeContext;
nimrod-starkware
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 7 unresolved discussions (waiting on @ArielElp and @yoavGrs)
crates/starknet_patricia/src/patricia_merkle_tree/traversal.rs line 33 at r1 (raw file):
/// Extra data a node can carry (e.g. its hash). type NodeData: Copy; type NodeContext;
doc plz
Suggestion:
/// ....
type NodeContext;crates/starknet_committer/src/db/facts_db/types.rs line 20 at r1 (raw file):
} pub type FactDbFilledNode<L> = FilledNode<L, HashOutput>;
see comment in prev PR, keep this def in delete the others please
Code quote:
pub type FactDbFilledNode<L> = FilledNode<L, HashOutput>;815ce74 to
7284233
Compare
525d944 to
0ccc605
Compare
7284233 to
f556106
Compare
0ccc605 to
7cb7c31
Compare
f556106 to
8852e9f
Compare
6ec738c to
7b41917
Compare
7b41917 to
f542a05
Compare
ff190cd to
7860d6b
Compare
7860d6b to
d5e2d5f
Compare
f542a05 to
a33b741
Compare
dorimedini-starkware
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dorimedini-starkware reviewed 2 of 3 files at r4, 1 of 1 files at r6, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @ArielElp)
crates/starknet_patricia/src/patricia_merkle_tree/traversal.rs line 32 at r6 (raw file):
// tree node. Traverse, // Indicates that the child should be skipped as its unmodified and we have its hash.
not sure about the second its
but it is == it's for sure
Suggestion:
as it's unmodified and we have its hashd5e2d5f to
9d631f6
Compare
a33b741 to
a81d4c1
Compare
dorimedini-starkware
left a comment
There was a problem hiding this 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 of 1 files at r7, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @ArielElp)
9d631f6 to
320fb63
Compare
dorimedini-starkware
left a comment
There was a problem hiding this 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 of 1 files at r8, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ArielElp)
crates/starknet_patricia/src/patricia_merkle_tree/traversal.rs line 27 at r8 (raw file):
/// An enum that specifies how to treat unmodified children during the construction of the /// `OriginalSkeletonTree`.
failed the doctest?
why note like this?
Suggestion:
[crate::patricia_merkle_tree::original_skeleton_tree::tree::OriginalSkeletonTree].320fb63 to
814ae29
Compare
ArielElp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware)
crates/starknet_patricia/src/patricia_merkle_tree/traversal.rs line 27 at r8 (raw file):
Previously, dorimedini-starkware wrote…
failed the doctest?
why note like this?
Yep, it just seemed too long, changed
814ae29 to
665c272
Compare
dorimedini-starkware
left a comment
There was a problem hiding this 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 of 1 files at r9, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @ArielElp)
dorimedini-starkware
left a comment
There was a problem hiding this 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 of 1 files at r10, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @ArielElp)

No description provided.