Skip to content

Add prove_leaf_from_files to the leaf prover#390

Open
YairVaknin-starkware wants to merge 1 commit into
yairv/add_multiverifier_support_for_recursive_tree_proverfrom
yairv/add_prove_leaf_from_files
Open

Add prove_leaf_from_files to the leaf prover#390
YairVaknin-starkware wants to merge 1 commit into
yairv/add_multiverifier_support_for_recursive_tree_proverfrom
yairv/add_prove_leaf_from_files

Conversation

@YairVaknin-starkware

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

Copy link
Copy Markdown
Contributor

A file-path front end of prove_leaf: loads the compiled program, program input, and both prover parameter JSONs from disk. The binary's main is deduplicated onto it, and tests that drive the leaf prover end-to-end (the recursive tree's golden e2e, added later in this stack) call it directly.

No behavior change on the happy path. The get_program_input_from_path error arm is dropped as dead code (the function is infallible — it only wraps the path; the file is read inside the run). The reachable failure paths (each missing input file panics with its descriptive message) are covered by fast should_panic tests.

Stack (1/4): this ← retarget canonical (#391) ← PackedNode roots (#392) ← goldens e2e (#388).

🤖 Generated with Claude Code


This change is Reviewable

@cursor

cursor Bot commented Jul 15, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Refactor with no intended happy-path behavior change; core proving logic in prove_leaf is untouched.

Overview
Introduces prove_leaf_from_files, a public API that loads the compiled program, optional program input path, and both Cairo/circuit prover parameter JSONs from disk, then delegates to existing prove_leaf. The leaf_prover binary’s run path is reduced to parsing CLI args, calling this helper, and writing JSON output—removing duplicated load/parse logic from main.rs.

Program input loading now uses unwrap() on get_program_input_from_path (the prior error arm is treated as dead code because that helper only wraps the path until the run reads the file). Fast should_panic integration tests assert descriptive panics when the program file or either params JSON is missing.

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

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.25%. Comparing base (270e1b8) to head (df9e302).

Additional details and impacted files
@@                                      Coverage Diff                                      @@
##           yairv/add_multiverifier_support_for_recursive_tree_prover     #390      +/-   ##
=============================================================================================
+ Coverage                                                      65.10%   65.25%   +0.15%     
=============================================================================================
  Files                                                             45       45              
  Lines                                                           5834     5843       +9     
=============================================================================================
+ Hits                                                            3798     3813      +15     
+ Misses                                                          2036     2030       -6     
Files with missing lines Coverage Δ
crates/leaf_prover/src/main.rs 88.88% <100.00%> (+13.13%) ⬆️
crates/leaf_prover/src/prove_leaf.rs 97.56% <100.00%> (+0.59%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@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.

:lgtm:

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

@YairVaknin-starkware
YairVaknin-starkware force-pushed the yairv/add_prove_leaf_from_files branch 2 times, most recently from 2e7f0ae to 083dd1a Compare July 16, 2026 09:25

@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.

:lgtm:

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

A file-path front end of `prove_leaf`: loads the compiled program, program
input, and both prover parameter JSONs from disk. The binary's `main` is
deduplicated onto it, and tests that drive the leaf prover end-to-end (the
recursive tree's golden e2e, added separately) call it directly.

No behavior change on the happy path. The `get_program_input_from_path`
error arm is dropped as dead code (the function is infallible — it only
wraps the path; the file is read inside the run). The reachable failure
paths (each missing input file panics with its descriptive message) are
covered by fast `should_panic` tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@YairVaknin-starkware
YairVaknin-starkware force-pushed the yairv/add_prove_leaf_from_files branch from 083dd1a to df9e302 Compare July 16, 2026 21:20
@YairVaknin-starkware
YairVaknin-starkware force-pushed the yairv/add_multiverifier_support_for_recursive_tree_prover branch from 66e3666 to 270e1b8 Compare July 16, 2026 21:20

@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 2 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Gali-StarkWare).

@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.

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


crates/leaf_prover/tests/prove_leaf_from_files_test.rs line 40 at r3 (raw file):

        &test_data_dir().join("no_such_params.json"),
    );
}

And another test that actually proves?

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