starknet_os: os resources test - invoke tx constant factor#14146
Conversation
PR SummaryLow Risk Overview
Reviewed by Cursor Bugbot for commit e678a92. Bugbot is set up for automated code reviews on this repo. Configure here. |
3ad85f3 to
c632d3d
Compare
c632d3d to
e678a92
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 e678a92. Configure here.
| "Invoke scaling factor has unexpected value: {:?}", | ||
| invoke_scaling_factor.scaling_factor | ||
| ); | ||
| invoke_resources_params.constant = invoke_overhead; |
There was a problem hiding this comment.
Constant includes calldata-dependent cost, causing double-counting
Medium Severity
The measured invoke_overhead includes calldata-dependent OS cost for the 4 calldata elements used in the test, but it's assigned entirely to invoke_resources_params.constant without subtracting the calldata factor contribution. Since resources_for_tx_type computes constant + calldata_factor * calldata_len / scaling_factor, the calldata cost for the test's 4 elements is permanently baked into the constant and double-counted for every transaction. This inflates the constant by approximately 22 n_steps and 2 poseidon_builtin (the entire poseidon increase from 12→14 is from this inflation).
Additional Locations (1)
Reviewed by Cursor Bugbot for commit e678a92. Configure here.



No description provided.