Skip to content

chore(skeleton): hide private field in EdgePathLength #177

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

Merged

Conversation

TzahiTaub
Copy link
Contributor

@TzahiTaub TzahiTaub commented Jun 2, 2024

This change is Reviewable

@TzahiTaub TzahiTaub self-assigned this Jun 2, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jun 2, 2024

Codecov Report

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

Project coverage is 61.74%. Comparing base (907b4d2) to head (4ddfc01).

Files Patch % Lines
...src/patricia_merkle_tree/filled_tree/node_serde.rs 0.00% 1 Missing and 1 partial ⚠️
...ted_skeleton_tree/compute_updated_skeleton_tree.rs 0.00% 1 Missing and 1 partial ⚠️
...itter/src/patricia_merkle_tree/node_data/errors.rs 0.00% 1 Missing ⚠️
...r/src/patricia_merkle_tree/node_data/inner_node.rs 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #177      +/-   ##
==========================================
+ Coverage   61.69%   61.74%   +0.05%     
==========================================
  Files          36       36              
  Lines        1650     1660      +10     
  Branches     1650     1660      +10     
==========================================
+ Hits         1018     1025       +7     
- Misses        583      585       +2     
- Partials       49       50       +1     

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

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


crates/committer/src/patricia_merkle_tree/test_utils.rs line 27 at r1 (raw file):

                    .expect("String is too large"),
            )
            .expect("Invalid length"),

this is a test util, right? unwrap is allowed and encouraged

Suggestion:

.unwrap()

crates/committer/src/patricia_merkle_tree/filled_tree/node_serde.rs line 119 at r1 (raw file):

                    )
                    .into(),
                    length: EdgePathLength::new(value.0[EDGE_BYTES - 1]).expect("Illegal length"),

I wouldn't expect here, this is deserialization code, the caller should handle this error...
WDYT? non-blocking

Suggestion:

length: EdgePathLength::new(value.0[EDGE_BYTES - 1])?

@TzahiTaub TzahiTaub force-pushed the tzahi/skeleton/hide_private_field_in_EdgePathLength branch from 03f6b41 to ef1f9dc Compare June 2, 2024 14:36
Copy link
Contributor Author

@TzahiTaub TzahiTaub 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: 14 of 16 files reviewed, 2 unresolved discussions (waiting on @dorimedini-starkware and @TzahiTaub)


crates/committer/src/patricia_merkle_tree/test_utils.rs line 27 at r1 (raw file):

Previously, dorimedini-starkware wrote…

this is a test util, right? unwrap is allowed and encouraged

Tried that, getting error: used unwrap()on aResult value from clippy.


crates/committer/src/patricia_merkle_tree/filled_tree/node_serde.rs line 119 at r1 (raw file):

Previously, dorimedini-starkware wrote…

I wouldn't expect here, this is deserialization code, the caller should handle this error...
WDYT? non-blocking

I think there's a lot of work we need to do to propagate errors. Is this one OK specifically for where you pointed to?

Copy link
Contributor Author

@TzahiTaub TzahiTaub 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: 14 of 16 files reviewed, 2 unresolved discussions (waiting on @dorimedini-starkware and @TzahiTaub)


crates/committer/src/patricia_merkle_tree/test_utils.rs line 27 at r1 (raw file):

Previously, TzahiTaub (Tzahi) wrote…

Tried that, getting error: used unwrap()on aResult value from clippy.

Maybe becasue this module is used with feature="testing" and not just test?

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 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @TzahiTaub)


crates/committer/src/patricia_merkle_tree/test_utils.rs line 27 at r1 (raw file):

Previously, TzahiTaub (Tzahi) wrote…

Maybe becasue this module is used with feature="testing" and not just test?

ah... is this needed from the cli area?

Copy link
Contributor Author

@TzahiTaub TzahiTaub 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: :shipit: complete! all files reviewed, all discussions resolved (waiting on @TzahiTaub)


crates/committer/src/patricia_merkle_tree/test_utils.rs line 27 at r1 (raw file):

Previously, dorimedini-starkware wrote…

ah... is this needed from the cli area?

@AvivYossef-starkware ?

Copy link
Collaborator

@AvivYossef-starkware AvivYossef-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: :shipit: complete! all files reviewed, all discussions resolved (waiting on @TzahiTaub)


crates/committer/src/patricia_merkle_tree/test_utils.rs line 27 at r1 (raw file):

Previously, TzahiTaub (Tzahi) wrote…

@AvivYossef-starkware ?

You are right. feature="testing"is not like a test.
However, You can use the snippet on your test function and clippy will allow use of unwrap

Code snippet:

#[allow(clippy::unwrap_used)]

@TzahiTaub TzahiTaub force-pushed the tzahi/skeleton/hide_private_field_in_EdgePathLength branch from ef1f9dc to 4ddfc01 Compare June 3, 2024 08:20
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 4 of 4 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @TzahiTaub)

@TzahiTaub TzahiTaub added this pull request to the merge queue Jun 3, 2024
Merged via the queue into main with commit 8ed29fd Jun 3, 2024
11 checks passed
@TzahiTaub TzahiTaub deleted the tzahi/skeleton/hide_private_field_in_EdgePathLength branch June 3, 2024 08:46
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.

4 participants