Skip to content

fix: fetch nodes didn't support empty tree #184

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
merged 1 commit into from
Jun 3, 2024

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 40.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 62.06%. Comparing base (303f6d7) to head (414d370).

Files Patch % Lines
..._merkle_tree/original_skeleton_tree/create_tree.rs 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #184      +/-   ##
==========================================
- Coverage   62.13%   62.06%   -0.07%     
==========================================
  Files          36       36              
  Lines        1624     1629       +5     
  Branches     1624     1629       +5     
==========================================
+ Hits         1009     1011       +2     
- Misses        565      568       +3     
  Partials       50       50              

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


crates/committer/src/hash/hash_trait.rs line 9 at r1 (raw file):

    #[allow(dead_code)]
    pub(crate) const ZERO: HashOutput = HashOutput(Felt::ZERO);
    pub(crate) const EMPTY_NODE: HashOutput = Self::ZERO;

please rename for clarity - for example, an "empty ContractState" (which is a leaf node with three zeros as data) will not have a hash that is equal to zero

Suggestion:

pub(crate) const ROOT_OF_EMPTY_TREE: HashOutput = Self::ZERO;

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


crates/committer/src/hash/hash_trait.rs line 9 at r1 (raw file):

Previously, dorimedini-starkware wrote…

please rename for clarity - for example, an "empty ContractState" (which is a leaf node with three zeros as data) will not have a hash that is equal to zero

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 2 of 2 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 5ca884e Jun 3, 2024
12 checks passed
@nimrod-starkware nimrod-starkware deleted the nimrod/empty_root branch June 3, 2024 12:02
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