Closed noway closed 2 years ago
I've tried making a minimal case, but I think it happens only on a big enough circuit or something? Anyway, here's an instruction on how to reproduce:
How to reproduce (tested on a Mac)
Clone and build the nzcp-circom circuit:
git clone git@github.com:noway/nzcp-circom.git
cd nzcp-circom
make
Symlink powersOfTau28_hez_final_22.ptau
from https://hermez.s3-eu-west-1.amazonaws.com/powersOfTau28_hez_final_22.ptau into the working directory:
ln -s ~/Downloads/powersOfTau28_hez_final_22.ptau powersOfTau28_hez_final_22.ptau
make plonk
I've tested this on a fresh cloned repo, the commands above reproduce the bug.
Let me know if you need any more info.
Cheers.
Update, I managed to reproduce this bug with the following circuit:
pragma circom 2.0.3;
template Test() {
signal input a;
signal output b;
b <== 0;
}
component main = Test();
I guess "Variable not used" really means "Signal not used". Is this really a necessary limitation for plonk? Groth16 works fine with unused signals, I think.
Another update: compiling the circuit with --O0
solves the issue. But then the circuit is really big which is not ideal, so still looking for a way to solve this while compiling with --O2
or at least --O1
.
In fact, at --O0
the I have 6718622 plonk constraints while only 2307089 at --O2
. The zkey size at --O0
ends up being 15G which is too big for browser to load using plonk.fullProve
.
Encountering the same problem when trying to compile my circuit here https://github.com/socathie/zkPhoto/blob/main/circuits/zkPhoto.circom . It is bound to have unused signals which is kinda the purpose of this circuit. I am really hoping to use plonk 'cause that will save me the hassle from doing a public phase 2 ceremony. Is it really impossible to use plonk with compression during compilation with a circuit that has unused signals?
Update: This is resolved for me, snarkjs
no longer crashes on version 0.4.16
@socathie try 0.4.16 version, the fix was actually in master for a few weeks but only got released recently.
Update: This is resolved for me,
snarkjs
no longer crashes on version 0.4.16 @socathie try 0.4.16 version, the fix was actually in master for a few weeks but only got released recently.
Yes, update to latest version resolves the error. Thanks. (but now my plonkVerifier contract is way too big for deployment, but that's another issue not related to this one).
Thanks for confirming this was fixed in 0.4.16!
What I've done
I'm using snarkjs@0.4.15
I'm running the following command:
I'm using the following ptau file:
https://hermez.s3-eu-west-1.amazonaws.com/powersOfTau28_hez_final_22.ptau
What's the output
The process exits with code 1
What's expected No error.
Additional info Meanwhile groth16 phase1/phase2 setup and verification works fine