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

Use new circuit compression to store circuits #949

Closed
moCello opened this issue Jul 6, 2023 · 1 comment · Fixed by #980
Closed

Use new circuit compression to store circuits #949

moCello opened this issue Jul 6, 2023 · 1 comment · Fixed by #980
Assignees
Labels
module:rusk-profile Issues related to rusk-profile module module:rusk-recovery Issues related to rusk-recovery module

Comments

@moCello
Copy link
Member

moCello commented Jul 6, 2023

Summary

With the new version of plonk v0.14 comes the capability to store circuit descriptions in their compressed form before they are compiled. This compressed form is far smaller than the compiled keys which is current form of storing circuits.

This hopefully also fixes the circuit re-compiling issue in the CI when only the circuit dependencies changed. In case of an update in the dependencies, the circuit should be re-compiled but isn't. Currently the compilation has to be triggered manually by bumping the version as seen here.

Possible Solution

Circuit will get their identifiers by hashing their compressed descriptions plus the version of plonk they are using. When recovering a circuit, one needs to decompress it and then compile to get the prover and verifier keys.

With this we can also get rid of hard-coding the circuit-ids in the tests and in rusk-recovery:

  • the compressed circuits will be stored locally under their id's
  • in a toml file the circuit id's can be mapped to their respective contracts
  • by reading the info in the toml file we can therefore check for each stored circuit (if it exists) whether it is equivalent to the up-to-date circuit description in the source code and store an updated version if it is not
  • additionally to the circuits themselves we also need to store some metadata in the circuits file, such as the version of the plonk that the circuit crate depends on
  • the keys will be generated by decompressing and compiling the stored circuits, they will be stored locally under their id with different extensions (vd for verifier data and pk for prover key)
  • in order for rusk-recoveryto not depend on the circuits anymore, the circuit-description-files will be generated by the circuit crates themselves
@moCello
Copy link
Member Author

moCello commented Aug 24, 2023

Since the default variant of the circuit is used for compression, it is imperative to have sensible defaults (i.e. defaults where the circuit description matches with the circuit that is used for creating the proof) for the execute circuits.
See #999

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:rusk-profile Issues related to rusk-profile module module:rusk-recovery Issues related to rusk-recovery module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants