Skip to content

starknet_api: add and use StateRoots::EMPTY#13980

Merged
dorimedini-starkware merged 1 commit into
mainfrom
05-05-starknet_api_add_and_use_stateroots_empty
May 10, 2026
Merged

starknet_api: add and use StateRoots::EMPTY#13980
dorimedini-starkware merged 1 commit into
mainfrom
05-05-starknet_api_add_and_use_stateroots_empty

Conversation

@dorimedini-starkware
Copy link
Copy Markdown
Collaborator

No description provided.

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

@cursor
Copy link
Copy Markdown

cursor Bot commented May 5, 2026

PR Summary

Medium Risk
This is a small but public API change: StateRoots no longer derives Default, so any downstream code relying on StateRoots::default() will break until migrated. Runtime behavior is effectively unchanged, but the empty-root check in global_root() is now centralized via StateRoots::EMPTY.

Overview
Introduces StateRoots::EMPTY in starknet_api and removes the Default derive from StateRoots, making the empty-root representation explicit.

Updates committer tests, snap-sync CLI/tests, and the central systest blob regression helper to use StateRoots::EMPTY (including in global_root()’s empty-state branch) instead of StateRoots::default()/unwrap_or_default().

Reviewed by Cursor Bugbot for commit fa76e6e. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown
Collaborator Author

dorimedini-starkware commented May 5, 2026

@dorimedini-starkware dorimedini-starkware force-pushed the 04-30-central_systest_blobs_add_some_invokes branch from 85cd564 to 8bde747 Compare May 5, 2026 11:56
@dorimedini-starkware dorimedini-starkware force-pushed the 05-05-starknet_api_add_and_use_stateroots_empty branch from bce4e03 to 860e7b2 Compare May 5, 2026 11:56
@dorimedini-starkware dorimedini-starkware force-pushed the 04-30-central_systest_blobs_add_some_invokes branch from 8bde747 to c9a7ca9 Compare May 5, 2026 12:31
Copy link
Copy Markdown
Collaborator Author

@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 made 1 comment.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on nimrod-starkware and yoavGrs).


crates/starknet_api/src/hash.rs line 104 at r2 (raw file):

Previously, nimrod-starkware wrote…

I'm not sure it makes sense to have a default value for this...
I guess there are few places where StateRoots::default() was used to indicate an empty state, IMO it's better to be explicit there and change it to StateRoots::EMPTY

I agree, removed the impl

Copy link
Copy Markdown
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 reviewed 5 files and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on yoavGrs).

@dorimedini-starkware dorimedini-starkware force-pushed the 05-05-starknet_api_add_and_use_stateroots_empty branch from 88fb387 to c504940 Compare May 5, 2026 14:17
@dorimedini-starkware dorimedini-starkware force-pushed the 04-30-central_systest_blobs_add_some_invokes branch 2 times, most recently from 3700e92 to fd1c2e9 Compare May 5, 2026 14:23
@dorimedini-starkware dorimedini-starkware force-pushed the 05-05-starknet_api_add_and_use_stateroots_empty branch from c504940 to 10605ac Compare May 5, 2026 14:23
@dorimedini-starkware dorimedini-starkware force-pushed the 04-30-central_systest_blobs_add_some_invokes branch from fd1c2e9 to 9f74247 Compare May 8, 2026 13:49
@dorimedini-starkware dorimedini-starkware force-pushed the 05-05-starknet_api_add_and_use_stateroots_empty branch 2 times, most recently from 20be49d to 80f2783 Compare May 9, 2026 14:12
@dorimedini-starkware dorimedini-starkware force-pushed the 04-30-central_systest_blobs_add_some_invokes branch from 9f74247 to 6e16f47 Compare May 9, 2026 14:12
@dorimedini-starkware dorimedini-starkware force-pushed the 04-30-central_systest_blobs_add_some_invokes branch from 6e16f47 to 1aa8f60 Compare May 9, 2026 18:52
@dorimedini-starkware dorimedini-starkware force-pushed the 05-05-starknet_api_add_and_use_stateroots_empty branch 2 times, most recently from 7741718 to 884af7d Compare May 10, 2026 06:42
@dorimedini-starkware dorimedini-starkware force-pushed the 04-30-central_systest_blobs_add_some_invokes branch from 1aa8f60 to 80bb904 Compare May 10, 2026 06:42
@dorimedini-starkware dorimedini-starkware changed the base branch from 04-30-central_systest_blobs_add_some_invokes to main May 10, 2026 07:49
@dorimedini-starkware dorimedini-starkware force-pushed the 05-05-starknet_api_add_and_use_stateroots_empty branch from 884af7d to 3b9a787 Compare May 10, 2026 07:59
Copy link
Copy Markdown
Collaborator Author

@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 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on yoavGrs).

@dorimedini-starkware dorimedini-starkware added this pull request to the merge queue May 10, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 10, 2026
@dorimedini-starkware dorimedini-starkware added this pull request to the merge queue May 10, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 10, 2026
@dorimedini-starkware dorimedini-starkware force-pushed the 05-05-starknet_api_add_and_use_stateroots_empty branch from 3b9a787 to 3d97fd4 Compare May 10, 2026 09:54
@dorimedini-starkware dorimedini-starkware force-pushed the 05-05-starknet_api_add_and_use_stateroots_empty branch from 3d97fd4 to fa76e6e Compare May 10, 2026 11:21
Copy link
Copy Markdown
Collaborator Author

@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.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on yoavGrs).

@dorimedini-starkware dorimedini-starkware added this pull request to the merge queue May 10, 2026
Merged via the queue into main with commit 4eab7a1 May 10, 2026
30 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 12, 2026
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.

3 participants