Skip to content

starknet_os: os resources test - l1 handler tx calldata factor#14152

Open
dorimedini-starkware wants to merge 1 commit into
05-24-starknet_os_os_resources_test_-_deploy_account_tx_calldata_factorfrom
05-24-starknet_os_os_resources_test_-_l1_handler_tx_calldata_factor
Open

starknet_os: os resources test - l1 handler tx calldata factor#14152
dorimedini-starkware wants to merge 1 commit into
05-24-starknet_os_os_resources_test_-_deploy_account_tx_calldata_factorfrom
05-24-starknet_os_os_resources_test_-_l1_handler_tx_calldata_factor

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

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

PR Summary

Low Risk
Regression test and versioned-constants snapshot updates for OS resource accounting only; no production execution-path changes in this diff.

Overview
Extends test_execute_txs_inner_resources so L1 handler OS scaffolding is measured with a base and extra-calldata pair (7 txs instead of 6), matching invoke and deploy-account.

The test now writes TransactionType::L1Handler versioned-constants entries as a constant base plus an unscaled calldata linear factor (l1_handler_extra − l1_handler_base), replacing the prior single overhead value and the TODO to compute that factor. The updated values are checked via the existing expect_file! snapshot against the latest versioned constants JSON.

Reviewed by Cursor Bugbot for commit 82597b0. 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 5dbac28 to d5aaebf Compare May 24, 2026 10:15
@dorimedini-starkware dorimedini-starkware force-pushed the 05-24-starknet_os_os_resources_test_-_deploy_account_tx_calldata_factor branch from 77fc062 to b07e51e Compare May 24, 2026 20:08
@dorimedini-starkware dorimedini-starkware force-pushed the 05-24-starknet_os_os_resources_test_-_l1_handler_tx_calldata_factor branch 2 times, most recently from 7505307 to ebdeac0 Compare May 28, 2026 16:18
@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_os_resources_test_-_deploy_account_tx_calldata_factor branch from 4ff38f8 to 8817938 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 82597b0. Configure here.

l1_handler_resources_params.calldata_factor = VariableCallDataFactor::Unscaled(
(&l1_handler_extra - &l1_handler_base).filter_unused_builtins(),
);
l1_handler_resources_params.constant = l1_handler_base;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

L1 handler constant overestimates due to unscaled model

Medium Severity

The L1 handler constant is set to l1_handler_base, but for an Unscaled calldata factor (scaling_factor=1), the linear model constant + factor * n doesn't fit either measurement point. The base was measured at payload_size=1 and the extra at payload_size=2. Setting constant = l1_handler_base makes Model(1) = l1_handler_extra and Model(2) = 2*l1_handler_extra - l1_handler_base, overestimating by one full calldata factor at every payload size. The correct constant for an unscaled linear fit is l1_handler_base - (l1_handler_extra - l1_handler_base). This differs from the invoke/deploy_account cases where Scaled(2) makes the model exact at n=2.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 82597b0. 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.

2 participants