-
Notifications
You must be signed in to change notification settings - Fork 47
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
Cache verification key in CLI [Do Not Merge Until New Published Version of SnarkyJS is Added] #233
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left some comments!
Looks great! Assuming it all works whether build dir exists or not, like Gregor mentioned. |
jasongitmail
approved these changes
Aug 11, 2022
…improvements [Do Not Merge Until New Published Version of SnarkyJS is Added] (#238) * feat: add update method precondition to template * feat: sudoku preconditions * fix: add static from method to invoke original sudoku constructor * refactor: replace invoking construtor with from method invocations * fix: update setpermissions api on tictactoe example * feat: add gameDone state precondition * feat: add tictactoe nextplayer state precondition * feat: add tictactoe board state precondition * chore: bump snarkyjs version to 0.5.0 * chore: bump template snarkyjs peerdependency version to 0.5.0 * chore: update package.json * fix: update tictactoe run.ts with new account fields * refactor: replace static from method with constructor
* fix: update increment nonce * chore: bump version to 4.12
ymekuria
force-pushed
the
feature/verification-key-cache
branch
from
August 12, 2022 08:27
ff32c2f
to
06bfe24
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Addresses #158
Background
Currently every time the
zk deploy
command is run, the contract is compiled to generate a verification key which takes 10-30s. This leads to a poor experience when a developer goes through the deploy flow multiple times.Approach
A hash of the contract's circuit can be quickly computed using the
SmartContract.digest()
method from SnarkyJS. This digest hash, along with the corresponding verification key that is generated, is stored in a cache the first time 'zk deploy' is run on a contract. Whenzk deploy
is run in the future, if the contract digest matches the stored digest, the cached verification key is used. The contract is only recompiled if the digest changes. See the discussion here for more details.Status
Currently
SmartContract.digest()
isn't available on the published version SnarkyJS. Don't merge this PR until the new version of SnarkyJS is published withSmartContract.digest()
.