Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trim_to_len in prover does not actually trim anything. #911

Open
qope opened this issue Mar 14, 2023 · 0 comments
Open

trim_to_len in prover does not actually trim anything. #911

qope opened this issue Mar 14, 2023 · 0 comments

Comments

@qope
Copy link
Contributor

qope commented Mar 14, 2023

The code quotient_poly.trim_to_len(quotient_degree) in plonk/prover.rs does not actually trim anything because the length of quotient_poly is always equal to quotient_degree.

https://github.com/mir-protocol/plonky2/blob/eebdd02972fc98c3b0c6082f51d7a807cd8fcdf5/plonky2/src/plonk/prover.rs#L143

Therefore, even if the vanishing polynomial is not divisible by Z_H, the assertion in trim_to_len is ignored and an invalid proof will be generated.

Something like,

quotient_poly.assert_tail_zeros(common_data.quotient_degree_factor).expect(
     "Quotient has failed, the vanishing polynomial is not divisible by Z_H",
);

and

pub fn assert_tail_zeros(&self, n: usize) -> Result<()> {
    ensure!(self.coeffs.iter().rev().take(n).all(F::is_zero));
    Ok(())
}

is desirable.

@Nashtare Nashtare added this to the Misc. milestone Jul 12, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Zero EVM Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants