Skip to content

starknet_os: os resources test - add meta tx#14135

Open
dorimedini-starkware wants to merge 1 commit into
05-22-starknet_os_os_resources_test_-_measure_linear_factor_add_deployfrom
05-23-starknet_os_os_resources_test_-_add_meta_tx
Open

starknet_os: os resources test - add meta tx#14135
dorimedini-starkware wants to merge 1 commit into
05-22-starknet_os_os_resources_test_-_measure_linear_factor_add_deployfrom
05-23-starknet_os_os_resources_test_-_add_meta_tx

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 syscall gas costs, versioned OS resource tables, and the OS program hash—fee and proving alignment must stay consistent across the network.

Overview
Adds MetaTxV0 to the OS syscall resource regression harness and refreshes the constants that track its cost.

The OS resources test contract now invokes meta_tx_v0_syscall twice (empty vs longer calldata) so base and calldata-linear overhead can be measured like Deploy. MetaTxV0 is removed from the unmeasurable syscall list, listed among syscalls with a linear factor, and inner-call subtraction ignores memory holes until the OsLogger supports them. Deploy probe salt changes from 3 to 1 for stable measurements.

The deployable measurement account’s __execute__ / __validate__ take a Span<felt252> so meta-tx calldata scaling can be exercised; bundled CASM/Sierra artifacts are regenerated.

META_TX_V0_GAS_COST rises (167950 → 173400). Blockifier 0.14.4 MetaTxV0 OS resources bump constant steps and Pedersen builtins; regression diff notes the 0.14.3→0.14.4 delta. program_hash.json OS hash updates for the rebuilt program.

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

@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-23-starknet_os_os_resources_test_-_add_meta_tx branch 2 times, most recently from dafb7a8 to ce6eb29 Compare May 24, 2026 20:08
@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 05-23-starknet_os_os_resources_test_-_add_meta_tx branch from ce6eb29 to f48908d 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 from 8b293fb to bd9c3be Compare May 25, 2026 09:48
@dorimedini-starkware dorimedini-starkware force-pushed the 05-23-starknet_os_os_resources_test_-_add_meta_tx branch from f48908d to f30d4c1 Compare May 25, 2026 15:37
@dorimedini-starkware dorimedini-starkware force-pushed the 05-22-starknet_os_os_resources_test_-_measure_linear_factor_add_deploy branch from bd9c3be to 9711ff8 Compare 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 1 file and all commit messages, and made 1 comment.
Reviewable status: 1 of 5 files reviewed, 1 unresolved discussion (waiting on dorimedini-starkware).


crates/blockifier_test_utils/resources/feature_contracts/cairo1/os_resources_test_contract.cairo line 69 at r1 (raw file):

            calldata: array![0, 0, 0, 0].span(),
            signature: array![].span(),
        )

Call the const contract instead, so you could have a base cost without arguments (same comment as the deploy syscall)

Code quote:

        // meta_tx_v0 syscall - base.
        meta_tx_v0_syscall(
            address: self_address,
            entry_point_selector: EXECUTE_FUNCTION_SELECTOR,
            // class hash, address, deployable class hash, extra args len.
            calldata: array![0, 0, 0, 0].span(),
            signature: array![].span(),
        )

@dorimedini-starkware dorimedini-starkware force-pushed the 05-23-starknet_os_os_resources_test_-_add_meta_tx branch from f30d4c1 to ed74ad5 Compare May 28, 2026 16:18
@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-22-starknet_os_os_resources_test_-_measure_linear_factor_add_deploy branch from cfcc21d to cca3d02 Compare May 29, 2026 14:04
@dorimedini-starkware dorimedini-starkware force-pushed the 05-23-starknet_os_os_resources_test_-_add_meta_tx branch from ed74ad5 to 7c9637b 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 7c9637b. Configure here.

@dorimedini-starkware dorimedini-starkware force-pushed the 05-22-starknet_os_os_resources_test_-_measure_linear_factor_add_deploy branch from cca3d02 to dc656bd Compare June 1, 2026 08:37
@dorimedini-starkware dorimedini-starkware force-pushed the 05-23-starknet_os_os_resources_test_-_add_meta_tx branch from 7c9637b to 616bec9 Compare June 1, 2026 08:37
@dorimedini-starkware dorimedini-starkware force-pushed the 05-23-starknet_os_os_resources_test_-_add_meta_tx branch from 616bec9 to e970e02 Compare June 1, 2026 10:24
Copy link
Copy Markdown
Contributor

@yoavGrs yoavGrs left a comment

Choose a reason for hiding this comment

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

@yoavGrs reviewed 9 files and all commit messages, and made 4 comments.
Reviewable status: 9 of 10 files reviewed, 5 unresolved discussions (waiting on dorimedini-starkware and Yoni-Starkware).


crates/blockifier/resources/blockifier_versioned_constants_0_14_4.json line 368 at r2 (raw file):

                    "builtin_instance_counter": {
                        "range_check_builtin": 20,
                        "pedersen_builtin": 10

The number of builtins has changed.

Code quote:

"pedersen_builtin": 10

crates/blockifier_test_utils/resources/feature_contracts/cairo1/os_resources_test_contract.cairo line 74 at r2 (raw file):

        // this reason we deploy from zero, and choose a specific salt.
        // base (no calldata):
        deploy_syscall(stable_class_hash, 1, array![0].span(), true).unwrap_syscall();

Why?

Code quote:

1,

crates/starknet_os_flow_tests/src/os_resources_test.rs line 213 at r2 (raw file):

            // TODO(Dori): Consider supporting memory-hole counting in the OsLogger. Until then, we
            //   cannot subtract inner calls with positive memory-hole counts from the OsLogger
            //   resources.

You can count the memory holes if you don't put all the syscalls in a single tx.

Code quote:

            // TODO(Dori): Consider supporting memory-hole counting in the OsLogger. Until then, we
            //   cannot subtract inner calls with positive memory-hole counts from the OsLogger
            //   resources.

crates/starknet_os_flow_tests/src/os_resources_test.rs line 215 at r2 (raw file):

            //   resources.
            let mut inner_resources = inner_calls_iter.next().unwrap().resources.vm_resources;
            inner_resources.n_memory_holes = 0;

The n_memory_holes is zero for all the resources in the versioned constants.

Code quote:

inner_resources.n_memory_holes = 0

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.

4 participants