Skip to content

starknet_committer: add patricia paths forest reader/writer traits#13995

Merged
ArielElp merged 1 commit into
mainfrom
ariel/add_patricia_paths_storage_traits
May 28, 2026
Merged

starknet_committer: add patricia paths forest reader/writer traits#13995
ArielElp merged 1 commit into
mainfrom
ariel/add_patricia_paths_storage_traits

Conversation

@ArielElp
Copy link
Copy Markdown
Contributor

@ArielElp ArielElp commented May 7, 2026

No description provided.

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

@ArielElp ArielElp force-pushed the ariel/patricia_paths_storage_serialization branch from 2092a49 to f0e3f55 Compare May 7, 2026 12:40
@ArielElp ArielElp force-pushed the ariel/add_patricia_paths_storage_traits branch from 8f39705 to 67c3d07 Compare May 7, 2026 12:40
@ArielElp ArielElp force-pushed the ariel/patricia_paths_storage_serialization branch from f0e3f55 to 6d8fca8 Compare May 14, 2026 08:43
@ArielElp ArielElp force-pushed the ariel/add_patricia_paths_storage_traits branch from 67c3d07 to 2ad18d3 Compare May 14, 2026 08:43
@ArielElp ArielElp force-pushed the ariel/patricia_paths_storage_serialization branch from 6d8fca8 to f34a751 Compare May 18, 2026 11:56
@ArielElp ArielElp force-pushed the ariel/add_patricia_paths_storage_traits branch 3 times, most recently from 99bf786 to 642dad1 Compare May 19, 2026 06:55
@ArielElp ArielElp force-pushed the ariel/patricia_paths_storage_serialization branch from 540e432 to 48f73db Compare May 19, 2026 06:55
@ArielElp ArielElp marked this pull request as ready for review May 19, 2026 07:08
@ArielElp ArielElp force-pushed the ariel/patricia_paths_storage_serialization branch from 48f73db to 40a2552 Compare May 19, 2026 07:08
@ArielElp ArielElp force-pushed the ariel/add_patricia_paths_storage_traits branch from 642dad1 to 13b4b25 Compare May 19, 2026 07:08
@ArielElp ArielElp force-pushed the ariel/patricia_paths_storage_serialization branch from 2e82fa4 to d978ebb Compare May 27, 2026 15:31
@ArielElp ArielElp force-pushed the ariel/add_patricia_paths_storage_traits branch from c6695e5 to 96591a7 Compare May 27, 2026 15:31
Copy link
Copy Markdown
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 3 comments.
Reviewable status: 2 of 3 files reviewed, 4 unresolved discussions (waiting on dorimedini-starkware).


crates/starknet_committer/src/db/forest_trait_witnesses.rs line 31 at r3 (raw file):

just so I understand: this enum is just to allow a single function to do both revert and commit?

Yes (maybe more specifically, a single function that does all the writes)

i.e. a "revert" is a reverse commit?

In the standard commit flow this is true, so you don't need a special treatment for reverts at the API level.

I changed the names a bit and added an explicit type for the Write variant, I think it's clearer now.


crates/starknet_committer/src/db/forest_trait_witnesses.rs line 53 at r3 (raw file):

Previously, dorimedini-starkware wrote…

shouldn't this be mutable? non-blocking, can be done later anyway

No, we only read from this layer (a few PRs from away)


crates/starknet_committer/src/db/forest_trait_witnesses.rs line 57 at r3 (raw file):

Previously, dorimedini-starkware wrote…

why optionally?

Not optionally indeed, removed.

@ArielElp ArielElp force-pushed the ariel/add_patricia_paths_storage_traits branch 2 times, most recently from 55863a3 to 65c50ec Compare May 27, 2026 16:20
@ArielElp ArielElp force-pushed the ariel/patricia_paths_storage_serialization branch from 057831d to 1f3d5ed Compare May 27, 2026 16:20
Copy link
Copy Markdown
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 file and all commit messages, and resolved 3 discussions.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on ArielElp).

@ArielElp ArielElp changed the base branch from ariel/patricia_paths_storage_serialization to graphite-base/13995 May 27, 2026 19:33
@ArielElp ArielElp force-pushed the ariel/add_patricia_paths_storage_traits branch from 65c50ec to 74268e4 Compare May 27, 2026 19:33
@ArielElp ArielElp force-pushed the graphite-base/13995 branch from 1f3d5ed to 401e67a Compare May 27, 2026 19:33
@ArielElp ArielElp changed the base branch from graphite-base/13995 to main May 27, 2026 19:33
Comment thread crates/starknet_committer/src/db/index_db/db.rs
@ArielElp ArielElp force-pushed the ariel/add_patricia_paths_storage_traits branch from 74268e4 to 134280e Compare May 28, 2026 06:28
Copy link
Copy Markdown
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 file and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on ArielElp).

Comment thread crates/starknet_committer/src/db/index_db/db.rs
@ArielElp ArielElp force-pushed the ariel/add_patricia_paths_storage_traits branch from 134280e to 02806e0 Compare May 28, 2026 07:35
Copy link
Copy Markdown
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 file and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on ArielElp).


crates/starknet_committer/src/db/index_db/db.rs line 89 at r6 (raw file):

/// Prefix for accessed-keys digest metadata (committed per block).
#[cfg_attr(not(feature = "os_input"), allow(dead_code))]

we try to use expect when we can, to catch redundant annotations as they come

Suggestion:

expect(dead_code)

@ArielElp ArielElp force-pushed the ariel/add_patricia_paths_storage_traits branch from 02806e0 to 102f542 Compare May 28, 2026 07:40
Copy link
Copy Markdown
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 1 comment.
Reviewable status: 2 of 3 files reviewed, 2 unresolved discussions (waiting on dorimedini-starkware).


crates/starknet_committer/src/db/index_db/db.rs line 89 at r6 (raw file):

Previously, dorimedini-starkware wrote…

we try to use expect when we can, to catch redundant annotations as they come

Done.

Copy link
Copy Markdown
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 file and all commit messages, and resolved 1 discussion.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on ArielElp).

@ArielElp ArielElp force-pushed the ariel/add_patricia_paths_storage_traits branch from 102f542 to c0fd617 Compare May 28, 2026 08:07
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c0fd617. Configure here.

Comment thread crates/starknet_committer/src/db/index_db/db.rs
Copy link
Copy Markdown
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: 2 of 3 files reviewed, 1 unresolved discussion (waiting on dorimedini-starkware).

@ArielElp ArielElp force-pushed the ariel/add_patricia_paths_storage_traits branch from c0fd617 to 1d6ae67 Compare May 28, 2026 08:17
Copy link
Copy Markdown
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 file and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on ArielElp).


crates/starknet_committer/src/db/index_db/db.rs line 96 at r9 (raw file):

pub(crate) static PATRICIA_PATHS_PREFIX: LazyLock<[u8; 32]> = LazyLock::new(|| {
    (Felt::from_bytes_be(&ACCESSED_KEYS_DIGEST_METADATA_PREFIX) + Felt::ONE).to_bytes_be()
});

Suggestion:

/// Prefix for Patricia proofs payload (per block).
#[cfg_attr(not(feature = "os_input"), expect(dead_code))]
pub(crate) static PATRICIA_PATHS_PREFIX: LazyLock<[u8; 32]> = LazyLock::new(|| {
    (Felt::from_bytes_be(&ACCESSED_KEYS_DIGEST_METADATA_PREFIX) + Felt::ONE).to_bytes_be()
});

Copy link
Copy Markdown
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 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on dorimedini-starkware).


crates/starknet_committer/src/db/index_db/db.rs line 96 at r9 (raw file):

pub(crate) static PATRICIA_PATHS_PREFIX: LazyLock<[u8; 32]> = LazyLock::new(|| {
    (Felt::from_bytes_be(&ACCESSED_KEYS_DIGEST_METADATA_PREFIX) + Felt::ONE).to_bytes_be()
});

at the moment it is still not used, this is changed up the stack (2 PRs up)

Copy link
Copy Markdown
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 resolved 1 discussion.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on ArielElp).

Copy link
Copy Markdown
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.

4 participants