Skip to content
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

fix: supporting commit for non modified trees #208

Merged
merged 1 commit into from
Jun 9, 2024

Conversation

nimrod-starkware
Copy link
Contributor

@nimrod-starkware nimrod-starkware commented Jun 9, 2024

This change is Reviewable

@codecov-commenter
Copy link

codecov-commenter commented Jun 9, 2024

Codecov Report

Attention: Patch coverage is 84.09091% with 7 lines in your changes missing coverage. Please review.

Project coverage is 63.67%. Comparing base (d26e0e5) to head (019e82b).

Files Patch % Lines
...patricia_merkle_tree/updated_skeleton_tree/tree.rs 50.00% 3 Missing ⚠️
...itter/src/patricia_merkle_tree/filled_tree/tree.rs 85.71% 1 Missing and 1 partial ⚠️
...ted_skeleton_tree/compute_updated_skeleton_tree.rs 87.50% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #208      +/-   ##
==========================================
+ Coverage   63.07%   63.67%   +0.59%     
==========================================
  Files          36       36              
  Lines        1617     1660      +43     
  Branches     1617     1660      +43     
==========================================
+ Hits         1020     1057      +37     
- Misses        548      552       +4     
- Partials       49       51       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nimrod-starkware nimrod-starkware force-pushed the nimrod/add_root_hash_field_to_filled_tree branch 5 times, most recently from 25af418 to 5cf4e53 Compare June 9, 2024 09:15
Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a 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 r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @nimrod-starkware and @TzahiTaub)


crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/compute_updated_skeleton_tree.rs line 405 at r1 (raw file):

    }

    pub(crate) fn create_unmodified(

this has to be pub(crate)? if it's private you can't call it from create?

Code quote:

pub(crate) 

crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/compute_updated_skeleton_tree.rs line 413 at r1 (raw file):

            .ok_or(UpdatedSkeletonTreeError::MissingNode(NodeIndex::ROOT))?;
        let OriginalSkeletonNode::UnmodifiedSubTree(root_hash) = original_root_node else {
            panic!("A root of tree without modifications is expected to be a sibling.")

Suggestion:

be an unmodified node

crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/compute_updated_skeleton_tree_test.rs line 502 at r1 (raw file):

#[rstest]
#[case::empty_tree(0)]

is there an EMPTY_HASH or EMPTY_ROOT constant you can use?

Code quote:

0

@nimrod-starkware nimrod-starkware force-pushed the nimrod/add_root_hash_field_to_filled_tree branch 2 times, most recently from e1339a2 to 7be9856 Compare June 9, 2024 09:48
@nimrod-starkware nimrod-starkware changed the base branch from nimrod/add_root_hash_field_to_filled_tree to main June 9, 2024 09:51
@nimrod-starkware nimrod-starkware force-pushed the nimrod/non_modified_tree_handle branch 2 times, most recently from 2ab72c2 to db4608a Compare June 9, 2024 09:55
Copy link
Contributor Author

@nimrod-starkware nimrod-starkware left a 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 6 files reviewed, 3 unresolved discussions (waiting on @dorimedini-starkware and @TzahiTaub)


crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/compute_updated_skeleton_tree.rs line 405 at r1 (raw file):

Previously, dorimedini-starkware wrote…

this has to be pub(crate)? if it's private you can't call it from create?

yes it can't be private, i think because i call it under impl UpdatedSkeletonTree for UpdatedSkeletonTreeImpl and not under impl UpdatedSkeletonTree


crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/compute_updated_skeleton_tree.rs line 413 at r1 (raw file):

            .ok_or(UpdatedSkeletonTreeError::MissingNode(NodeIndex::ROOT))?;
        let OriginalSkeletonNode::UnmodifiedSubTree(root_hash) = original_root_node else {
            panic!("A root of tree without modifications is expected to be a sibling.")

Done.


crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/compute_updated_skeleton_tree_test.rs line 502 at r1 (raw file):

Previously, dorimedini-starkware wrote…

is there an EMPTY_HASH or EMPTY_ROOT constant you can use?

Done.

@nimrod-starkware nimrod-starkware force-pushed the nimrod/non_modified_tree_handle branch from db4608a to 006181c Compare June 9, 2024 10:00
@nimrod-starkware nimrod-starkware force-pushed the nimrod/non_modified_tree_handle branch from 006181c to 019e82b Compare June 9, 2024 10:01
Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 2 files at r2, 3 of 3 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @TzahiTaub)

@nimrod-starkware nimrod-starkware added this pull request to the merge queue Jun 9, 2024
Merged via the queue into main with commit 5acf423 Jun 9, 2024
12 checks passed
@nimrod-starkware nimrod-starkware deleted the nimrod/non_modified_tree_handle branch June 9, 2024 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants