Skip to content

refactor: remove dependency on tree_height parameter on forest impl #182

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

nimrod-starkware
Copy link
Contributor

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

This change is Reviewable

@codecov-commenter
Copy link

codecov-commenter commented Jun 3, 2024

Codecov Report

Attention: Patch coverage is 52.17391% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 63.27%. Comparing base (907b4d2) to head (b9ee89c).
Report is 2 commits behind head on main.

Files Patch % Lines
crates/committer/src/block_committer/commit.rs 0.00% 4 Missing ⚠️
crates/committer/src/block_committer/input.rs 0.00% 4 Missing ⚠️
...ter/src/patricia_merkle_tree/filled_tree/forest.rs 0.00% 1 Missing ⚠️
...kle_tree/original_skeleton_tree/skeleton_forest.rs 80.00% 0 Missing and 1 partial ⚠️
...rkle_tree/updated_skeleton_tree/skeleton_forest.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #182      +/-   ##
==========================================
+ Coverage   61.69%   63.27%   +1.58%     
==========================================
  Files          36       36              
  Lines        1650     1702      +52     
  Branches     1650     1702      +52     
==========================================
+ Hits         1018     1077      +59     
+ Misses        583      575       -8     
- Partials       49       50       +1     

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

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: 0 of 8 files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware and @TzahiTaub)


crates/committer/src/patricia_merkle_tree/types_test.rs line 38 at r1 (raw file):

#[case(15, NodeIndex::FIRST_LEAF + NodeIndex::from(15))]
#[case(0xDEADBEEF, NodeIndex::FIRST_LEAF + NodeIndex::from(0xDEADBEEF))]
fn test_cast_to_node_index(

The test has become quite redundant when the function doesn't depend on tree height; maybe it's better to remove it.

Code quote:

fn test_cast_to_node_index

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 8 of 8 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @nimrod-starkware and @TzahiTaub)


crates/committer/src/patricia_merkle_tree/types_test.rs line 38 at r1 (raw file):

Previously, nimrod-starkware wrote…

The test has become quite redundant when the function doesn't depend on tree height; maybe it's better to remove it.

It checks conversions from contract address and storage key, so not completely redundant


crates/committer/src/patricia_merkle_tree/types_test.rs line 42 at r1 (raw file):

    #[case] expected_node_index: NodeIndex,
    #[values(true, false)] from_contract_address: bool,
) {

shorter, and means the same

Suggestion:

#[rstest]
fn test_cast_to_node_index(
    #[values(0, 15, 0xDEADBEEF)] leaf_index: u128,
    #[values(true, false)] from_contract_address: bool,
) {
    let expected_node_index = NodeIndex::FIRST_LEAF + leaf_index;

@nimrod-starkware nimrod-starkware force-pushed the nimrod/tree_height/remove_tree_height_field_from_original_forest branch from a860c33 to b9ee89c Compare June 3, 2024 08:52
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: all files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware and @TzahiTaub)


crates/committer/src/patricia_merkle_tree/types_test.rs line 42 at r1 (raw file):

Previously, dorimedini-starkware wrote…

shorter, and means the same

Done.

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 1 files at r2, 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 3, 2024
Merged via the queue into main with commit 303f6d7 Jun 3, 2024
12 checks passed
@nimrod-starkware nimrod-starkware deleted the nimrod/tree_height/remove_tree_height_field_from_original_forest branch June 3, 2024 09:39
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