Skip to content

starknet_os: refactor build commitment infos#13039

Merged
AvivYossef-starkware merged 1 commit into
mainfrom
aviv/refactor_build_commitment_infos
Apr 6, 2026
Merged

starknet_os: refactor build commitment infos#13039
AvivYossef-starkware merged 1 commit into
mainfrom
aviv/refactor_build_commitment_infos

Conversation

@AvivYossef-starkware
Copy link
Copy Markdown
Contributor

@AvivYossef-starkware AvivYossef-starkware commented Mar 5, 2026

Note

Medium Risk
Touches core state commitment/proof construction logic by changing how per-contract storage roots are fetched and how the API is invoked, which could affect root/proof correctness if the refactor diverges from prior behavior.

Overview
Refactors commitment-info construction by replacing the free function create_commitment_infos with StateCommitmentInfos::new, and simplifying the internal flow to fetch previous and new per-contract storage roots via a single get_storage_roots helper.

Updates downstream callers (flow tests and transaction prover) to use the new constructor API, and switches to committer helpers for contract-address↔node-index conversion while tightening error mapping.

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

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

@AvivYossef-starkware AvivYossef-starkware marked this pull request as ready for review March 5, 2026 13:18
Copy link
Copy Markdown
Contributor Author

AvivYossef-starkware commented Mar 5, 2026

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

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 3 files and made 2 comments.
Reviewable status: all files reviewed (commit messages unreviewed), 1 unresolved discussion (waiting on AvivYossef-starkware and Yoni-Starkware).


crates/starknet_os/src/commitment_infos.rs line 151 at r1 (raw file):

/// Fetches the storage root hash of each contract from the contracts trie at the given root.
async fn get_storage_roots(
    contract_addresses: &[ContractAddress],

Consider changing it to avoid collecting to a vec from outside. non-blocking

Suggestion:

contract_addresses: &impl Iterator<Item=&ContractAddress>

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 5, 2026

There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has been marked as stale.
This PR will be closed and locked in 7 days if no further activity occurs.
Thank you for your contributions!

@github-actions github-actions Bot added the stale label Apr 5, 2026
@AvivYossef-starkware
Copy link
Copy Markdown
Contributor Author

Re Nimrod's suggestion to change contract_addresses: &[ContractAddress] to an iterator — since get_storage_roots is called twice (once for previous roots and once for new roots), accepting an iterator would either require cloning the iterator or adding a lifetime, making the signature more complex for no real gain. Keeping &[ContractAddress] is simpler here.

@AvivYossef-starkware AvivYossef-starkware changed the base branch from main-v0.14.2 to graphite-base/13039 April 6, 2026 07:49
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/refactor_build_commitment_infos branch from e09641d to 155be8c Compare April 6, 2026 07:50
@AvivYossef-starkware AvivYossef-starkware changed the base branch from graphite-base/13039 to main April 6, 2026 07:50
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 6, 2026

Artifacts upload workflows:

Copy link
Copy Markdown
Contributor Author

@AvivYossef-starkware AvivYossef-starkware left a comment

Choose a reason for hiding this comment

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

@AvivYossef-starkware made 1 comment.
Reviewable status: 1 of 4 files reviewed, 1 unresolved discussion (waiting on nimrod-starkware and Yoni-Starkware).


crates/starknet_os/src/commitment_infos.rs line 151 at r1 (raw file):

Previously, nimrod-starkware wrote…

Consider changing it to avoid collecting to a vec from outside. non-blocking

Re Nimrod's suggestion to change contract_addresses: &[ContractAddress] to an iterator — since get_storage_roots is called twice (once for previous roots and once for new roots), accepting an iterator would either require cloning the iterator or adding a lifetime, making the signature more complex for no real gain. Keeping &[ContractAddress] is simpler here.

Copy link
Copy Markdown
Contributor Author

@AvivYossef-starkware AvivYossef-starkware left a comment

Choose a reason for hiding this comment

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

@AvivYossef-starkware reviewed 4 files and all commit messages, and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Yoni-Starkware).

@AvivYossef-starkware AvivYossef-starkware added this pull request to the merge queue Apr 6, 2026
@github-actions github-actions Bot removed the stale label Apr 6, 2026
Merged via the queue into main with commit 0713953 Apr 6, 2026
49 of 112 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 7, 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