Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build circuit params] elliptic curve type is not specified #65

Open
0xAleksaOpacic opened this issue Mar 10, 2024 · 2 comments
Open

[build circuit params] elliptic curve type is not specified #65

0xAleksaOpacic opened this issue Mar 10, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@0xAleksaOpacic
Copy link

Description

If we uncomment build_circuit_params job inside scripts/run.sh to generate inputs for the EVM Placeholder Verifier it will fail because we are missing elliptic curve type

Commit Hash

aa8bd37

How to reproduce:

  1. Uncomment build_circuit_params here https://github.com/NilFoundation/zkllvm-template/blob/master/scripts/run.sh#L266
  2. Run bash scripts/run.sh

Solution:

Add necnecessary elliptic curve type in the transpiler command https://github.com/NilFoundation/zkllvm-template/blob/master/scripts/run.sh#L151

@0xAleksaOpacic 0xAleksaOpacic added the bug Something isn't working label Mar 10, 2024
@0xAleksaOpacic
Copy link
Author

[UPDATE]

Even after adding elliptic curve type in the transpiler commands:

    transpiler \
          -m gen-gate-argument \
          -i ../src/public-input.json \
          -t ../template.tbl \
          -c ../template.crct \
          -o template \
          -e pallas \
          --optimize-gates
        check_file_exists "$REPO_ROOT/build/template/gate_argument.sol"
        check_file_exists "$REPO_ROOT/build/template/linked_libs_list.json"
        check_file_exists "$REPO_ROOT/build/template/public_input.json"

        transpiler \
          -m gen-circuit-params \
          -i ../src/public-input.json \
          -t ../template.tbl \
          -c ../template.crct \
          -e pallas \
          -o template
        check_file_exists "$REPO_ROOT/build/template/circuit_params.json"

i still had an issue where running gen-circuit-params returned:
Preprocessing public data...

scripts/run.sh: line 136: 1215386 Segmentation fault      (core dumped) transpiler -m gen-circuit-params -i ../src/public-input.json -t ../template.tbl -c ../template.crct -e pallas -o template

I changed the function to execute:

build_circuit_params() {
   echo;
   echo Building circuit params:
   if [ "$USE_DOCKER" = true ] ; then
       cd "$REPO_ROOT"
       $DOCKER run $DOCKER_OPTS \
         --rm \
         --platform=linux/amd64 \
         --user $(id -u ${USER}):$(id -g ${USER}) \
         --volume $(pwd):/opt/zkllvm-template \
         ghcr.io/nilfoundation/toolchain:${TOOLCHAIN_VERSION} \
         sh -c "bash ./scripts/run.sh build_circuit_params"
       cd -
   else
       cd "$REPO_ROOT/build"

       rm -rf ./template

       # generate/verify proof
       transpiler \
         -m gen-test-proof \
         -c ../template.crct \
         -t ../template.tbl \
         -o template \
         -e pallas

       # generate evm verifier
       transpiler \
         -m gen-evm-verifier \
         -c ../template.crct \
         -t ../template.tbl \
         -o template \
         -e pallas \
         --optimize-gates

       # copy public-inputs
       cp ../src/public-input.json template/public-input.json
       cd -
   fi
 }

and i was able to generate and verify everything.

@0xAleksaOpacic
Copy link
Author

Also even with this fix, the inputs are not valid for evm_placeholder_verifier and if i copy generated folder to evm_placeholder_verifier and try to validate on-chain i have this error:

Verify proofs of all circuits
Verify : ../contracts/zkllvm/template/proof.bin
Wrong public input format!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant