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.

@ArielElp ArielElp force-pushed the ariel/add_deserialization_context branch from 6d13cf1 to a185e9a Compare December 10, 2025 15:35
@ArielElp ArielElp force-pushed the ariel/add_deserialization_context branch 2 times, most recently from 743c49b to b50df9d Compare December 10, 2025 15:53
@ArielElp ArielElp force-pushed the ariel/add_deserialization_context branch from b50df9d to d41c9d5 Compare December 10, 2025 19:58
@ArielElp ArielElp force-pushed the ariel/add_deserialization_context branch from d41c9d5 to ae7da9d Compare December 11, 2025 06:51
@ArielElp ArielElp force-pushed the ariel/db_keys branch 2 times, most recently from 1dc710b to f515f75 Compare December 11, 2025 08:45
@ArielElp ArielElp force-pushed the ariel/add_deserialization_context branch from ae7da9d to 17c75e3 Compare December 11, 2025 08:45
@ArielElp ArielElp marked this pull request as ready for review December 11, 2025 08:55
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 7 of 7 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ArielElp)


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

    pub is_leaf: bool,
    pub node_hash: HashOutput,
}

Name is too general IMO + doc

Suggestion:

/// Extra context required to deserialize [FilledNode].
/// See [DBObject::DeserializeContext] for more information.
pub struct FilledNodeDeserializeContext {
    pub is_leaf: bool,
    pub node_hash: HashOutput,
}

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

}

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

Do you plan to have a different type of FilledNode for the index layout?

Code quote:

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

crates/starknet_patricia/src/patricia_merkle_tree/node_data/leaf.rs line 14 at r1 (raw file):

pub trait Leaf:
    Clone + Sync + Send + HasStaticPrefix + DBObject<DeserializeContext = ()> + Default + Debug + Eq

Can you give an alias for this and use it here (and possibly other places)?
Does this work?
pub trait ContextLessDBObejct: DBObject<DeserializeContext = ()> {}

Code quote:

DBObject<DeserializeContext = ()>

@ArielElp ArielElp force-pushed the ariel/add_deserialization_context branch from 17c75e3 to 31faa1a Compare December 11, 2025 12:28
@ArielElp ArielElp force-pushed the ariel/add_deserialization_context branch from 31faa1a to 539461a Compare December 11, 2025 13:04
@ArielElp ArielElp force-pushed the ariel/add_deserialization_context branch from 539461a to ba38be7 Compare December 11, 2025 13:22
@ArielElp ArielElp force-pushed the ariel/add_deserialization_context branch from 4bf0fbf to 365cf40 Compare December 14, 2025 11:33
@ArielElp ArielElp force-pushed the ariel/add_deserialization_context branch 2 times, most recently from 1782242 to b12953e Compare December 14, 2025 12:15
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: 5 of 7 files reviewed, 1 unresolved discussion (waiting on @nimrod-starkware and @yoavGrs)


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

Previously, yoavGrs wrote…

Restore the empty line, please

Done.


crates/starknet_patricia_storage/src/db_object.rs line 46 at r4 (raw file):

Previously, yoavGrs wrote…

It would be done in 2 PRs, but NVM now

Ack

@ArielElp ArielElp force-pushed the ariel/add_deserialization_context branch 2 times, most recently from 1efd903 to c231394 Compare December 14, 2025 15:23
@ArielElp ArielElp force-pushed the ariel/db_keys branch 2 times, most recently from 80a31a1 to e7343be Compare December 14, 2025 15:45
@ArielElp ArielElp force-pushed the ariel/add_deserialization_context branch from c231394 to 38a0f23 Compare December 14, 2025 15:45
@ArielElp ArielElp force-pushed the ariel/add_deserialization_context branch from 38a0f23 to 1645dcb Compare December 14, 2025 16:00
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.

:lgtm:

@yoavGrs 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 changed the base branch from ariel/db_keys to graphite-base/10704 December 15, 2025 08:57
@ArielElp ArielElp force-pushed the ariel/add_deserialization_context branch from 1645dcb to cb4f9c2 Compare December 15, 2025 08:57
@ArielElp ArielElp force-pushed the graphite-base/10704 branch from ee3e662 to 12ec8ef Compare December 15, 2025 08:57
@ArielElp ArielElp changed the base branch from graphite-base/10704 to main-v0.14.1-committer December 15, 2025 08:57
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 6 files at r2, 2 of 4 files at r4, 1 of 1 files at r5, 1 of 2 files at r6, 1 of 1 files at r7, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ArielElp)


crates/starknet_patricia/src/patricia_merkle_tree/node_data/leaf.rs line 22 at r7 (raw file):

    + Send
    + HasStaticPrefix
    + DBObject<DeserializeContext = EmptyDeserializationContext>

why are leaves always with empty deserialization context? never required?

Code quote:

DBObject<DeserializeContext = EmptyDeserializationContext>

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

            return Ok(Self {
                hash: deserialize_context.node_hash,
                data: NodeData::Leaf(L::deserialize(value, &EmptyDeserializationContext)?),

isn't this what you want...?

Suggestion:

NodeData::Leaf(L::deserialize(value, &L::DeserializeContext)?)

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: all files reviewed, 2 unresolved discussions (waiting on @dorimedini-starkware)


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

Previously, dorimedini-starkware wrote…

isn't this what you want...?

I need an instantiation, L::DeserializeContext is the type


crates/starknet_patricia/src/patricia_merkle_tree/node_data/leaf.rs line 22 at r7 (raw file):

Previously, dorimedini-starkware wrote…

why are leaves always with empty deserialization context? never required?

I never use it for leaves. Facts context is is_leaf+hash, index context is is_leaf, for leaves there's no ambiguity on db reads that I need to solve externally.

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 f259a2a Dec 16, 2025
24 of 36 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