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

circuit compilation fail by some errors #1088

Closed
coldstar1993 opened this issue Aug 23, 2023 · 4 comments
Closed

circuit compilation fail by some errors #1088

coldstar1993 opened this issue Aug 23, 2023 · 4 comments

Comments

@coldstar1993
Copy link

coldstar1993 commented Aug 23, 2023

Background:
My Machine: 36c, 128GB.

My two circuits' size are not small. When I compile them (with node --experimental-wasm-memory64 ), got the errors respectively as blow:

TypeError:The encoded data was not valid for encoding utf-8
image

Errors: curve point must not be the point at infinity
image

These error seems NOT from that the circuit size exceeds the upper limit (though, might be close).

Later, I tried to simplify the circuit by reducing some constraints or operations, like lower merkle-tree heights, rid some constraints, etc. Then they could smoothly be compiled.

My question: if my circuit size does not exceed, why I compiled them with wasm-memory64, but still got these errors?
Furthermore, does snarkyJS support wasm64 currently??

@mitschabaude
Copy link
Contributor

the wasm code compiled from kimchi is definitely not using 64-bit memory, so I wouldn't expect the flag --experimental-wasm-memory64 to have an effect

@coldstar1993
Copy link
Author

coldstar1993 commented Aug 23, 2023

We team are on a L2Rollup product, the circuits' dependency relationship: zkPragramC <- zkPragramB <- RollupContractA, each one is small circuit that is NOT close to the preset upper limit of constraints amount.

I could compile zkPragramC and zkPragramB as sequence smoothly. But after that, the former two circuits' compilation result has already been occupying really much memory(exactly, addressing spaces), and not enough memory(addressing spaces) left for later compilation of RollupContractA, as well as further proving progresses.

What we could do currently is to reduce the merkle-tree height to a really small value, to decrease memory( addressing spaces) occupy to make all circuits compiled and run. But this limit our product really much.

Although our machine memory is 128GB, but due to the wasm code compiled from kimchi is using 32-bit memory, much of machine memory left could not be made usage of for circuits.
So I wonder if snarkyJS will support wasm64 in soon future?

Besides, any practices/suggestions for the cases like ours?

@coldstar1993
Copy link
Author

Besides, how about the progress about 'Expose side loaded verification key to snarkyjs' at #673 ?? It would help much!!

@mitschabaude
Copy link
Contributor

Besides, how about the progress about 'Expose side loaded verification key to snarkyjs' at #673 ?? It would help much!!

Unfortunately we haven't planned to do this in the next 2-4 weeks

@Trivo25 Trivo25 closed this as completed Oct 14, 2024
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

No branches or pull requests

3 participants