Skip to content

starknet_os: os resources test - measure linear factor, add deploy#14134

Open
dorimedini-starkware wants to merge 1 commit into
graphite-base/14134from
05-22-starknet_os_os_resources_test_-_measure_linear_factor_add_deploy
Open

starknet_os: os resources test - measure linear factor, add deploy#14134
dorimedini-starkware wants to merge 1 commit into
graphite-base/14134from
05-22-starknet_os_os_resources_test_-_measure_linear_factor_add_deploy

Conversation

@dorimedini-starkware
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Collaborator Author

dorimedini-starkware commented May 24, 2026

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

@cursor
Copy link
Copy Markdown

cursor Bot commented May 24, 2026

PR Summary

Medium Risk
Changes fee/resource accounting constants and the OS program hash used for proving; incorrect values would mischarge Deploy or break OS hash checks.

Overview
Extends the OS resources regression test so syscall costs can be recorded as either flat ExecutionResources or VariableResourceParams with constant + calldata linear factor, by pairing back-to-back traces for Deploy and MetaTxV0.

The Cairo1 measurement contract now invokes deploy_syscall twice (base vs longer calldata), with stable salt/deploy_from_zero to keep address normalization from skewing results; Deploy is removed from the unmeasurable syscall list.

Measured Deploy overhead is written into 0.14.4 versioned constants (higher constant steps/Pedersen), DEPLOY_GAS_COST in OS Cairo constants, the OS program hash, and the 0.14.3→0.14.4 constants diff regression snippet.

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

Comment thread crates/starknet_os_flow_tests/src/os_resources_test.rs
@dorimedini-starkware dorimedini-starkware changed the base branch from 05-21-starknet_os_os_resources_test_-_library_call to graphite-base/14134 May 24, 2026 13:10
@dorimedini-starkware dorimedini-starkware force-pushed the 05-22-starknet_os_os_resources_test_-_measure_linear_factor_add_deploy branch from a775a63 to 268457e Compare May 24, 2026 17:03
@dorimedini-starkware dorimedini-starkware force-pushed the 05-22-starknet_os_os_resources_test_-_measure_linear_factor_add_deploy branch from 268457e to 8b293fb Compare May 24, 2026 20:08
@dorimedini-starkware dorimedini-starkware force-pushed the graphite-base/14134 branch 2 times, most recently from 6266963 to b45291c Compare May 25, 2026 09:48
@dorimedini-starkware dorimedini-starkware force-pushed the 05-22-starknet_os_os_resources_test_-_measure_linear_factor_add_deploy branch 2 times, most recently from bd9c3be to 9711ff8 Compare May 25, 2026 15:37
@dorimedini-starkware dorimedini-starkware changed the base branch from graphite-base/14134 to 05-24-starknet_os_os_resources_test_-_create_fixed_deployable_account May 25, 2026 15:37
Copy link
Copy Markdown
Collaborator

@Yoni-Starkware Yoni-Starkware left a comment

Choose a reason for hiding this comment

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

@Yoni-Starkware reviewed 3 files and all commit messages, and made 1 comment.
Reviewable status: 3 of 5 files reviewed, 1 unresolved discussion (waiting on dorimedini-starkware).


crates/blockifier/resources/blockifier_versioned_constants_0_14_3.json line 253 at r3 (raw file):

                    "builtin_instance_counter": {
                        "range_check_builtin": 21,
                        "pedersen_builtin": 8

Should be 7. It's 8 here because your base case is with array![0]...
Maybe do 3 calls? base, linear[1], linear[2]?

Code quote:

 "pedersen_builtin": 8

@dorimedini-starkware dorimedini-starkware force-pushed the 05-22-starknet_os_os_resources_test_-_measure_linear_factor_add_deploy branch from 9711ff8 to cfcc21d Compare May 28, 2026 16:18
@dorimedini-starkware dorimedini-starkware force-pushed the 05-24-starknet_os_os_resources_test_-_create_fixed_deployable_account branch from 91c50c1 to 92f7798 Compare May 28, 2026 16:18
@dorimedini-starkware dorimedini-starkware changed the base branch from 05-24-starknet_os_os_resources_test_-_create_fixed_deployable_account to graphite-base/14134 May 29, 2026 14:04
@dorimedini-starkware dorimedini-starkware force-pushed the 05-22-starknet_os_os_resources_test_-_measure_linear_factor_add_deploy branch from cfcc21d to cca3d02 Compare May 29, 2026 14:04
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit cca3d02. Configure here.

+ /os_constants/allowed_virtual_os_program_hashes/2: "0x28619dbc9767792fb536aaba7a2d55f70faadf808c95ec66b956d33fdee1bc0"
~ /os_resources/execute_syscalls/CallContract/n_steps: 901
~ /os_resources/execute_syscalls/Deploy/constant/builtin_instance_counter/pedersen_builtin: 8
~ /os_resources/execute_syscalls/Deploy/constant/n_steps: 1183
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Regression diff and JSON have inconsistent values

Medium Severity

The regression diff states Deploy/constant/n_steps: 1183 but the versioned constants JSON for 0.14.4 has n_steps: 1181. The regression diff is auto-generated by comparing adjacent version JSONs, so these values must match. This inconsistency will cause test_vc_diffs_regression to fail.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit cca3d02. Configure here.

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.

3 participants