-
Notifications
You must be signed in to change notification settings - Fork 0
chore!: move filled tree factory function to filled tree tree trait #125
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
chore!: move filled tree factory function to filled tree tree trait #125
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #125 +/- ##
==========================================
+ Coverage 72.38% 72.62% +0.23%
==========================================
Files 29 30 +1
Lines 1072 1074 +2
Branches 1072 1074 +2
==========================================
+ Hits 776 780 +4
+ Misses 258 257 -1
+ Partials 38 37 -1 ☔ View full report in Codecov by Sentry. |
32e1676
to
e065fe7
Compare
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: 0 of 9 files reviewed, 5 unresolved discussions (waiting on @amosStarkware, @nimrod-starkware, and @TzahiTaub)
a discussion (no related file):
Outline:
- Moved error variants from the updated tree enum to the filled tree enum
- Moved methods from the updated tree to the filled tree (some became associated function on the way).
- As the updated skeleton no longer outputs a filled tree, it does not need a generic leaf type parameter anymore.
- The filled tree error now needs the
L
leaf type parameter - Added
get_nodes
on the updated skeleton trait so the filled tree creation function has access to skeleton nodes for initilization
crates/committer/src/patricia_merkle_tree/filled_tree/errors.rs
line 0 at r2 (raw file):
- errors moved from updated tree enum to filled tree enum since the construction logic has moved.
derive_more::Display
doesn't work for struct errors (e.g.DoubleUpdate
), so removed this derive and replaced with#[error]
attributes.
crates/committer/src/patricia_merkle_tree/filled_tree/tree.rs
line 0 at r2 (raw file):
Functions copied from updated skeleton tree. Some minor changes:
- methods because associated functions (
self.
->Self::
) - error types changed from updated skeleton error to filled tree error
crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/errors.rs
line 0 at r2 (raw file):
while moving errors from this enum to the filled tree error enum: added the thiserror::Error
derive and the #[error]
attribute
crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/errors.rs
line 15 at r2 (raw file):
}, PoisonedLock(String), NonDroppedPointer(String),
this error was unused
Code quote:
NonDroppedPointer(String),
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: 0 of 9 files reviewed, 5 unresolved discussions (waiting on @amosStarkware, @nimrod-starkware, and @TzahiTaub)
3bc484d
to
1f9b578
Compare
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.
Reviewed 8 of 9 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 8 unresolved discussions (waiting on @amosStarkware, @dorimedini-starkware, and @nimrod-starkware)
crates/committer/src/patricia_merkle_tree/filled_tree/errors.rs
line 21 at r2 (raw file):
SerializeError(#[from] serde_json::Error), #[error(transparent)] UpdatedSkeletonError(#[from] UpdatedSkeletonTreeError),
Why was this added?
Code quote:
UpdatedSkeletonError(#[from] UpdatedSkeletonTreeError),
crates/committer/src/patricia_merkle_tree/filled_tree/tree.rs
line 193 at r2 (raw file):
async fn create<H: HashFunction, TH: TreeHashFunction<L, H>>( updated_skeleton: impl UpdatedSkeletonTree, modifications: &Modifications<L>,
This was changed AFAIK
Suggestion:
LeafModifications
crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/errors.rs
line 4 at r2 (raw file):
#[derive(Debug, thiserror::Error)] #[allow(dead_code)]
Is this needed?
Code quote:
#[allow(dead_code)]
e065fe7
to
530387f
Compare
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: 4 of 9 files reviewed, 4 unresolved discussions (waiting on @amosStarkware, @nimrod-starkware, and @TzahiTaub)
crates/committer/src/patricia_merkle_tree/filled_tree/errors.rs
line 21 at r2 (raw file):
Previously, TzahiTaub (Tzahi) wrote…
Why was this added?
this line in compute_filled_tree_rec
:
let node = updated_skeleton.get_node(index)?;
crates/committer/src/patricia_merkle_tree/filled_tree/tree.rs
line 193 at r2 (raw file):
Previously, TzahiTaub (Tzahi) wrote…
This was changed AFAIK
Done.
530387f
to
2aa06b9
Compare
Signed-off-by: Dori Medini <dori@starkware.co>
2aa06b9
to
d1a5e76
Compare
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.
Reviewed 5 of 5 files at r3, 3 of 3 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @amosStarkware and @nimrod-starkware)
This change is