starknet_os_flow_tests,apollo_starknet_os_program,blockifier: measure deploy_v2 syscall gas - #14839
Draft
ron-starkware wants to merge 1 commit into
Draft
Conversation
ron-starkware
force-pushed
the
ron/contract-address/deploy-v2-gas
branch
from
July 19, 2026 12:21
c3899b5 to
005fb19
Compare
ron-starkware
force-pushed
the
ron/contract-address/deploy-v2-gas
branch
from
July 19, 2026 12:43
005fb19 to
c1520d6
Compare
|
There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has been marked as stale. |
… deploy_v2 syscall gas deploy_v2's OS resource cost is a provisional copy of Deploy's (gated behind UNMEASURABLE_SYSCALLS). Now that the Cairo compiler can emit deploy_v2, measure it for real and run the versioned-constants regeneration cycle. Measured (vs the provisional Deploy-equal): - OS gas: DEPLOY_V2_GAS_COST 147120 -> 175510, calldata factor 4850 -> 1670. - VC resources (constant): 1725 steps / 43 range_check (was 1173 / 21 range_check + 7 pedersen); calldata factor: 16 steps / 1 range_check (was 8 / 1 pedersen). The Blake path drops the pedersen builtin and spends more steps + range_checks (BLAKE2s hash + the range-check-witnessed Pedersen-image escape), so it costs more than the Pedersen deploy. Changes: - os_resources_test_contract.cairo: call deploy_v2_syscall (base + linear), declared inline like meta_tx_v0_syscall (+ #[allow(extern_outside_corelib)]). - os_resources_test.rs: drop DeployV2 from UNMEASURABLE_SYSCALLS, add it to SYSCALLS_WITH_LINEAR_FACTOR (=1, like Deploy). - allowed_libfuncs.json + PENDING_LIBFUNCS: allow deploy_v2_syscall for feature- contract compilation (pending its addition to Cairo's audited list). - Regenerated: blockifier_versioned_constants_0_14_5.json, the OS constants.cairo gas constants, program_hash.json (main OS only; virtual-OS hash unchanged, so allowed_virtual_os_program_hashes and the frozen proof fixtures are untouched), and the blockifier VC diff-regression fixture. PARKED: the numbers above were measured in July against the pre-rebase OS. They must be re-measured against the current OS before this merges, which needs a Cairo compiler that emits the DeployV2 libfunc (cairo#10214) and a CAIRO1_COMPILER_VERSION bump -- the pinned 2.19.4 does not have it. Until then DeployV2 stays in UNMEASURABLE_SYSCALLS on the rest of the stack. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ron-starkware
force-pushed
the
ron/contract-address/deploy-v2-gas
branch
from
August 31, 2026 13:09
c1520d6 to
ed6116f
Compare
ron-starkware
force-pushed
the
ron/contract-address/v4-os-flow-e2e
branch
from
August 31, 2026 13:09
37bf628 to
a31bd93
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack — on top of
ron/contract-address/v4-os-flow-e2e(#14819). Measures thedeploy_v2syscall's OS gas, which was a provisional copy ofDeploy's (gated behindUNMEASURABLE_SYSCALLS) until the Cairo compiler could emit the syscall.Measured (vs the provisional Deploy-equal)
DEPLOY_V2_GAS_COSTDEPLOY_V2_CALLDATA_FACTOR_GAS_COSTThe Blake path drops the pedersen builtin and spends more steps + range-checks (BLAKE2s hash + the range-check-witnessed Pedersen-image escape), so
deploy_v2genuinely costs more than the Pedersendeploy.Changes
os_resources_test_contract.cairo: exercisedeploy_v2_syscall(base + linear), declared inline likemeta_tx_v0_syscall.os_resources_test.rs: dropDeployV2fromUNMEASURABLE_SYSCALLS, add toSYSCALLS_WITH_LINEAR_FACTOR(=1, likeDeploy).allowed_libfuncs.json+PENDING_LIBFUNCS: allowdeploy_v2_syscallfor feature-contract compilation (pending its addition to Cairo's audited list).blockifier_versioned_constants_0_14_5.json, OSconstants.cairo,program_hash.json(main OS only — virtual-OS hash unchanged, soallowed_virtual_os_program_hashesand the frozen stwo proof fixtures are untouched), and the blockifier VC diff-regression fixture.Parked
The numbers above were measured in July against the pre-rebase OS. They must be re-measured against the current OS before this merges. Until then
DeployV2stays inUNMEASURABLE_SYSCALLSon the rest of the stack, which carries a provisionalDeploy-equal profile in 0_14_5.Requires
A Cairo compiler that emits the
DeployV2Sierra libfunc — cairo#10214 (ron/deploy-v2/compiler). Measured here with astarknet-compilebuilt from that branch; land after that compiler is released andCAIRO1_COMPILER_VERSIONis bumped (the pinned 2.19.4 does not carry the libfunc).🤖 Generated with Claude Code