Skip to content

starknet_proof_verifier: accept either PROOF_VERSION_V0 or PROOF_VERSION_V1 in verify_proof#14013

Open
Yoni-Starkware wants to merge 1 commit into
05-10-starknet_api_add_proof_version_v1_and_accept_either_marker_in_prooffactsvariantfrom
05-10-starknet_proof_verifier_accept_either_proof_version_v0_or_proof_version_v1_in_verify_proof
Open

starknet_proof_verifier: accept either PROOF_VERSION_V0 or PROOF_VERSION_V1 in verify_proof#14013
Yoni-Starkware wants to merge 1 commit into
05-10-starknet_api_add_proof_version_v1_and_accept_either_marker_in_prooffactsvariantfrom
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
Copy link
Copy Markdown

cursor Bot commented May 10, 2026

PR Summary

Medium Risk
Touches proof verification gating logic by widening accepted ProofFacts version markers to include V1, which could change which proofs are accepted or rejected. While the verifier circuit call is unchanged, mistakes here impact a security-critical validation boundary.

Overview
Updates verify_proof to accept either ProofVersion::V0 or ProofVersion::V1 by parsing the first felt via ProofFacts::proof_version_felt()/ProofVersion::try_from instead of hard-rejecting anything not equal to PROOF_VERSION_V0.

Refactors related constants/error reporting: ProgramOutput::try_into_proof_facts now writes the version marker via ProofVersion::V0.as_felt(), and VerifyProofError::InvalidProofVersion is simplified to report the unsupported actual value (with an error message listing V0/V1).

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

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

Copy link
Copy Markdown
Contributor

@AvivYossef-starkware AvivYossef-starkware left a comment

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
Copy link
Copy Markdown
Contributor

@AvivYossef-starkware AvivYossef-starkware left a comment

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 from e78c9e8 to 2b0ff64 Compare May 11, 2026 11:49
@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 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
Copy link
Copy Markdown
Collaborator Author

@Yoni-Starkware Yoni-Starkware left a comment

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

Copy link
Copy Markdown
Contributor

@AvivYossef-starkware AvivYossef-starkware left a comment

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

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