starknet_os: refactor build commitment infos#13039
Conversation
nimrod-starkware
left a comment
There was a problem hiding this comment.
@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>|
There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has been marked as stale. |
|
Re Nimrod's suggestion to change |
e09641d to
155be8c
Compare
|
Artifacts upload workflows: |
AvivYossef-starkware
left a comment
There was a problem hiding this comment.
@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.
AvivYossef-starkware
left a comment
There was a problem hiding this comment.
@AvivYossef-starkware reviewed 4 files and all commit messages, and resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on Yoni-Starkware).

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_infoswithStateCommitmentInfos::new, and simplifying the internal flow to fetch previous and new per-contract storage roots via a singleget_storage_rootshelper.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.