Skip to content

build: defining skeletons forest input and introducing updated skeleton forest #110

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
May 15, 2024

Conversation

nimrod-starkware
Copy link
Contributor

@nimrod-starkware nimrod-starkware commented May 12, 2024

introducing updated skeleton forest


This change is Reviewable

@nimrod-starkware nimrod-starkware self-assigned this May 12, 2024
@codecov-commenter
Copy link

codecov-commenter commented May 12, 2024

Codecov Report

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

Project coverage is 70.02%. Comparing base (cee54bc) to head (6de04ca).
Report is 1 commits behind head on nimrod/state_diff_methods.

Files Patch % Lines
crates/committer/src/block_committer/input.rs 0.00% 38 Missing ⚠️
crates/committer/src/block_committer/commit.rs 0.00% 23 Missing ⚠️
...kle_tree/original_skeleton_tree/skeleton_forest.rs 70.37% 7 Missing and 1 partial ⚠️
Additional details and impacted files
@@                      Coverage Diff                      @@
##           nimrod/state_diff_methods     #110      +/-   ##
=============================================================
- Coverage                      74.86%   70.02%   -4.85%     
=============================================================
  Files                             26       27       +1     
  Lines                            959     1031      +72     
  Branches                         959     1031      +72     
=============================================================
+ Hits                             718      722       +4     
- Misses                           207      275      +68     
  Partials                          34       34              

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

@nimrod-starkware nimrod-starkware changed the title build: defining skeletons forest input and build: defining skeletons forest input and introducing updated skeleton forest May 12, 2024
@nimrod-starkware nimrod-starkware force-pushed the nimrod/skeletons_input branch from a6928d4 to 0cd7dc5 Compare May 12, 2024 12:28
@nimrod-starkware nimrod-starkware changed the base branch from main to nimrod/state_diff_methods May 13, 2024 09:17
@nimrod-starkware nimrod-starkware force-pushed the nimrod/skeletons_input branch from 0a04175 to d8ab3da Compare May 13, 2024 09:23
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 7 files at r1, 1 of 2 files at r3, all commit messages.
Reviewable status: 6 of 7 files reviewed, 4 unresolved discussions (waiting on @amosStarkware and @nimrod-starkware)


crates/committer/src/block_committer/commit.rs line 30 at r3 (raw file):

                input.tree_heights,
            ),
            &input.state_diff.accessed_addresses(),

this is all leaves of the contract (global) tree that have changed?
i.e. either have a diff in the storage, or a change in nonce/class hash?

Code quote:

input.state_diff.accessed_addresses()

crates/committer/src/block_committer/input.rs line 0 at r3 (raw file):
looks like you aren't rebased...? why are these changes appearing in this PR?


crates/committer/src/patricia_merkle_tree/original_skeleton_tree/skeleton_forest.rs line 65 at r3 (raw file):

        state_diff: &StateDiff,
    ) -> OriginalSkeletonTreeResult<OriginalSkeletonForest<L, T>> {
        let storage = S::from(storage);

this function should work with storage API.
the calling code (currently implemented for storage coming from input) should do the Storage::from part.

Suggestion:

    #[allow(dead_code)]
    pub(crate) fn create_original_skeleton_forest<S: Storage>(
        storage: S,
        global_tree_root_hash: HashOutput,
        classes_tree_root_hash: HashOutput,
        tree_heights: TreeHeight,
        current_contract_state_leaves: &HashMap<ContractAddress, ContractState>,
        state_diff: &StateDiff,
    ) -> OriginalSkeletonTreeResult<OriginalSkeletonForest<L, T>> {

crates/committer/src/patricia_merkle_tree/original_skeleton_tree/skeleton_forest_test.rs line 223 at r3 (raw file):

        &input.current_contract_state_leaves,
        &input.state_diff,
    )

why did you decide to split the Input into explicit parameters on the create_X_forest functions?
(genuine question)

Code quote:

    > = OriginalSkeletonForest::create_original_skeleton_forest::<MapStorage>(
        input.storage,
        input.global_tree_root_hash,
        input.classes_tree_root_hash,
        input.tree_heights,
        &input.current_contract_state_leaves,
        &input.state_diff,
    )

@nimrod-starkware nimrod-starkware force-pushed the nimrod/state_diff_methods branch from 5e7bf9c to 77342bc Compare May 15, 2024 06:21
@nimrod-starkware nimrod-starkware force-pushed the nimrod/skeletons_input branch from d8ab3da to 70670e1 Compare May 15, 2024 06:29
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: 5 of 7 files reviewed, 4 unresolved discussions (waiting on @amosStarkware and @dorimedini-starkware)


crates/committer/src/block_committer/commit.rs line 30 at r3 (raw file):

Previously, dorimedini-starkware wrote…

this is all leaves of the contract (global) tree that have changed?
i.e. either have a diff in the storage, or a change in nonce/class hash?

yes, exactly


crates/committer/src/block_committer/input.rs line at r3 (raw file):

Previously, dorimedini-starkware wrote…

looks like you aren't rebased...? why are these changes appearing in this PR?

should be fine now, sorry


crates/committer/src/patricia_merkle_tree/original_skeleton_tree/skeleton_forest.rs line 65 at r3 (raw file):

Previously, dorimedini-starkware wrote…

this function should work with storage API.
the calling code (currently implemented for storage coming from input) should do the Storage::from part.

Done.


crates/committer/src/patricia_merkle_tree/original_skeleton_tree/skeleton_forest_test.rs line 223 at r3 (raw file):

Previously, dorimedini-starkware wrote…

why did you decide to split the Input into explicit parameters on the create_X_forest functions?
(genuine question)

Isn't it better that a function will take what it actually needs?

introducing updated skeleton forest
@nimrod-starkware nimrod-starkware force-pushed the nimrod/skeletons_input branch from 70670e1 to 6de04ca Compare May 15, 2024 06:41
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 1 of 3 files at r5, all commit messages.
Reviewable status: 4 of 7 files reviewed, 2 unresolved discussions (waiting on @amosStarkware)

@nimrod-starkware nimrod-starkware changed the base branch from nimrod/state_diff_methods to main May 15, 2024 08: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 2 of 3 files at r5, 1 of 1 files at r6, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @amosStarkware)

@nimrod-starkware nimrod-starkware added this pull request to the merge queue May 15, 2024
Merged via the queue into main with commit d072f7d May 15, 2024
19 checks passed
@nimrod-starkware nimrod-starkware deleted the nimrod/skeletons_input branch May 28, 2024 11:38
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