privacy-scaling-explorations/sonobe

Sumcheck fails with zero polynomial

Closed this issue · 3 comments

We are working on a project that requires to use of a zero polynomial for the sumcheck, and it seems that the verifier cannot handle this. Demo for the bug:

let mut g: VirtualPolynomial<Fr> = VirtualPolynomial::new(2);
    let temp = [Fr::zero()];
    let mle = dense_vec_to_dense_mle(2, &temp);

    let vp_aux_info = VPAuxInfo::<Fr> {
        max_degree: 2,
        num_variables: 2,
        phantom: PhantomData::<Fr>,
    };

    g.add_mle_list([Arc::new(mle.clone()), Arc::new(mle.clone())], Fr::one()).expect("TODO: panic message");

    let sumcheck_proof = IOPSumCheck::<Projective,
        PoseidonTranscript<Projective>>::prove(&g, &mut transcript_p)
        .map_err(|err| Error::SumCheckProveError(err.to_string())).unwrap();

    let sumcheck_subclaim =
        IOPSumCheck::<Projective, PoseidonTranscript<Projective>>::verify(running_committed_instance.x[0], &sumcheck_proof, &vp_aux_info, &mut transcript_p)
            .map_err(|err| Error::SumCheckVerifyError(err.to_string()));

Error: thread 'main' panicked at .../sonobe-internal/folding-schemes/src/utils/espresso/sum_check/verifier.rs:140:59 index out of bounds: the len is 0 but the index is 0

Thanks for reporting this! Could you provide a small repo where we can reproduce this? From the code snipped above I'm not sure to understand how you're using Sonobe to end up in this sumcheck situation.
Again, thanks for reporting the issue!

I added this code https://github.com/NiDimi/sonobe/blob/main/examples/sumcheck_fail.rs. To see the error run cargo run --example sumcheck

Oh right! Thanks for the reproducible code!
The error should not appear when using the Sonobe folding interface, since the $g(X)$ poly should not be zero, but it could appear in the future with other usages of the sumcheck (or as it is now, by directly using the sumcheck without sonobe's folding part as you showed in this issue), so thanks a lot for reporting it!

I've added you as a co-author of the commit that fixes it, since the fix has been made thanks to you: #126
Again, thanks for reporting this! ^^