Skip to content

fix(prover): use neutral error in verify_public_values#2758

Open
esorense wants to merge 1 commit into
succinctlabs:mainfrom
esorense:neutral-public-values-error-type
Open

fix(prover): use neutral error in verify_public_values#2758
esorense wants to merge 1 commit into
succinctlabs:mainfrom
esorense:neutral-public-values-error-type

Conversation

@esorense
Copy link
Copy Markdown

Motivation

verify_public_values is shared by both Plonk and Groth16 verification paths, but on failure it always returned Groth16VerificationError::InvalidPublicValues.

This caused error-type semantic leakage: a Plonk verification failure could be reported as a Groth16 error, which hurts observability and makes upstream error handling/debugging less reliable.

Solution

Use a protocol-neutral error in verify_public_values instead of hardcoding a Groth16-specific error.

What changed

  • Added an internal neutral error type: PublicValuesVerificationError.
  • Updated verify_public_values to return PublicValuesVerificationError::InvalidPublicValues on hash mismatch.
  • Kept verification logic unchanged (SHA256/Blake3 dual-hash check is untouched).
  • Kept scope minimal to crates/prover/src/verify.rs.

This preserves behavior while fixing error semantics so shared validation code no longer encodes Groth16-specific context.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

tamirhemo
tamirhemo previously approved these changes May 1, 2026
@tamirhemo tamirhemo dismissed their stale review May 1, 2026 21:43

unknown contribution to verifier

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.

2 participants