Skip to content

Ohadn/verify program builtin deployment#1702

Draft
ohad-nir-starkware wants to merge 2 commits intoohadn/program_segment-as-pptfrom
ohadn/verify_program_builtin-deployment
Draft

Ohadn/verify program builtin deployment#1702
ohad-nir-starkware wants to merge 2 commits intoohadn/program_segment-as-pptfrom
ohadn/verify_program_builtin-deployment

Conversation

@ohad-nir-starkware
Copy link
Copy Markdown
Collaborator

@ohad-nir-starkware ohad-nir-starkware commented Mar 19, 2026

Note

Medium Risk
Introduces new AIR components and witness generation paths for verify_program, affecting proof generation/verification and preprocessed trace usage; failures would surface as invalid proofs or mismatched traces.

Overview
Adds end-to-end support for a new verify_program builtin that attests to the program segment using preprocessed program columns.

The adapter now derives and injects a verify_program memory segment (covering initial_pc..initial_ap-2) into BuiltinSegments, and the AIR/prover pipelines are extended with new program_component and verify_program claims, components, witness generators, fast-deduction logic, and CASM registry entries.

Enables the builtin only when the preprocessed trace contains curr_program_* columns, updates regression expected values/test data, and adds a prove/verify test that exercises padded verify_program in the all-components layout.

Written by Cursor Bugbot for commit 89efde0. This will update automatically on new commits. Configure here.


This change is Reviewable

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.


pub const PROGRAM_N_COLUMNS: usize = FELT252_N_WORDS;

const DEFAULT_PROGRAM_LOG_LEN: usize = 8;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verifier program column log_size mismatch causes verification failure

High Severity

DEFAULT_PROGRAM_LOG_LEN is 8, but program_component::LOG_SIZE is 12. The verifier's new_with_program_for_verifier doesn't call set_program_table, so ProgramColumn::new reads the default PROGRAM_TABLE (size 1 << 8 = 256), producing columns with log_size = 8. The prover creates columns matching the actual program size (expected to be log_size = 12). This causes a mismatch in log_sizes[PREPROCESSED_TRACE_IDX] and column ordering (sorted by log_size), breaking commitment scheme verification.

Additional Locations (1)
Fix in Cursor Fix in Web

@ohad-nir-starkware ohad-nir-starkware force-pushed the ohadn/verify_program_builtin-deployment branch 11 times, most recently from b61227e to e1bd879 Compare March 22, 2026 15:05
@ohad-nir-starkware ohad-nir-starkware changed the base branch from feature/program_ppt to ohadn/program_segment-as-ppt March 22, 2026 15:07
@ohad-nir-starkware ohad-nir-starkware marked this pull request as ready for review March 25, 2026 14:27
@ohad-nir-starkware ohad-nir-starkware force-pushed the ohadn/program_segment-as-ppt branch 3 times, most recently from cd8b1b5 to c3afbc7 Compare March 28, 2026 16:00
@ohad-nir-starkware ohad-nir-starkware force-pushed the ohadn/program_segment-as-ppt branch from c3afbc7 to e908d2d Compare March 28, 2026 16:58
@ohad-nir-starkware ohad-nir-starkware force-pushed the ohadn/verify_program_builtin-deployment branch 3 times, most recently from b98167c to c1f44f6 Compare March 28, 2026 18:20
@ohad-nir-starkware ohad-nir-starkware force-pushed the ohadn/verify_program_builtin-deployment branch from c1f44f6 to 89efde0 Compare March 29, 2026 12:50
@ohad-nir-starkware ohad-nir-starkware marked this pull request as draft March 30, 2026 14:49
@ohad-nir-starkware ohad-nir-starkware force-pushed the ohadn/program_segment-as-ppt branch from e908d2d to 339127a Compare March 30, 2026 16:57
@ohad-nir-starkware ohad-nir-starkware force-pushed the ohadn/program_segment-as-ppt branch 2 times, most recently from 87fe062 to 2406cde Compare March 31, 2026 13:40
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.

1 participant