Skip to main content

Circom Circuits

Troubleshooting Sindri errors with Circom circuits.

When using Sindri to create and prove Circom circuits, you may encounter an error response from your request. The following list shows common errors at each API endpoint.

Circuit Detail

Error

Exception caused by invalid access: trying to access to a signal that is not initialized

Status Code200
Circuit StatusFailed
CauseSyntax Error or Code Error
Resolution

Your code has a syntax or logic issue and needs to be fixed. In this example, the signal xs[0] is not initialized and circuit compilation fails.

Example Response Body "error"

{
"error": "cmd: circom2 --output /tmp/circuits/9a2e698c-eee5-4735-8d9c-54b6d1d7a35f_1689289553776689 --c /tmp/circuits/9a2e698c-eee5-4735-8d9c-54b6d1d7a35f_1689289553776689/code/main_code.circom stdout: stderr: error[T3001]: Exception caused by invalid access: trying to access to a signal that is not initialized\n ┌─ '/tmp/circuits/9a2e698c-eee5-4735-8d9c-54b6d1d7a35f_1689289553776689/code/main_code.circom':10:5\n │\n10 │ xs[0] === X;\n │ ^^^^^ found here\n │\n = call trace:\n ->Cubic\n\nprevious errors were found\n"
}
Error

The file ../circomlib/mimc.circom to be included has not been found

Status Code200
Circuit StatusFailed
Cause

File specified to be included was not found. In the error message above, ../circomlib/mimc.circom would be replaced by the name of your missing file.

Resolution

Include the required file with your upload and check that the import path is up to date. Circomlib files commonly cross reference one another; you may need to include multiple templates from Circomlib for one template used in your main circuit definition.

Example Response Body "error"

{
"error": "cmd: circom2 --output /tmp/circuits/621587eb-396f-4ea0-89cf-5ed4f2c7f0c5_1689295274588843 --c /tmp/circuits/621587eb-396f-4ea0-89cf-5ed4f2c7f0c5_1689295274588843/code/main_code.circom stdout: stderr: error[P1014]: The file ../circomlib/mimc.circom to be included has not been found\n = Consider using compilation option -l to indicate include paths\n\nprevious errors were found\n"
}
Error

'circuit.circom' file is missing

Status Code200
Circuit StatusFailed
Cause

circuit.circom file is not present in the compressed upload.

Resolution

Ensure that your primary circuit definition file is called circuit.circom and include it in the code directory.

Example Response Body "error"

{
"error": "'circuit.circom' file is missing."
}

Proof Detail

Error

Invalid number in JSON input: -1

Status Code200
Proof StatusFailed
CauseUser compiles via c++ but has json input with a negative integer encoded as a string.
Resolution

While the NodeJS WASM witness generator will accept JSON values of the form "-1", the C++ witness generator will not. Any fields likely to have negative integer values need to be encoded as integers, not strings.

Example Response Body "error"

{
"error": "cmd: /tmp/proofs/664b4eb0-627c-4c73-b0db-8f0eed2c1f0b_1689295321697735/main_code /tmp/proofs/664b4eb0-627c-4c73-b0db-8f0eed2c1f0b_1689295321697735/input.json /tmp/proofs/664b4eb0-627c-4c73-b0db-8f0eed2c1f0b_1689295321697735/witness.wtns stdout: stderr: terminate called after throwing an instance of 'std::runtime_error'\n what(): Invalid number in JSON input: -1\n\nqemu: uncaught target signal 6 (Aborted) - core dumped\n"
}

Field

Value
Error

Circom_CalcWit::getInputSignalHashPosition(u64): Assertion ``false' failed

Status Code200
Proof StatusFailed
Cause

User is missing a JSON field in their proof input.

ResolutionInclude required proof input fields.

Example Response Body "error"

{
"error": "cmd: /tmp/proofs/0589f1e5-6cd8-46d8-94cb-31995302c13f_1689295365554809/main_code /tmp/proofs/0589f1e5-6cd8-46d8-94cb-31995302c13f_1689295365554809/input.json /tmp/proofs/0589f1e5-6cd8-46d8-94cb-31995302c13f_1689295365554809/witness.wtns stdout: stderr: Signal not found\nmain_code: calcwit.cpp:60: uint Circom_CalcWit::getInputSignalHashPosition(u64): Assertion `false' failed.\nqemu: uncaught target signal 6 (Aborted) - core dumped\n"
}

Field

Value
Error

Circom_CalcWit::getInputSignalHashPosition(u64): Assertion ``false' failed

Status Code200
Proof StatusFailed
CauseUser has an extra JSON field in their proof input.
ResolutionRemove extra proof input fields.

Example Response Body "error"

{
"error": "cmd: /tmp/proofs/05ed3fdb-4682-42b9-b36a-fe40bd19e97d_1689295410432463/main_code /tmp/proofs/05ed3fdb-4682-42b9-b36a-fe40bd19e97d_1689295410432463/input.json /tmp/proofs/05ed3fdb-4682-42b9-b36a-fe40bd19e97d_1689295410432463/witness.wtns stdout: stderr: Signal not found\nmain_code: calcwit.cpp:60: uint Circom_CalcWit::getInputSignalHashPosition(u64): Assertion `false' failed.\nqemu: uncaught target signal 6 (Aborted) - core dumped\n"
}