Skip to content

feat: added OriginalSkeletonInputNode enum to remove generic leaf fro… #168

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 2, 2024

Conversation

dorimedini-starkware
Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware commented May 30, 2024

…m skeleton


This change is Reviewable

Copy link
Collaborator Author

@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.

Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on @nimrod-starkware and @TzahiTaub)


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

        } else if value.0.len() == EDGE_BYTES {
            return Ok(Self {
                hash: HashOutput(Felt::from_bytes_be_slice(&key.0)),

this wasn't used

Code quote:

hash: HashOutput(Felt::from_bytes_be_slice(&key.0)),

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

            });
        } else {
            // TODO(Nimrod, 5/5/2024): See if deserializing leaves data is needed somewhere.

seems that it isn't for the moment, and I can't imagine why it would be needed for the skeleton

Code quote:

// TODO(Nimrod, 5/5/2024): See if deserializing leaves data is needed somewhere.

Copy link
Contributor

@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.

Reviewed 3 of 4 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @dorimedini-starkware and @TzahiTaub)


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

type FilledNodeSerializationResult = Result<StorageValue, SerializationError>;
type OriginalSkeletonInputNodeDeserializationResult =
    Result<OriginalSkeletonInputNode, DeserializationError>;

I think the name is too long; maybe would be better to remove it?

Code quote:

type OriginalSkeletonInputNodeDeserializationResult =
    Result<OriginalSkeletonInputNode, DeserializationError>;

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

        key: &StorageKey,
        value: &StorageValue,
    ) -> OriginalSkeletonInputNodeDeserializationResult {

Result<OriginalSkeletonInputNode, DeserializationError>

Code quote:

OriginalSkeletonInputNodeDeserializationResult

@dorimedini-starkware dorimedini-starkware force-pushed the dori/skeleton-input-node branch from d48007c to 3165a23 Compare June 2, 2024 08:46
Copy link
Collaborator Author

@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.

Reviewable status: 3 of 4 files reviewed, 4 unresolved discussions (waiting on @nimrod-starkware and @TzahiTaub)


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

Previously, nimrod-starkware wrote…

I think the name is too long; maybe would be better to remove it?

Done.


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

Previously, nimrod-starkware wrote…

Result<OriginalSkeletonInputNode, DeserializationError>

Done.
also remove FilledNodeSerializationResult, which was unused

@codecov-commenter
Copy link

codecov-commenter commented Jun 2, 2024

Codecov Report

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

Project coverage is 61.95%. Comparing base (15f126d) to head (b7816af).
Report is 2 commits behind head on main.

Files Patch % Lines
...src/patricia_merkle_tree/filled_tree/node_serde.rs 95.45% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #168      +/-   ##
==========================================
- Coverage   62.27%   61.95%   -0.33%     
==========================================
  Files          35       35              
  Lines        1662     1682      +20     
  Branches     1662     1682      +20     
==========================================
+ Hits         1035     1042       +7     
- Misses        578      591      +13     
  Partials       49       49              

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

Copy link
Contributor

@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.

:lgtm:

Reviewable status: 3 of 4 files reviewed, 2 unresolved discussions (waiting on @TzahiTaub)

@dorimedini-starkware dorimedini-starkware force-pushed the dori/skeleton-input-node branch from 3165a23 to 36153ea Compare June 2, 2024 10:48
…m skeleton

Signed-off-by: Dori Medini <dori@starkware.co>
@dorimedini-starkware dorimedini-starkware force-pushed the dori/skeleton-input-node branch from 36153ea to b7816af Compare June 2, 2024 13:02
Copy link
Contributor

@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.

:lgtm:

Reviewed 1 of 1 files at r3, 3 of 3 files at r4.
Reviewable status: 3 of 4 files reviewed, 3 unresolved discussions (waiting on @dorimedini-starkware)


crates/committer/src/patricia_merkle_tree/original_skeleton_tree/create_tree_test.rs line 5 at r4 (raw file):

use crate::patricia_merkle_tree::node_data::inner_node::{EdgePathLength, PathToBottom};
use crate::patricia_merkle_tree::node_data::leaf::LeafModifications;
use crate::patricia_merkle_tree::original_skeleton_tree::create_tree::LeafDataImpl;

Was this an import of an import?

Code quote:

use crate::patricia_merkle_tree::original_skeleton_tree::create_tree::LeafDataImpl;

Copy link
Collaborator Author

@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.

Reviewable status: 3 of 4 files reviewed, 2 unresolved discussions (waiting on @dorimedini-starkware and @TzahiTaub)


crates/committer/src/patricia_merkle_tree/original_skeleton_tree/create_tree_test.rs line 5 at r4 (raw file):

Previously, TzahiTaub (Tzahi) wrote…

Was this an import of an import?

apparently

Copy link
Collaborator Author

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

@dorimedini-starkware dorimedini-starkware added this pull request to the merge queue Jun 2, 2024
Merged via the queue into main with commit 108bcbb Jun 2, 2024
11 checks passed
Copy link
Contributor

@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: :shipit: complete! all files reviewed, all discussions resolved


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

Previously, dorimedini-starkware wrote…

this wasn't used

@dorimedini-starkware
I think that we actually need the hash, right?
Imagine this case where the hash is addition.
3
/
2
/
1 1

We want the root to be 3 (not 2)

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