Skip to content

starknet_committer,starknet_committer_and_os_cli,starknet_patricia: make FilledNode generic#10750

Merged
ArielElp merged 1 commit intomain-v0.14.1-committerfrom
ariel/facts_filled_node
Dec 16, 2025
Merged

starknet_committer,starknet_committer_and_os_cli,starknet_patricia: make FilledNode generic#10750
ArielElp merged 1 commit intomain-v0.14.1-committerfrom
ariel/facts_filled_node

Conversation

@ArielElp
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

ArielElp commented Dec 11, 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 4 of 6 files at r1, all commit messages.
Reviewable status: 4 of 6 files reviewed, 5 unresolved discussions (waiting on @ArielElp and @yoavGrs)


crates/starknet_patricia/src/patricia_merkle_tree/filled_tree/tree_test.rs line 29 at r1 (raw file):

};

type FactDbFilledNode<L> = FilledNode<L, HashOutput>;

you already defined this alias. please delete here, define the alias as pub and use it here.

Code quote:

type FactDbFilledNode<L> = FilledNode<L, HashOutput>;

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

impl<L: Leaf> HasDynamicPrefix for FilledNode<L, HashOutput> {
    type KeyContext = <L as HasStaticPrefix>::KeyContext;

Did you intentionally delete the comment?
// Inherit the KeyContext from the HasStaticPrefix implementation of the leaf.

Code quote:

impl<L: Leaf> HasDynamicPrefix for FilledNode<L, HashOutput> {
    type KeyContext = <L as HasStaticPrefix>::KeyContext;

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

        .into()
    }
}

does that work? I don't see a specific usage of the HashOutput type here.

Suggestion:

impl<L: Leaf, ChildData> FilledNode<L, ChildData> {
    pub fn suffix(&self) -> [u8; SERIALIZE_HASH_BYTES] {
        self.hash.0.to_bytes_be()
    }

    pub fn db_key(&self, key_context: &<L as HasStaticPrefix>::KeyContext) -> DbKey {
        self.get_db_key(key_context, &self.suffix())
    }
}

impl<L: Leaf, ChildData> HasDynamicPrefix for FilledNode<L, ChildData> {
    type KeyContext = <L as HasStaticPrefix>::KeyContext;
    fn get_prefix(&self, _key_context: &Self::KeyContext) -> DbKeyPrefix {
        match &self.data {
            NodeData::Binary(_) | NodeData::Edge(_) => PatriciaPrefix::InnerNode,
            NodeData::Leaf(_) => PatriciaPrefix::Leaf(L::get_static_prefix(_key_context)),
        }
        .into()
    }
}

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

}

impl<L: Leaf> DBObject for FilledNode<L, HashOutput> {

use the alias you defined

Suggestion:

impl<L: Leaf> DBObject for FactDbFilledNode<L>

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

use crate::patricia_merkle_tree::updated_skeleton_tree::tree::UpdatedSkeletonTree;

type FactDbFilledNode<L> = FilledNode<L, HashOutput>;

Please use this type wherever possible.
I actually think this should be defined somewhere in the facts_db module. is that possible? if currently not due to crate dependencies, please add a todo

Code quote:

type FactDbFilledNode<L> = FilledNode<L, HashOutput>;

@ArielElp ArielElp force-pushed the ariel/facts_filled_node branch 2 times, most recently from 0ccc605 to 7cb7c31 Compare December 14, 2025 10:36
@ArielElp ArielElp force-pushed the ariel/facts_filled_node branch from 7cb7c31 to 6d39c01 Compare December 14, 2025 11:33
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 6 files at r1, 5 of 6 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ArielElp)


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

    pub tree_map: HashMap<NodeIndex, FactDbFilledNode<L>>,
    pub root_hash: HashOutput,
}

planning on making this generic...? or a separate type?

Code quote:

pub struct FilledTreeImpl<L: Leaf> {
    pub tree_map: HashMap<NodeIndex, FactDbFilledNode<L>>,
    pub root_hash: HashOutput,
}

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


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

Previously, dorimedini-starkware wrote…

planning on making this generic...? or a separate type?

Probably generic, but the code for serialization is mostly not written yet (there is an early draft)

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 r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ArielElp)


crates/starknet_committer/src/db/facts_db/traversal.rs line 123 at r5 (raw file):

                    if !right_subtree.is_unmodified() {
                        next_subtrees.push(right_subtree);
                    }

move this to the prev PR

Code quote:

                    if !left_subtree.is_unmodified() {
                        next_subtrees.push(left_subtree);
                    }
                    if !right_subtree.is_unmodified() {
                        next_subtrees.push(right_subtree);
                    }

@ArielElp ArielElp force-pushed the ariel/facts_filled_node branch from ac6ddd3 to 6ec738c Compare December 16, 2025 09:39
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: 7 of 9 files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware, @nimrod-starkware, and @yoavGrs)


crates/starknet_committer/src/db/facts_db/traversal.rs line 123 at r5 (raw file):

Previously, dorimedini-starkware wrote…

move this to the prev PR

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.

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

@ArielElp ArielElp force-pushed the ariel/facts_filled_node branch from 6ec738c to 7b41917 Compare December 16, 2025 10:02
@ArielElp ArielElp force-pushed the ariel/facts_filled_node branch 2 times, most recently from 85b89ee to f542a05 Compare December 16, 2025 10:18
@ArielElp ArielElp changed the title starknet_committer,starknet_committer_and_os_cli,starknet_patricia: make FilledNode generic and introduce the FactsFilledNode alias starknet_committer,starknet_committer_and_os_cli,starknet_patricia: make FilledNode generic Dec 16, 2025
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 r7, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ArielElp)

@ArielElp ArielElp changed the base branch from abstract_node_data to graphite-base/10750 December 16, 2025 10:43
@graphite-app
Copy link

graphite-app bot commented Dec 16, 2025

Merge activity

  • Dec 16, 11:05 AM UTC: This pull request can not be added to the Graphite merge queue. Please try rebasing and resubmitting to merge when ready.
  • Dec 16, 11:05 AM UTC: Graphite disabled "merge when ready" on this PR due to: a merge conflict with the target branch; resolve the conflict and try again..

@ArielElp ArielElp force-pushed the ariel/facts_filled_node branch from f542a05 to a33b741 Compare December 16, 2025 11:07
@ArielElp ArielElp force-pushed the graphite-base/10750 branch from a3cc5b7 to 0eb7c84 Compare December 16, 2025 11:07
@ArielElp ArielElp changed the base branch from graphite-base/10750 to main-v0.14.1-committer December 16, 2025 11:07
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)

@ArielElp ArielElp added this pull request to the merge queue Dec 16, 2025
Merged via the queue into main-v0.14.1-committer with commit ece2fd3 Dec 16, 2025
34 of 62 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.

5 participants