Skip to content

blockifier,apollo_starknet_os_program: support linear message cost#14153

Open
dorimedini-starkware wants to merge 1 commit into
graphite-base/14153from
05-23-blockifier_apollo_starknet_os_program_support_linear_message_cost
Open

blockifier,apollo_starknet_os_program: support linear message cost#14153
dorimedini-starkware wants to merge 1 commit into
graphite-base/14153from
05-23-blockifier_apollo_starknet_os_program_support_linear_message_cost

Conversation

@dorimedini-starkware
Copy link
Copy Markdown
Collaborator

No description provided.

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 24, 2026

Artifacts upload workflows:

Copy link
Copy Markdown
Collaborator Author

dorimedini-starkware commented May 24, 2026

@cursor
Copy link
Copy Markdown

cursor Bot commented May 29, 2026

PR Summary

High Risk
Changes fee metering and OS syscall gas for L1 messaging across sequencer, blockifier, and OS program hashes; misalignment would cause execution/proof failures or incorrect charges.

Overview
SendMessageToL1 is no longer a flat syscall cost: gas and OS step budgets now scale with L1 message payload length, aligned across the Starknet OS, blockifier, and versioned constants.

The OS adds SEND_MESSAGE_TO_L1_PAYLOAD_FACTOR_GAS_COST and charges SEND_MESSAGE_TO_L1_GAS_COST + factor × payload_size in execute_send_message_to_l1. Generated constants.cairo / template and constants_test.rs follow the same linear-cost pattern as Deploy and MetaTxV0. Deploy syscall gas constants and 0_14_3 OS resource entries for Deploy are retuned slightly (base vs calldata factor).

Blockifier applies payload-length linear costing in native (get_syscall_cost(payload.len())), shared syscall_base, deprecated syscalls (linear_factor), and VM syscalls via get_linear_factor_length on SendMessageToL1Request. blockifier_versioned_constants_0_14_3.json models SendMessageToL1 as constant + calldata_factor (and updates Deploy resources). Tests and the OS resources contract exercise empty and one-felt payloads; program_hash.json reflects the OS program change.

Reviewed by Cursor Bugbot for commit bd8c21c. Bugbot is set up for automated code reviews on this repo. 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