Skip to content

starknet_os: generalize sha resource test to include sha512#14255

Open
dorimedini-starkware wants to merge 1 commit into
05-24-starknet_os_os_resources_test_-_l1_handler_tx_calldata_factorfrom
05-24-starknet_os_generalize_sha_resource_test_to_include_sha512
Open

starknet_os: generalize sha resource test to include sha512#14255
dorimedini-starkware wants to merge 1 commit into
05-24-starknet_os_os_resources_test_-_l1_handler_tx_calldata_factorfrom
05-24-starknet_os_generalize_sha_resource_test_to_include_sha512

Conversation

@dorimedini-starkware
Copy link
Copy Markdown
Collaborator

No description provided.

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

Copy link
Copy Markdown
Collaborator Author

dorimedini-starkware commented May 28, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

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

@cursor
Copy link
Copy Markdown

cursor Bot commented May 28, 2026

PR Summary

Low Risk
Test-only changes to resource accounting harnesses; no production OS or runtime behavior is modified.

Overview
Refactors the OS SHA finalize resource harness so SHA-256 and SHA-512 share one generic runner, then adds coverage for finalize_sha512.

The former run_finalize_sha256 path becomes run_finalize_sha<T>: callers pass the Cairo entrypoint name and a Rust reference compressor (u32 / SHA-256 or u64 / SHA-512). SHA-256 tests now call that helper unchanged in intent; a new sha_512_update_state (via compress512) backs the SHA-512 case.

test_utils gains SHA-512 batch constants (SHA512_BLOCK_TO_ROUND, linear and constant ExecutionResources) alongside the existing SHA-256 values. test_finalize_sha512 samples two block counts one round apart and asserts the derived linear and constant factors match those constants, mirroring test_finalize_sha256.

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

@dorimedini-starkware dorimedini-starkware force-pushed the 05-24-starknet_os_os_resources_test_-_l1_handler_tx_calldata_factor branch from ebdeac0 to 82597b0 Compare May 29, 2026 14:04
@dorimedini-starkware dorimedini-starkware force-pushed the 05-24-starknet_os_generalize_sha_resource_test_to_include_sha512 branch from 9d76d08 to 734ffe2 Compare May 29, 2026 14:04
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.

2 participants