You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This simple repro works with 1145, but not with 1146 elements
The error is
generating keypair...
/home/default2/Desktop/poseidon/snarkyjs/dist/server/node_bindings/snarky_js_node.bc.js:28740
function symbol_bind(t,f){return caml_call2(_DU_,t,f)}
^
RangeError: Maximum call stack size exceeded
at symbol_bind (/home/default2/Desktop/poseidon/snarkyjs/dist/server/node_bindings/snarky_js_node.bc.js:28740:40)
at caml_call2 (/home/default2/Desktop/poseidon/snarkyjs/dist/server/node_bindings/snarky_js_node.bc.js:24686:28)
at all_unit (/home/default2/Desktop/poseidon/snarkyjs/dist/server/node_bindings/snarky_js_node.bc.js:28772:18)
...
The code is
import {
Field,
Circuit,
circuitMain,
public_,
isReady,
CircuitValue,
arrayProp,
} from 'snarkyjs';
// works with 1145 on my machine
const count = 1146;
class PublicInputs extends CircuitValue {
@arrayProp(Field, count) fields: Field[];
constructor(fields: Field[]) {
super();
this.fields = fields;
}
}
class Main extends Circuit {
@circuitMain
static main(priv: Field, @public_ pub: PublicInputs) {
// do something
}
}
await isReady;
const pub = new PublicInputs([...Array(count).fill(Field.one)]);
console.log('generating keypair...');
console.time('genKey');
const kp = Main.generateKeypair();
console.timeEnd('genKey');
console.log('prove...');
console.time('prove');
const pi = Main.prove([Field.one], [pub], kp);
console.timeEnd('prove');
console.log('proof', pi);
console.log('verify...');
let ok = Main.verify([pub], kp.verificationKey(), pi);
console.log('ok?', ok);
The text was updated successfully, but these errors were encountered:
This simple repro works with 1145, but not with 1146 elements
The error is
The code is
The text was updated successfully, but these errors were encountered: