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

Prover fails to identify constraints aren't met #534

Closed
joss-aztec opened this issue Nov 29, 2022 · 1 comment · Fixed by #535
Closed

Prover fails to identify constraints aren't met #534

joss-aztec opened this issue Nov 29, 2022 · 1 comment · Fixed by #535
Labels
bug Something isn't working

Comments

@joss-aztec
Copy link
Contributor

joss-aztec commented Nov 29, 2022

Description

Aim

To see that the prover throws an error when trying to prove over unmet constraints.

Expected behavior

This program should fail to prove, but it in fact succeeds (though the result is invalid):

fn main(xs : [u32; 4], y : pub u32) {
    let mut x_total: u32 = 0;
    for i in 0..4 {
      let x = xs[i];
      x_total = x_total + x;
    };
    constrain x_total <= y;
}
// Prover.toml
xs = ["10","0","0","0"]
y = "1"

However, if I then decrease the array length from 4 to 3 to correctly fails

fn main(xs : [u32; 3], y : pub u32) {
    let mut x_total: u32 = 0;
    for i in 0..3 {
      let x = xs[i];
      x_total = x_total + x;
    };
    constrain x_total <= y;
}
// Prover.toml
xs = ["10","0","0"]
y = "1"

Bug

Screen.Recording.2022-11-29.at.11.03.13.mov

To reproduce

Follow above example

Environment

(Specify your setup and versions of dependencies.)

  • OS: macOS 12.4 (Intel)

For nargo users

Whichever nargo build was available at https://github.com/kobyhallx/build-noir/suites/9553357751/artifacts/454490397

@joss-aztec joss-aztec added the bug Something isn't working label Nov 29, 2022
@joss-aztec joss-aztec changed the title Able to prove a non provable input Prover fails to identify constraints aren't met Nov 29, 2022
@guipublic
Copy link
Contributor

I fixed it in PR #535, but I would like to refactor a bit after #520 is merged, so let's keep this one open until then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants