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

Couldn't create a new ceremony when environment variables are not attached to deployed Cloud Functions #317

Open baumstern opened 1 year ago

baumstern commented 1 year ago

There is a template for environment variables in /backend package. But the user can deploy Cloud Functions without configuring those values. In this case, phase2cli coordinate setup command fails like following, because it couldn't create S3 bucket internally due to missing API key:

✔ Circuit metadata read and saved correctly

   ┌───────────── CEREMONY SUMMARY ─────────────┐
   │                                            │
   │   hash                                     │
   │   1                                        │
   │                                            │
   │   Opening: Tue, 07 Feb 2023 10:43:32 UTC   │
   │   Ending: Wed, 08 Feb 2023 10:42:34 UTC    │
   │                                            │
   │   Dynamic Timeout / 100m Penalty           │
   │                                            │
   │   - CIRCUIT # 1                            │
   │                                            │
   │   multiplier2                              │
   │   1                                        │
   │                                            │
   │   Curve: bn-128                            │
   │   Compiler: 1.1.1 (b7ad01b)                │
   │   Source: new.circom()                     │
   │   Threshold: 100%                          │
   │                                            │
   │   # Wires: 4                               │
   │   # Constraints: 1                         │
   │   # Private Inputs: 2                      │
   │   # Public Inputs: 0                       │
   │   # Labels: 4                              │
   │   # Outputs: 1                             │
   │   # PoT: 2                                 │
   │                                            │
   └────────────────────────────────────────────┘

✔ Do you want to continue with the ceremony setup? … No / Yes

- Setup for Circuit # 1

⚠ No pre-computed zKey was found. Therefore, a new zKey from scratch will be generated.
✔ Powers of tau #02 downloaded successfully
ℹ The computation of your brand new zKey is starting soon.
⚠ Be careful, stopping the process will result in the loss of all progress achieved so far.
Reading r1cs
Reading tauG1
Reading tauG2
Reading alphatauG1
Reading betatauG1
processing constraints: 0/1
writing coeffs: 0/4
Writing points start IC: 0/2
Writing points end IC: 0/2
spliting buffer: 0/4
HashingHPoints: 0/4
Writing points start C: 0/2
Writing points end C: 0/2
Writing points start A: 0/4
Writing points end A: 0/4
Writing points start B1: 0/4
Writing points end B1: 0/4
Writing points start B2: 0/4
Writing points end B2: 0/4
Circuit hash: 
                4289918f b00ce352 b426119d 49059905
                382c440e 3439767d b58836b9 6ce102b4
                ea11be67 46375b98 850f3fe6 d5db5730
                122e33c7 65c9a1ec 5e9480aa cbb49b5d

✔ Generation of genesis zKey (multiplier2_00000.zkey) completed successfully
🕐  Getting ready for ceremony files and data storage...node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[FirebaseError: internal] {
  code: 'functions/internal',
  customData: undefined,
  details: undefined
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
baumstern commented 1 year ago

Actually, the error log had printed due to S3 soft limit:

createBucketwf32r05w6pab Error: [ERROR] Generic error when creating a new S3 bucket: TooManyBuckets: You have attempted to create more buckets than allowed at entryFromArgs (/workspace/node_modules/firebase-functions/lib/logger/index.js:130:19) at Object.error (/workspace/node_modules/firebase-functions/lib/logger/index.js:116:11) at logMsg (/workspace/dist/src/functions/index.node.js:125:41) at /workspace/dist/src/functions/index.node.js:1875:9 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async /workspace/node_modules/firebase-functions/lib/common/providers/https.js:438:26

Will investigate environment variable case separately