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

Proof producer fails on balances_tree example #110

Closed
color-typea opened this issue Sep 23, 2023 · 0 comments · Fixed by #112
Closed

Proof producer fails on balances_tree example #110

color-typea opened this issue Sep 23, 2023 · 0 comments · Fixed by #112

Comments

@color-typea
Copy link

color-typea commented Sep 23, 2023

Folder layout:

> ~/Projects/nil/zkllvm
> ~/Projects/nil/proof-market-toolchain

Steps to reproduce:

  • Compile and assign balances_tree example in zkllvm: cmake --build build --target balances_tree_cpp_example_assign
  • Prepare statement: python3 ./scripts/prepare_statement.py --circuit ../zkllvm/build/examples/cpp/balances_tree.cpp.ll --name balances_tree --type placeholder-zkllvm --private --output ./balances_tree_statement.json
  • Run proof-producer: ./build/bin/proof-generator/proof-generator --proof_out=./balances_tree_proof.bin --circuit_input=./balances_tree_statement.json --public_input=../zkllvm/examples/inputs/balances_tree.inp

Expected result: produces the proof
Actual result: Errors with

./balances_tree_proof.bin_tmp.ll:58:48: warning: ptr type is only supported in -opaque-pointers mode
  %4 = getelementptr inbounds [6 x [2 x i64]], ptr @_ZZN3nil7crypto314multiprecision8backends11window_bitsEmE5wsize, i64 0, i64 %3
                                               ^
assigner: ./balances_tree_proof.bin_tmp.ll:58:48: error: expected type
  %4 = getelementptr inbounds [6 x [2 x i64]], ptr @_ZZN3nil7crypto314multiprecision8backends11window_bitsEmE5wsize, i64 0, i64 %3

Toolchain versions:

  • Compiler: clang version 16.0.0 (git@github.com:NilFoundation/zkllvm-circifier.git f72301483aeb1d4857e621dd763092bbfab9a96f)
  • Assigner: 0.1.1-5 (built from source on f72301483aeb1d4857e621dd763092bbfab9a96f)
  • Proof-generator: built from source on latest master (commit 265097eb21fd0d64b6cb8fcf09f7efc32de6ca7c

Circuit, input, LL, etc.:

Additional:
I'm not 100% sure, but it seems to be coming from __builtin_assigner_bit_decomposition64 builtin - offending code belongs to a

define dso_local noundef i64 @_ZN3nil7crypto314multiprecision8backends11window_bitsEm(i64 noundef %0) local_unnamed_addr #0 {

... which (if I read it right) is a function with a single int64 argument - and there are no such functions defined or used by the example except __builtin_assigner_bit_decomposition64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant