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 Jan 11, 2026

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

@ArielElp ArielElp force-pushed the ariel/remove_generate_key_context branch from eb59008 to f352adb Compare January 12, 2026 15:02
@ArielElp ArielElp force-pushed the ariel/add_layout_for_base_trait branch from 4c16417 to b9eb835 Compare January 12, 2026 15:45
@ArielElp ArielElp force-pushed the ariel/remove_generate_key_context branch from f352adb to 198e17d Compare January 12, 2026 15:45
@ArielElp ArielElp force-pushed the ariel/add_layout_for_base_trait branch from b9eb835 to bfbb61b Compare January 12, 2026 17:19
@ArielElp ArielElp force-pushed the ariel/remove_generate_key_context branch from 198e17d to 7add9e6 Compare January 12, 2026 17:19
@ArielElp ArielElp force-pushed the ariel/add_layout_for_base_trait branch from bfbb61b to a453ec3 Compare January 12, 2026 18:04
@ArielElp ArielElp force-pushed the ariel/remove_generate_key_context branch 5 times, most recently from 9b35b3d to a6d209a Compare January 13, 2026 08:00
@ArielElp ArielElp force-pushed the ariel/add_layout_for_base_trait branch from a453ec3 to d3bbd34 Compare January 13, 2026 09:34
@ArielElp ArielElp force-pushed the ariel/remove_generate_key_context branch from a6d209a to 921a6ab Compare January 13, 2026 09:34
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 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @ArielElp and @yoavGrs).


crates/starknet_committer/src/db/index_db/leaves.rs line 49 at r7 (raw file):

/// Set to FIRST_AVAILABLE_PREFIX_FELT + 1
static CLASSES_TREE_PREFIX: LazyLock<[u8; 32]> =
    LazyLock::new(|| (*FIRST_AVAILABLE_PREFIX_FELT + Felt::ONE).to_bytes_be());

WDYT of this? non-blocking

Suggestion:

static CLASSES_TREE_PREFIX: LazyLock<DbKeyPrefix> =
    LazyLock::new(|| DbKeyPrefix((*FIRST_AVAILABLE_PREFIX_FELT + Felt::ONE).to_bytes_be().into()));

crates/starknet_committer/src/db/index_db/leaves.rs line 75 at r7 (raw file):

        DbKeyPrefix::new(prefix.into())
    }
}

Suggestion:

impl HasStaticPrefix for IndexLayoutStarknetStorageValue {
    // For the storage tries, the prefix is the contract's address.
    type KeyContext = ContractAddress;
    
    fn get_static_prefix(key_context: &Self::KeyContext) -> DbKeyPrefix {
        let prefix = key_context.to_bytes_be().to_vec();
        DbKeyPrefix::new(prefix.into())
    }
}

@ArielElp ArielElp changed the base branch from ariel/add_layout_for_base_trait to graphite-base/11592 January 13, 2026 15:21
@ArielElp ArielElp force-pushed the graphite-base/11592 branch from d3bbd34 to dab4f4b Compare January 13, 2026 15:21
@ArielElp ArielElp force-pushed the ariel/remove_generate_key_context branch from 921a6ab to 3cfa249 Compare January 13, 2026 15:21
@ArielElp ArielElp changed the base branch from graphite-base/11592 to main-v0.14.1-committer January 13, 2026 15:21
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.

@ArielElp made 2 comments.
Reviewable status: 16 of 17 files reviewed, 6 unresolved discussions (waiting on @nimrod-starkware and @yoavGrs).


crates/starknet_committer/src/db/index_db/leaves.rs line 49 at r7 (raw file):

Previously, nimrod-starkware wrote…

WDYT of this? non-blocking

Can't if I want the borrowed variant of Cow, if the lock is [u8;32] I can send &value to db prefix, but I can't do &prefix.to_bytes_be() in the closure body because it's a temporary value.


crates/starknet_committer/src/db/index_db/leaves.rs line 75 at r7 (raw file):

        DbKeyPrefix::new(prefix.into())
    }
}

Added it as a doc for the method, since KeyContext is also ContractAddress for facts layout where the prefix is something else.

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:

@nimrod-starkware made 1 comment and resolved 2 discussions.
Reviewable status: 16 of 17 files reviewed, 4 unresolved discussions (waiting on @ArielElp and @yoavGrs).

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.

@yoavGrs reviewed 2 files and all commit messages, and resolved 3 discussions.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ArielElp and @dorimedini-starkware).

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


crates/starknet_committer/src/db/index_db/leaves.rs line 75 at r8 (raw file):

    fn get_static_prefix(key_context: &Self::KeyContext) -> DbKeyPrefix {
        let prefix = key_context.to_bytes_be().to_vec();
        DbKeyPrefix::new(prefix.into())

not for this PR, but, seems like the point of key_context is to define a prefix; so prefixifying should be a method, right?
it's just that key_context.to_bytes_be() seems a bit strange

Suggestion:

        DbKeyPrefix::new(key_context.to_prefix_bytes())

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.

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

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.

6 participants