zkmopro / mopro

Making client-side proving on mobile simple.
https://zkmopro.org
Apache License 2.0
131 stars 35 forks source link

Undefined symbols for architecture arm64 #252

Closed svpolonsky closed 2 weeks ago

svpolonsky commented 2 weeks ago

Problem

when using Circom adapter for Android (https://zkmopro.org/docs/adapters/circom/) I get issues with linker

Details

Undefined symbols for architecture arm64 (main is the name of my .wasm file): _main_runtimeshowSharedRWMemory _main_runtimewriteBufferMessage

Acceptance criteria

Ideally, we'd need to get rid of this issue, or suggestions how to modify my circuit to avoid this problem

Next steps (optional)

Can you reproduce the issue with the attached .zkey and .wasm? I'll send them in your telegram channel - they are way too big.

FYI: I use the following circuit: https://github.com/aptos-labs/aptos-core/tree/main/keyless/circuit

svpolonsky commented 2 weeks ago

Link to files in Telegram: https://t.me/zkmopro/474/820

chancehudson commented 2 weeks ago

Hey @svpolonsky can i get a minimal repro for this issue? It would be acceptable to provide a branch or fork and a script to put the necessary files in place, then a build command.

The error you're encountering is coming from rust-witness, specifically the c compilation after the wasm->c transpilation.

chancehudson commented 2 weeks ago

@svpolonsky what version of circom was this witness wasm compiled with?

vivianjeng commented 2 weeks ago

I think it is because the rust-witness doesn't handle the runtime e.g. showSharedRWMemory and it is caused by the log() in circuits

Typically the log should not happen in the production circuits I would suggest to remove the logs

chancehudson commented 2 weeks ago

Ah interesting, rust-witness does properly transpile memory accesses. I'll check to see if it's the log causing this and should be able to fix it in rust-witness.

svpolonsky commented 2 weeks ago

Good news, commenting out log() did help me to cargo run --bin android I'd like to run my circuit on Android, next close the issue