Skip to content

blockifier,apollo_starknet_os_program: hold empty spans as empty segments - #15140

Open
Yoni-Starkware wants to merge 9 commits into
mainfrom
align-os-null-pointers
Open

Yoni-Starkware wants to merge 9 commits into
mainfrom
align-os-null-pointers

Conversation

@Yoni-Starkware

@Yoni-Starkware Yoni-Starkware commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

A span pointer is now always relocatable: the blockifier held the v3-only spans of a deprecated transaction info as felt zero rather than as empty segments, and the OS matched it. Both sides now bound them with an empty segment.

Note for reviewers: the OS and virtual OS program hashes change, along with META_TX_V0_GAS_COST and the per-transaction OS step counts.

🤖 Generated with Claude Code

Align the OS with the blockifier: where the blockifier allocates a segment for
an empty span, the OS held a null pointer. This covers the L1 handler
signature, the deploy-account account deployment data and proof facts, the
declare proof facts, and the meta-tx-v0 signature forwarded by the caller.

The v3-only fields of version-0 transaction infos stay null, matching the
blockifier's deprecated transaction info.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

Yoni-Starkware and others added 4 commits September 16, 2026 15:42
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
An L1 handler forwards its (empty, null) paymaster data as the meta-tx
signature, into a Cairo 0 `__execute__` that reads the signature through the
deprecated syscall.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…inter

The blockifier held the v3-only spans of a deprecated transaction info as felt
zero rather than as empty segments, and the OS matched it. Allocate empty
segments on both sides instead, so a span pointer is always relocatable.

This removes the need to normalize the meta-tx-v0 signature, which a caller
could previously supply as a null span.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The empty spans of a deprecated transaction info are all bounded by the same
empty segment, rather than one segment each.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Yoni-Starkware Yoni-Starkware changed the title apollo_starknet_os_program: hold empty tx spans as empty segments blockifier,apollo_starknet_os_program: hold empty spans as empty segments Sep 16, 2026
@Yoni-Starkware
Yoni-Starkware marked this pull request as ready for review September 16, 2026 16:12
@cursor

cursor Bot commented Sep 16, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches OS program hash, allowed virtual OS hashes, and gas/resource accounting; mismatches between sequencer and prover would be consensus-critical, though behavior is a narrow representation fix for deprecated txs.

Overview
Aligns blockifier and Starknet OS so v3-only TxInfo span fields on deprecated transactions use relocatable empty segments (start == end) instead of zero/null pointers.

On the OS side, assert_deprecated_tx_fields_consistency now checks equal start/end pointers; meta-tx, L1 handler, deploy-account, and declare paths allocate an empty_span via alloc() for signatures, resource bounds, paymaster data, deployment data, and proof facts. The blockifier’s get_execution_info path for TransactionInfo::Deprecated allocates one empty segment and reuses its pointer for all those spans.

Because the Cairo OS changed, program_hash.json, ALLOWED_VIRTUAL_OS_PROGRAM_HASHES, and 0.14.5 versioned constants are refreshed: META_TX_V0_GAS_COST is 168550 → 168850, OS resource step counts shift slightly (e.g. MetaTxV0, Declare, DeployAccount, L1Handler), and regression tests update expected gas/steps.

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

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 2ab885f. Configure here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Yoni-Starkware and others added 2 commits September 16, 2026 20:15
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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