Skip to content

Conversation

@ArielElp
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

ArielElp commented Dec 10, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

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.

@nimrod-starkware reviewed 18 of 20 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: 19 of 20 files reviewed, 5 unresolved discussions (waiting on @ArielElp)


crates/starknet_committer/src/db/facts_db/types.rs line 43 at r2 (raw file):

            PatriciaPrefix::InnerNode.into()
        }
    }

Please include this change in your previous PR, where you defined SubTreeTrait.

Code quote:

    fn get_root_prefix<L: Leaf>(
        &self,
        _key_context: &<L as HasStaticPrefix>::KeyContext,
    ) -> DbKeyPrefix {
        if self.is_leaf() {
            PatriciaPrefix::Leaf(L::get_static_prefix(_key_context)).into()
        } else {
            PatriciaPrefix::InnerNode.into()
        }
    }

crates/starknet_patricia_storage/src/db_object.rs line 5 at r2 (raw file):

pub trait HasDynamicPrefix {
    type KeyContext;

Please doc the type

Code quote:

type KeyContext;

crates/starknet_patricia_storage/src/db_object.rs line 22 at r2 (raw file):

    fn get_prefix(&self, key_context: &Self::KeyContext) -> DbKeyPrefix {
        T::get_static_prefix(key_context)
    }

new line + doc

Suggestion:

    /// ....
    type KeyContext = <T as HasStaticPrefix>::KeyContext;
    
    fn get_prefix(&self, key_context: &Self::KeyContext) -> DbKeyPrefix {
        T::get_static_prefix(key_context)
    }

crates/starknet_patricia_storage/src/db_object.rs line 32 at r2 (raw file):

        value: &DbValue,
        deserialize_context: &Self::DeserializeContext,
    ) -> Result<Self, DeserializationError>;

new line

Suggestion:

    fn serialize(&self) -> DbValue;
    
    fn deserialize(
        value: &DbValue,
        deserialize_context: &Self::DeserializeContext,
    ) -> Result<Self, DeserializationError>;

crates/starknet_patricia/src/patricia_merkle_tree/traversal.rs line 97 at r2 (raw file):

        &self,
        key_context: &<L as HasStaticPrefix>::KeyContext,
    ) -> DbKeyPrefix;

should be added in previous PR

Code quote:

    fn get_root_prefix<L: Leaf>(
        &self,
        key_context: &<L as HasStaticPrefix>::KeyContext,
    ) -> DbKeyPrefix;

@ArielElp ArielElp marked this pull request as ready for review December 10, 2025 13:18
@ArielElp ArielElp force-pushed the ariel/subtree_trait_and_facts_subtree branch from 1b5ee01 to ee606a2 Compare December 10, 2025 14:20
@ArielElp ArielElp changed the base branch from ariel/subtree_trait_and_facts_subtree to graphite-base/10678 December 10, 2025 14:36
Copy link
Contributor

@yoavGrs yoavGrs 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: 16 of 20 files reviewed, 6 unresolved discussions (waiting on @ArielElp and @nimrod-starkware)


a discussion (no related file):
Please break this PR.
Separate between adding the context type and the serde functions?

@ArielElp ArielElp force-pushed the graphite-base/10678 branch from ee606a2 to dedb25a Compare December 10, 2025 15:06
@ArielElp ArielElp changed the base branch from graphite-base/10678 to ariel/subtree_trait_and_facts_subtree December 10, 2025 15:06
Copy link
Contributor Author

@ArielElp ArielElp 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: 9 of 20 files reviewed, 6 unresolved discussions (waiting on @nimrod-starkware and @yoavGrs)


a discussion (no related file):

Previously, yoavGrs wrote…

Please break this PR.
Separate between adding the context type and the serde functions?

Done, this PR now only deals with KeyContext, next PR deals with serde

@ArielElp ArielElp force-pushed the ariel/subtree_trait_and_facts_subtree branch from dedb25a to 4b296a6 Compare December 10, 2025 15:35
Copy link
Contributor Author

@ArielElp ArielElp 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: 9 of 20 files reviewed, 6 unresolved discussions (waiting on @nimrod-starkware and @yoavGrs)


crates/starknet_committer/src/db/facts_db/types.rs line 43 at r2 (raw file):

Previously, nimrod-starkware wrote…

Please include this change in your previous PR, where you defined SubTreeTrait.

Done.


crates/starknet_patricia/src/patricia_merkle_tree/traversal.rs line 97 at r2 (raw file):

Previously, nimrod-starkware wrote…

should be added in previous PR

Done.


crates/starknet_patricia_storage/src/db_object.rs line 5 at r2 (raw file):

Previously, nimrod-starkware wrote…

Please doc the type

Done.


crates/starknet_patricia_storage/src/db_object.rs line 22 at r2 (raw file):

Previously, nimrod-starkware wrote…

new line + doc

Done.


crates/starknet_patricia_storage/src/db_object.rs line 32 at r2 (raw file):

Previously, nimrod-starkware wrote…

new line

moved to next PR (will fix there)

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.

@dorimedini-starkware reviewed 4 of 4 files at r13, all commit messages.
Reviewable status: 21 of 22 files reviewed, 3 unresolved discussions (waiting on @ArielElp and @yoavGrs)

@ArielElp ArielElp force-pushed the ariel/subtree_trait_and_facts_subtree branch from ee209b3 to 3ca5e79 Compare December 14, 2025 11:33
Copy link
Contributor Author

@ArielElp ArielElp 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: 18 of 22 files reviewed, 3 unresolved discussions (waiting on @dorimedini-starkware and @yoavGrs)


crates/starknet_committer/src/db/external_test_utils.rs line 31 at r12 (raw file):

Previously, dorimedini-starkware wrote…

why do you force this test body to only work for leaves with empty key contexts?
Leaf already has a trait bound of HasStaticPrefix,
and I'm guessing create_original_skeleton_tree will need to be refactored to take key contexts as input anyway; how will this be done?

create_original_skeleton_tree will have a layout generic argument

Given it's only facts ATM I needed to limit it to Empty. In the PR that inttroduces layout, this test still only deals with facts (no PRs for tests yet), but this is easily changable there (tree_computation_flow will receive a layout arg, layout knows how to generate key context).


crates/starknet_committer/src/forest/filled_forest.rs line 36 at r12 (raw file):

Previously, dorimedini-starkware wrote…

how are the changes here related to this PR?

A gt sync accident, removed


crates/starknet_committer/src/patricia_merkle_tree/tree.rs line at r12 (raw file):

Previously, dorimedini-starkware wrote…

how will you handle generalizing the code here?
if you plan on doing it in subsequent PRs, please at least add TODOs in this PR

In the top of the stack, code in this module (get_leaves closure) is only used by the os crates. Given that we don't serve storage proofs now (or store history), I think we don't need to generalize yet.


crates/starknet_committer/src/patricia_merkle_tree/leaf/leaf_impl.rs line at r12 (raw file):

Previously, dorimedini-starkware wrote…

you will define different leaf types for indexed layout?

Yes, they will be trivial wrappers for different implementations of DBObject (which depends on HasDynamicPrefix, which will also be different).ff

@ArielElp ArielElp force-pushed the ariel/subtree_trait_and_facts_subtree branch from 3ca5e79 to 6f6fe6f Compare December 14, 2025 12:22
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.

@dorimedini-starkware reviewed 3 of 3 files at r14, 1 of 1 files at r15, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ArielElp)


crates/starknet_committer/src/db/external_test_utils.rs line 31 at r12 (raw file):

Previously, ArielElp wrote…

create_original_skeleton_tree will have a layout generic argument

Given it's only facts ATM I needed to limit it to Empty. In the PR that inttroduces layout, this test still only deals with facts (no PRs for tests yet), but this is easily changable there (tree_computation_flow will receive a layout arg, layout knows how to generate key context).

please add a TODO here then


crates/starknet_committer/src/patricia_merkle_tree/tree.rs line at r12 (raw file):

Previously, ArielElp wrote…

In the top of the stack, code in this module (get_leaves closure) is only used by the os crates. Given that we don't serve storage proofs now (or store history), I think we don't need to generalize yet.

ok, please add some comment / docstring explaining why this code is layout-specific

@ArielElp ArielElp force-pushed the ariel/subtree_trait_and_facts_subtree branch from 6f6fe6f to 5515e1c Compare December 14, 2025 15: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.

@dorimedini-starkware reviewed 1 of 1 files at r16, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ArielElp)

Copy link
Contributor Author

@ArielElp ArielElp 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 @ArielElp)


crates/starknet_patricia/src/patricia_merkle_tree/filled_tree/tree.rs line 45 at r12 (raw file):

Previously, dorimedini-starkware wrote…

consider this, if it reduces boilerplate (non-blocking)

Will consider when continuing the top of the stack with serialization.

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.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ArielElp)


crates/starknet_patricia/src/patricia_merkle_tree/filled_tree/tree.rs line 45 at r12 (raw file):

Previously, ArielElp wrote…

Will consider when continuing the top of the stack with serialization.

why not now? key context type is layout-dependent, not specific tree dependent

Copy link
Contributor Author

@ArielElp ArielElp 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 @ArielElp)


crates/starknet_patricia/src/patricia_merkle_tree/filled_tree/tree.rs line 45 at r12 (raw file):

Previously, dorimedini-starkware wrote…

why not now? key context type is layout-dependent, not specific tree dependent

Just because there will probably be more changes around that trait. Now Iv'e actually tried it and apparantly associated types defaults are not stable yet.

@ArielElp ArielElp changed the base branch from ariel/subtree_trait_and_facts_subtree to graphite-base/10678 December 14, 2025 15:44
@ArielElp ArielElp force-pushed the graphite-base/10678 branch from 5515e1c to 18c69e2 Compare December 14, 2025 15:45
@ArielElp ArielElp changed the base branch from graphite-base/10678 to main-v0.14.1-committer December 14, 2025 15:45
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.

@dorimedini-starkware reviewed 1 of 1 files at r17, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ArielElp)

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:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ArielElp)

@ArielElp ArielElp added this pull request to the merge queue Dec 14, 2025
Merged via the queue into main-v0.14.1-committer with commit 33bb01a Dec 14, 2025
20 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants