zksecurity / noname

Noname: a programming language to write zkapps

Home Page:https://zksecurity.github.io/noname/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

warn on unconstrained values

mimoo opened this issue · comments

the compiler should warn us that yy is not constrained to anything and that it's useless:

fn main(private_input: Field, x2: Field, pub public_input: Field) {
    let xx = private_input + public_input;
    assert_eq(xx, 2);
    let yy = x2 + 1;
}

to run:

cargo run test --backend kimchi-vesta --path examples/arithmetic.no --private-inputs '{"private_input": "1", "x2": "3"}' --public-inputs '{"public_input": "1"}' --debug

there's different ways to tackle that...

  • frontend: not sure :]
  • r1cs backend: If we tracked all the linear combinations created in a map in the R1CS backend then we could see that some are not used in constraints
  • kimchi backend: I'm not sure