quadratic-funding / mpc-phase2-suite

The MPC suite of tools for conducting zkSNARK Phase 2 Trusted Setup ceremonies
MIT License
16 stars 6 forks source link

`verifycontribution` fails for a circuit with 4.4 M constraints size #365

Open baumstern opened 1 year ago

baumstern commented 1 year ago

The latest ProcessMessages circuit of maci (commit: https://github.com/privacy-scaling-explorations/maci/commit/6f45848cd4dd64a7dcc86574dd2092371840d8b9) with 6-8-3-3 params, which has 4,457,493 constraints, couldn't be processed by verifycontribution Cloud Function.

Cause

To verify its contribution, Cloud Function tried to download a total of 17.46 GB into its ramdisk but failed due to the memory limit of 16 GB.

Log of verifycontribution

2023-03-25 00:00:20.737 CET
Callable request verification passed

2023-03-25 00:00:21.802 CET
[DEBUG] lastZkeyIndex: 00001

2023-03-25 00:00:21.812 CET
[DEBUG] potObjectKey: pot/powersOfTau28_hez_final_23.ptau

2023-03-25 00:09:51.596 CET
[DEBUG] firstObjectKey: circuits/main/contributions/main_00000.zkey

2023-03-25 00:14:20.840 CET
[DEBUG] lastZkeyObjectKey: circuits/main/contributions/main_00001.zkey

2023-03-25 00:17:55.467 CET
'Memory limit of 16384 MiB exceeded with 16385 MiB used. Consider increasing the memory limit, see https://cloud.google.com/functions/docs/configuring/memory
0xjei commented 1 year ago

Unless the ability to upgrade CF V2s to 32 GiB memory is released, I don't see how we could currently satisfy circuits of this size. A custom approach that outsources the verification of the contribution will be needed.