-
Notifications
You must be signed in to change notification settings - Fork 480
Open
Description
I have encountered the following behaviour when running snarkjs with PLONK backend.
- I have a circuit below:
pragma circom 2.2.3;
template main_template() {
signal input in0;
(in0 - 15) * (in0 - 16) === 0;
}
component main = main_template();circomcompilation succeeds (producescircuit.r1cs, wasm/js witness code).- Witness generation succeeds (
witness.js.wtnsproduced). snarkjs wtns check circuit.r1cs witness.wtnspasses.snarkjs plonk setup circuit.r1cs <ptau> plonk_final.zkeysucceeds.snarkjs plonk prove plonk_final.zkey witness.wtns proof.json public.jsonfails with
[ERROR] snarkJS: Error: Evaluations.getEvaluation() out of bounds
at Evaluations.getEvaluation (/home/jcabala/.nvm/versions/node/v20.18.3/lib/node_modules/snarkjs/build/cli.cjs:8109:19)
at computeT (/home/jcabala/.nvm/versions/node/v20.18.3/lib/node_modules/snarkjs/build/cli.cjs:8714:50)
at async round3 (/home/jcabala/.nvm/versions/node/v20.18.3/lib/node_modules/snarkjs/build/cli.cjs:8572:9)
at async plonk16Prove (/home/jcabala/.nvm/versions/node/v20.18.3/lib/node_modules/snarkjs/build/cli.cjs:8247:5)
at async plonkFullProve$1 (/home/jcabala/.nvm/versions/node/v20.18.3/lib/node_modules/snarkjs/build/cli.cjs:9018:12)
at async Object.plonkFullProve [as action] (/home/jcabala/.nvm/versions/node/v20.18.3/lib/node_modules/snarkjs/build/cli.cjs:13610:36)
at async clProcessor (/home/jcabala/.nvm/versions/node/v20.18.3/lib/node_modules/snarkjs/build/cli.cjs:481:27)
snarkjs file info plonk_final.zkeyshows a suspicious condition:
[*] zkey sanity info
File info for ./origin/plonk_final.zkey
File size: 13408 bytes
File type: zkey
Version: undefined
Bin version: undefined
section #1 size: 4 offset: 0x3128
section #2 size: 796 offset: 0x3138
section #3 !! size: 0 offset: 0xc
> Section 3 size is zero. This could cause false errors in other sections.
section #4 size: 4 offset: 0x18
section #5 size: 4 offset: 0x28
-
Same failure occurs with
snarkjs plonk fullprove .... -
When we change the circuit to the one below (added the output):
pragma circom 2.2.3;
template main_template() {
signal input in0;
signal output out0;
out0 <== 1;
(in0 - 15) * (in0 - 16) === 0;
}
component main = main_template();snarkjs plonk prove plonk_final.zkey witness.wtns proof.json public.jsonworks, butsnarkjs file info plonk_final.zkeystill shows the weird condition.
Here are the scripts and circuits I have been running: https://github.com/jCabala/snarkjs-plonk-issue
Metadata
Metadata
Assignees
Labels
No labels