Skip to content

Prevent cleanDir(localPaths.zkeys) if zkeys and pot are present (to avoid double computing) #350

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

Open
1 task done
NicoSerranoP opened this issue Mar 7, 2025 · 0 comments

Comments

@NicoSerranoP
Copy link
Member

Prerequisites

Please answer the following question for yourself before submitting a feature request.

  • I checked to make sure that this request has not already been filed

Motivation

When setting up a ceremony we compute the first zkey for each circuit. This computation function takes the .r1cs, .wasm and .ptau files and outputs the .zkeys files.

  1. The zkey generation computation could be expensive depending on the circuit's size
  2. The .ptau download could take time depending on the file's size

Details

Before starting the setup process, we clean the working directory (specifically the /output directory):

cleanDir(localPaths.setup)

In this directory there could be files from previous failed setup processes that could we useful as a starting point. My first idea was to get rid of this 4 cleanDir commands but I think it would be better to tell the user that he could put in there the .zkeys and .ptau files he already has and ask the user if he wants to delete the directory if he needs a clean start.

Remember that not this feature is not related to that code section only but also in:

  1. the .ptau download step should be skipped if the file is already there (remember to check inside the /output directory:

    const alreadyDownloadedPtauFiles = await getDirFilesSubPaths(localPaths.pot)

  2. the zkey computation process, there should be a checking step to see if there is already a file there:

Make sure that you have reviewed p0tion's Contributor Guidelines

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

1 participant