Skip to content

starknet_os: define sha256 batch resources constants#14140

Open
dorimedini-starkware wants to merge 1 commit into
graphite-base/14140from
05-23-starknet_os_define_sha256_batch_resources_constants
Open

starknet_os: define sha256 batch resources constants#14140
dorimedini-starkware wants to merge 1 commit into
graphite-base/14140from
05-23-starknet_os_define_sha256_batch_resources_constants

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 24, 2026

@cursor
Copy link
Copy Markdown

cursor Bot commented May 24, 2026

PR Summary

Low Risk
Test-only resource constants and a Cairo runner integration test; no production OS or fee logic paths changed in this diff.

Overview
Adds documented Cairo VM resource costs for the OS program’s SHA-256 batching path, split into per-round linear and fixed constant ExecutionResources (steps and bitwise/range_check builtins, normalized via BUILTIN_INSTANCE_SIZES).

A new integration test runs finalize_sha256 from OS_PROGRAM_BYTES at two block counts (one round apart), derives linear vs constant usage from the difference, and asserts it matches SHA256_BATCH_RESOURCES_LINEAR and SHA256_BATCH_RESOURCES_CONSTANT. Test input is built with deterministic RNG and sha2::compress256 so instance layouts match what Cairo expects.

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

@dorimedini-starkware dorimedini-starkware force-pushed the 05-23-starknet_os_os_resources_test_-_add_keccak branch from 228195b to d6c4ad3 Compare May 24, 2026 20:08
@dorimedini-starkware dorimedini-starkware force-pushed the 05-23-starknet_os_define_sha256_batch_resources_constants branch from e94b0c7 to 908973c Compare May 24, 2026 20:08
@dorimedini-starkware dorimedini-starkware changed the base branch from 05-23-starknet_os_os_resources_test_-_add_keccak to graphite-base/14140 May 25, 2026 09:48
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