Skip to content

starknet_proof_verifier: accept either PROOF_VERSION_V0 or PROOF_VERSION_V1 in verify_proof#14013

Merged
Yoni-Starkware merged 2 commits into
mainfrom
05-10-starknet_proof_verifier_accept_either_proof_version_v0_or_proof_version_v1_in_verify_proof
May 18, 2026
Merged

starknet_proof_verifier: accept either PROOF_VERSION_V0 or PROOF_VERSION_V1 in verify_proof#14013
Yoni-Starkware merged 2 commits into
mainfrom
05-10-starknet_proof_verifier_accept_either_proof_version_v0_or_proof_version_v1_in_verify_proof

Conversation

@Yoni-Starkware

Copy link
Copy Markdown
Collaborator

No description provided.

@cursor

cursor Bot commented May 10, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes proof-version validation in the verification path to allow multiple versions, which could affect which proofs are accepted/rejected. The verifier still routes both versions through the same circuit today, so behavioral risk is limited to version-gating and error handling.

Overview
verify_proof now validates the first proof_facts element by parsing it as a ProofVersion, accepting both V0 and V1 instead of hard-rejecting anything other than PROOF_VERSION_V0.

Error reporting is updated accordingly (new “unsupported proof version” message and InvalidProofVersion no longer carries an expected value), and ProgramOutput::try_into_proof_facts writes the version marker via ProofVersion::V0.as_felt() rather than the legacy constant.

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

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

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

@AvivYossef-starkware reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Yoni-Starkware).


crates/starknet_proof_verifier/src/proof_verifier.rs line 132 at r1 (raw file):

    }

    let proof_version = proof_facts.0.first().copied().unwrap_or_default();

plz extract it to a function proof_fact.proof_version()

Code quote:

proof_facts.0.first()

@Yoni-Starkware Yoni-Starkware force-pushed the 05-10-starknet_api_add_proof_version_v1_and_accept_either_marker_in_prooffactsvariant branch from 9225aec to c7f441b Compare May 11, 2026 07:23
@Yoni-Starkware Yoni-Starkware force-pushed the 05-10-starknet_proof_verifier_accept_either_proof_version_v0_or_proof_version_v1_in_verify_proof branch 2 times, most recently from 90c0ffc to e357e34 Compare May 11, 2026 07:30
@Yoni-Starkware Yoni-Starkware force-pushed the 05-10-starknet_api_add_proof_version_v1_and_accept_either_marker_in_prooffactsvariant branch from c7f441b to c87ea0c Compare May 11, 2026 07:30
@Yoni-Starkware Yoni-Starkware force-pushed the 05-10-starknet_proof_verifier_accept_either_proof_version_v0_or_proof_version_v1_in_verify_proof branch from e357e34 to 9396eaa Compare May 11, 2026 07:32
@Yoni-Starkware Yoni-Starkware force-pushed the 05-10-starknet_api_add_proof_version_v1_and_accept_either_marker_in_prooffactsvariant branch 2 times, most recently from 23075f3 to c23dea7 Compare May 11, 2026 07:33
@Yoni-Starkware Yoni-Starkware force-pushed the 05-10-starknet_proof_verifier_accept_either_proof_version_v0_or_proof_version_v1_in_verify_proof branch 2 times, most recently from 106b8dd to c1edbac Compare May 11, 2026 07:55

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

@AvivYossef-starkware reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Yoni-Starkware).


crates/starknet_proof_verifier/src/proof_verifier.rs line 25 at r2 (raw file):

        v1_felt = ProofVersion::V1.as_felt(),
        v1_str = ProofVersion::V1.as_str(),
    )]

consider impl debug / display that shows both str and felt

Code quote:

        "Unsupported proof version: got {actual}, expected {v0_felt} ({v0_str}) or {v1_felt} \
         ({v1_str}).",
        v0_felt = ProofVersion::V0.as_felt(),
        v0_str = ProofVersion::V0.as_str(),
        v1_felt = ProofVersion::V1.as_felt(),
        v1_str = ProofVersion::V1.as_str(),
    )]

@Yoni-Starkware Yoni-Starkware force-pushed the 05-10-starknet_proof_verifier_accept_either_proof_version_v0_or_proof_version_v1_in_verify_proof branch from c1edbac to e78c9e8 Compare May 11, 2026 11:35
@Yoni-Starkware Yoni-Starkware force-pushed the 05-10-starknet_api_add_proof_version_v1_and_accept_either_marker_in_prooffactsvariant branch from c23dea7 to 16de791 Compare May 11, 2026 11:35
@Yoni-Starkware Yoni-Starkware force-pushed the 05-10-starknet_proof_verifier_accept_either_proof_version_v0_or_proof_version_v1_in_verify_proof branch 2 times, most recently from 2b0ff64 to 8a42f7c Compare May 11, 2026 12:03
@Yoni-Starkware Yoni-Starkware force-pushed the 05-10-starknet_api_add_proof_version_v1_and_accept_either_marker_in_prooffactsvariant branch from 16de791 to fa20920 Compare May 11, 2026 12:03

@Yoni-Starkware Yoni-Starkware left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@Yoni-Starkware made 1 comment.
Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on AvivYossef-starkware).


crates/starknet_proof_verifier/src/proof_verifier.rs line 25 at r2 (raw file):

Previously, AvivYossef-starkware wrote…

consider impl debug / display that shows both str and felt

Thanks, done

@AvivYossef-starkware AvivYossef-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:

@AvivYossef-starkware reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Yoni-Starkware).

@Yoni-Starkware Yoni-Starkware force-pushed the 05-10-starknet_api_add_proof_version_v1_and_accept_either_marker_in_prooffactsvariant branch from fa20920 to aeaaed1 Compare May 17, 2026 09:57
@Yoni-Starkware Yoni-Starkware force-pushed the 05-10-starknet_proof_verifier_accept_either_proof_version_v0_or_proof_version_v1_in_verify_proof branch from 8a42f7c to 19501d4 Compare May 17, 2026 09:57

@AvivYossef-starkware AvivYossef-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:

@AvivYossef-starkware reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Yoni-Starkware).

@Yoni-Starkware Yoni-Starkware changed the base branch from 05-10-starknet_api_add_proof_version_v1_and_accept_either_marker_in_prooffactsvariant to main May 18, 2026 07:44
@github-actions

Copy link
Copy Markdown

Artifacts upload workflows:

@Yoni-Starkware Yoni-Starkware left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@Yoni-Starkware reviewed 3 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Yoni-Starkware).

@Yoni-Starkware Yoni-Starkware left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@Yoni-Starkware reviewed 1 file.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Yoni-Starkware).

@Yoni-Starkware Yoni-Starkware added this pull request to the merge queue May 18, 2026
Merged via the queue into main with commit cc42a77 May 18, 2026
51 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants