proof-systems icon indicating copy to clipboard operation
proof-systems copied to clipboard

return early if proof malformed

Open mimoo opened this issue 3 years ago • 2 comments

in absorb_evaluations (called by both the prover and the verifier) we absorb lookup evaluations only if they are present in the proof:

        if let Some((l0, l1)) = zeta_evals
            .lookup
            .as_ref()
            .zip(zeta_omega_evals.lookup.as_ref())
        {
            points.extend(&[l0.aggreg, l1.aggreg]);
            points.extend(&[l0.table, l1.table]);

            for (s0, s1) in l0.sorted.iter().zip(&l1.sorted) {
                points.extend(&[*s0, *s1]);
            }

            for (r0, r1) in l0.runtime.iter().zip(&l1.runtime) {
                points.extend(&[*r0, *r1]);
            }
        }

that makes sense, but this made me think that we need to make sure that a proof matches an index. I think, early in the verification of a proof we should return an error if the index has a lookup but the proof doesn't have an evaluation (and if the index has a runtime table, but the proof doesn't have one). And potentially vice versa (the proof has a runtime table, but the index doesn't)

mimoo avatar Jul 25 '22 15:07 mimoo

playing with it here: https://github.com/o1-labs/proof-systems/commit/a3f9537f87f90781d7af1fd9e2ebff7886d4463d

mimoo avatar Jul 30 '22 15:07 mimoo

Stale issue message

github-actions[bot] avatar Sep 29 '22 07:09 github-actions[bot]

Stale issue message

github-actions[bot] avatar Nov 29 '22 07:11 github-actions[bot]

Stale issue message

github-actions[bot] avatar Jan 31 '23 07:01 github-actions[bot]

I'll copy what I wrote in https://github.com/o1-labs/proof-systems/issues/751#issuecomment-1430160113 :

So an update on the issue, which I think still misses a number of things:

  • there's more than the evaluation lengths we should check, we should also check the commitment lengths, for example (I talked about it here https://github.com/o1-labs/proof-systems/issues/147)
  • imo it'd be clearer if all of that logic is implemented on the structure we validate. For example, we could have a validate(&self) -> Result<()> function implemented on ProverProof, and ProofEvaluations, etc.
  • the checks are written in a way that doesn't necessarily match the index

for the latter one, see this example in https://github.com/o1-labs/proof-systems/pull/989/files#diff-fc95db4d289fd33bc7fbefe8a487926ce8b47cbe71f047a1dd6933d7444b5d5aR521:

if let Some(LookupEvaluations {

which will not check if there's no lookup evaluations. But if the index says that lookup should be here then we should error here instead. I talked about it here as well: https://github.com/o1-labs/proof-systems/issues/540

mimoo avatar Feb 14 '23 23:02 mimoo

Stale issue message

github-actions[bot] avatar Apr 16 '23 07:04 github-actions[bot]