Skip to content

Add the mock circuit verifier's input hint#394

Open
YairVaknin-starkware wants to merge 1 commit into
yairv/aggregator_program_hash_scope_varfrom
yairv/add_mock_circuit_verifier_hint
Open

Add the mock circuit verifier's input hint#394
YairVaknin-starkware wants to merge 1 commit into
yairv/aggregator_program_hash_scope_varfrom
yairv/add_mock_circuit_verifier_hint

Conversation

@YairVaknin-starkware

@YairVaknin-starkware YairVaknin-starkware commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Implements MOCK_CIRCUIT_VERIFIER_LOAD_INPUT for the mock circuit verifier program (starkware/cairo/cairo_verifier/mock_circuit_verifier.cairo, added on the main-repo side): loads the MockCircuitVerifierInput program input and sets ids.preprocessed_root / ids.output_values (eight u32 words each, in fresh segments) and ids.n_steps. The mock stands in for the real stwo circuit verifier in the circuit-unpacking applicative bootloader's flow tests: it computes the same output digest D from the given root and output values.

Stack (2/3): aggregator scope var (#393) ← this ← circuit applicative BL hints.

🤖 Generated with Claude Code


This change is Reviewable

@cursor

cursor Bot commented Jul 16, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Isolated test/mock hint path with no auth or production verifier changes; covered by unit tests.

Overview
Adds Rust support for MOCK_CIRCUIT_VERIFIER_LOAD_INPUT, used by the mock circuit verifier Cairo program in circuit-unpacking applicative bootloader flow tests (stand-in for the real stwo circuit verifier).

A new MockCircuitVerifierInput type (n_steps, preprocessed_root, output_values as u32 vectors) is deserialized from program JSON. The hint loads each root/values list into fresh VM segments (as felts) and sets ids.preprocessed_root, ids.output_values, and ids.n_steps. The hint is registered on MinimalBootloaderHintProcessor alongside other applicative bootloader hints, with unit tests for happy path and missing-id failures.

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

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.15966% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 68.42%. Comparing base (efc698e) to head (4fb6a87).

Files with missing lines Patch % Lines
...ro-program-runner-lib/src/hints/hint_processors.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@                             Coverage Diff                             @@
##           yairv/aggregator_program_hash_scope_var     #394      +/-   ##
===========================================================================
+ Coverage                                    67.80%   68.42%   +0.62%     
===========================================================================
  Files                                           41       42       +1     
  Lines                                         5892     6011     +119     
===========================================================================
+ Hits                                          3995     4113     +118     
- Misses                                        1897     1898       +1     
Files with missing lines Coverage Δ
.../src/hints/circuit_applicative_bootloader_hints.rs 100.00% <100.00%> (ø)
crates/cairo-program-runner-lib/src/hints/types.rs 71.06% <ø> (ø)
...ro-program-runner-lib/src/hints/hint_processors.rs 63.25% <50.00%> (-0.10%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@YairVaknin-starkware
YairVaknin-starkware force-pushed the yairv/add_mock_circuit_verifier_hint branch from d2650b2 to 646f18a Compare July 16, 2026 12:32
@YairVaknin-starkware
YairVaknin-starkware force-pushed the yairv/aggregator_program_hash_scope_var branch from 70a5b9a to 840f112 Compare July 16, 2026 12:32

@OmriEshhar1 OmriEshhar1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@OmriEshhar1 reviewed 5 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on Gali-StarkWare and YairVaknin-starkware).


crates/cairo-program-runner-lib/src/hints/circuit_applicative_bootloader_hints.rs at r1 (raw file):
consider naming the file mock_circuit_verifier_hints.rs (instead of circuit_applicative_bootloader_hints.rs)

@OmriEshhar1 OmriEshhar1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@OmriEshhar1 made 1 comment and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Gali-StarkWare).


crates/cairo-program-runner-lib/src/hints/circuit_applicative_bootloader_hints.rs at r1 (raw file):

Previously, OmriEshhar1 wrote…

consider naming the file mock_circuit_verifier_hints.rs (instead of circuit_applicative_bootloader_hints.rs)

OK. I see in PR 395 that you decided to put the hints of circuit_applicative_bootloader and the hints of mock_circuit_verifier in the same place.
I'll leave it to you to decide if you want to keep it in 1 file, or separate to 2 files.
(changed to non-blocking)

@OmriEshhar1 OmriEshhar1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on Gali-StarkWare and YairVaknin-starkware).

Implements MOCK_CIRCUIT_VERIFIER_LOAD_INPUT for the mock circuit verifier
program (starkware/cairo/cairo_verifier/mock_circuit_verifier.cairo): loads
the MockCircuitVerifierInput program input and sets ids.preprocessed_root /
ids.output_values (eight u32 words each, in fresh segments) and ids.n_steps.
The mock stands in for the real stwo circuit verifier in the circuit-unpacking
applicative bootloader's flow tests (added separately): it computes the same
output digest D from the given root and output values.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@YairVaknin-starkware
YairVaknin-starkware force-pushed the yairv/aggregator_program_hash_scope_var branch from 840f112 to efc698e Compare July 16, 2026 21:20
@YairVaknin-starkware
YairVaknin-starkware force-pushed the yairv/add_mock_circuit_verifier_hint branch from 646f18a to 4fb6a87 Compare July 16, 2026 21:20

@YairVaknin-starkware YairVaknin-starkware left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@YairVaknin-starkware made 1 comment and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Gali-StarkWare).


crates/cairo-program-runner-lib/src/hints/circuit_applicative_bootloader_hints.rs at r1 (raw file):

Previously, OmriEshhar1 wrote…

OK. I see in PR 395 that you decided to put the hints of circuit_applicative_bootloader and the hints of mock_circuit_verifier in the same place.
I'll leave it to you to decide if you want to keep it in 1 file, or separate to 2 files.
(changed to non-blocking)

I prefer it that way since it's only one hint that will only be used in the context of the circuit applicative bl anyway.

@Gali-StarkWare Gali-StarkWare left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:lgtm: just move the tests to a different file

@Gali-StarkWare reviewed 5 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on YairVaknin-starkware).

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.

3 participants