I am working on a test suite for snarkyjs-pack and getting this error:
● End to End Votes Test › Incrementing votes › Increments the 0th index
caml_fp_vector_get: Index out of bounds, got 146055/146055
at caml_fp_vector_get (snarkyjs/src/bindings/kimchi/js/bindings.js:505:13)
at external_values (src/lib/crypto/kimchi_backend/pasta/vesta_based_plonk.ml:90:33)
at ../../../../../workspace_root/src/lib/crypto/kimchi_backend/common/plonk_constraint_system.ml:880:44
at iteri$1 (ocaml/base/array0.ml:50:18)
at _oXW_ (src/lib/crypto/kimchi_backend/common/plonk_constraint_system.ml:874:9)
at ../../../../../home/gregor/.opam/4.14.0/lib/base/list.ml:544:8
at fold_left$0 (ocaml/ocaml/list.ml:121:25)
at fold_left$2 (ocaml/base/list0.ml:21:23)
at iteri$2 (ocaml/base/list.ml:543:6)
at compute_witness (src/lib/crypto/kimchi_backend/common/plonk_constraint_system.ml:873:5)
at create_async (src/lib/crypto/kimchi_backend/pasta/vesta_based_plonk.ml:111:7)
at ../../../../../workspace_root/src/lib/snarky/src/base/runners.ml:351:13
at ../../../../../workspace_root/src/lib/snarky/src/base/runners.ml:305:34
at ../../../../../workspace_root/src/lib/snarky/src/base/snark0.ml:1309:19
at finalize_is_running (src/lib/snarky/src/base/snark0.ml:1279:15)
at generate_witness_conv (src/lib/snarky/src/base/snark0.ml:1308:7)
at prove (snarkyjs/src/bindings/ocaml/lib/pickles_bindings.ml:493:7)
at node_modules/snarkyjs/src/lib/proof_system.ts:545:32
at withThreadPool (snarkyjs-pack/node_modules/snarkyjs/src/bindings/js/node/node-backend.js:55:20)
at prettifyStacktracePromise (snarkyjs-pack/node_modules/snarkyjs/src/lib/errors.ts:137:12)
at Object.prove_ [as incrementIndex0] (snarkyjs-pack/node_modules/snarkyjs/src/lib/proof_system.ts:299:18)
at Object.<anonymous> (snarkyjs-pack/tests/provable/end_to_end.test.ts:24:21)
I am working on a test suite for snarkyjs-pack and getting this error:
The test I am running is here: https://github.com/45930/snarkyjs-pack/blob/362276d339b27dade184e40b86637148088c3a9d/tests/provable/end_to_end.test.ts
A different example using snarkyjs-pack in a smart contract context is here: https://github.com/45930/snarkyjs-pack-examples/blob/main/src/BigContract.test.ts. This smart contract can successfully generate transactions on berkeley, but I haven't gotten it to work in a zk program yet.
I'd like help understanding what's going wrong with this zk program so I can build a more robust test suite.