-
Notifications
You must be signed in to change notification settings - Fork 65
starknet_committer,starknet_patricia: remove generic config #10683
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
starknet_committer,starknet_patricia: remove generic config #10683
Conversation
89be22e to
d6df426
Compare
4402c0e to
5a62fc2
Compare
5a62fc2 to
b3f70f7
Compare
d6df426 to
a6375be
Compare
b3f70f7 to
70f1731
Compare
6a65d5a to
bc73073
Compare
70f1731 to
6c50273
Compare
bc73073 to
cc1ef83
Compare
9f1b96e to
c3c62a4
Compare
cc1ef83 to
214868d
Compare
c3c62a4 to
e664009
Compare
214868d to
85a0005
Compare
e664009 to
909fb4e
Compare
85a0005 to
244c030
Compare
909fb4e to
2c4bcff
Compare
244c030 to
0dd3e42
Compare
e31bcb6 to
7f02c8d
Compare
7f02c8d to
ad01f5a
Compare
e6d71c6 to
da5f5c2
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 11 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ArielElp).
crates/starknet_committer/src/patricia_merkle_tree/tree.rs line 35 at r8 (raw file):
Self { compare_modified_leaves: should_compare_modified_leaves } } }
to make it clearer to the user, I would suggest this approach.
I don't think the user of this config should control the boolean directly - the user should know what the underlying DB layout is, not how to properly configure this struct
Suggestion:
impl OriginalSkeletonTrieConfig {
pub fn new_for_facts_db() -> Self {
Self { compare_modified_leaves: false }
}
pub fn new_for_node_index_db() -> Self {
Self { compare_modified_leaves: true }
}
}crates/starknet_committer/src/patricia_merkle_tree/tree.rs line 43 at r8 (raw file):
} pub(crate) struct OriginalSkeletonTrieDontCompareConfig;
why is this type needed...? seems redundant
Code quote:
OriginalSkeletonTrieDontCompareConfig;
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.
@ArielElp made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dorimedini-starkware).
crates/starknet_committer/src/patricia_merkle_tree/tree.rs line 35 at r8 (raw file):
Previously, dorimedini-starkware wrote…
to make it clearer to the user, I would suggest this approach.
I don't think the user of this config should control the boolean directly - the user should know what the underlying DB layout is, not how to properly configure this struct
It's not layout related, we use false for contracts trie where we still don't know about all the modified leaves (we don't yet have the new storage roots).
crates/starknet_committer/src/patricia_merkle_tree/tree.rs line 43 at r8 (raw file):
Previously, dorimedini-starkware wrote…
why is this type needed...? seems redundant
it is used in get_leaves in facts db, and up the stack also in create_contracts_trie
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 made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ArielElp).
crates/starknet_committer/src/patricia_merkle_tree/tree.rs line 35 at r8 (raw file):
Previously, ArielElp wrote…
It's not layout related, we use false for contracts trie where we still don't know about all the modified leaves (we don't yet have the new storage roots).
ok, so new_for_contracts_trie and new_for_class_or_storage_trie then?
crates/starknet_committer/src/patricia_merkle_tree/tree.rs line 43 at r8 (raw file):
Previously, ArielElp wrote…
it is used in get_leaves in facts db, and up the stack also in create_contracts_trie
why not use OriginalSkeletonTrieConfig::new_X (where X depends on the context) up the stack?
da5f5c2 to
d8d9f88
Compare
ad01f5a to
6f69212
Compare
d8d9f88 to
ca195e9
Compare
6f69212 to
9246a81
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 file and all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ArielElp).
9246a81 to
2c4fb00
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 7 files and all commit messages, made 1 comment, and resolved 2 discussions.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @ArielElp).
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.
@ArielElp made 2 comments.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @ArielElp).
crates/starknet_committer/src/patricia_merkle_tree/tree.rs line 35 at r8 (raw file):
Previously, dorimedini-starkware wrote…
ok, so
new_for_contracts_trieandnew_for_class_or_storage_triethen?
Done, but the latter is taken a should_warn_on_trivial_modifications_argument
I also ended up needing:
- new_for_tests - there is at least one test where the value (compare_modified_leaves) is explicitly tested
- default - get_leaves doesn't receive the config with should_warn, it's always false regardless of the trie we're querying
crates/starknet_committer/src/patricia_merkle_tree/tree.rs line 43 at r8 (raw file):
Previously, dorimedini-starkware wrote…
why not use
OriginalSkeletonTrieConfig::new_X(whereXdepends on the context) up the stack?
Done.
ca195e9 to
dfaaf90
Compare
2c4fb00 to
4009808
Compare
dfaaf90 to
8f999d9
Compare
4009808 to
4b27774
Compare
05b0a54

No description provided.