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

fix(prover): Use SNARK wrapper VK for picking prover jobs #142

Conversation

ly0va
Copy link
Member

@ly0va ly0va commented Oct 2, 2023

What ❔

Prover and Witgen now use snark wrapper VKs to pick their jobs.

Why ❔

prover_protocol_versions table had SNARK wrapper VKs, but prover and witgens picked jobs based on FRI scheduler VKs.

Since if one changes the other also does, we can use the SNARK one instead, since it's also used in eth_sender.

@ly0va ly0va requested a review from a team as a code owner October 2, 2023 20:49
@ly0va ly0va marked this pull request as draft October 2, 2023 20:49
@@ -24,6 +25,8 @@ pub struct VkCommitments {

fn circuit_commitments() -> anyhow::Result<L1VerifierConfig> {
let commitments = generate_commitments().context("generate_commitments()")?;
let snark_wrapper_vk = std::env::var("CONTRACTS_RECURSION_SCHEDULER_LEVEL_VK_HASH")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a JSON with snark wrapper vk (vk_setup_data_generator_server_fri/data/snark_verification_scheduler_key.json), I think you should calculate hash based on this key like it's done for other hashes and not just take it from env.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, the VK encodings that we use before hashing in Verifier.sol and in zkevm_test_harness are different (not only the order of fields is different, but also Verifier adds an extra field).

Unless we want to do a large copy-paste the hashes would be different. I think we should leave this for now and add actually computing the vk commitment later.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really unfortunate, I'm ok if we merge it to boojum-integration as is to unblock testing, but we should fix it before merging to main.

Co-authored-by: Stanislav Bezkorovainyi <[email protected]>
@ly0va ly0va changed the title Use SNARK wrapper VK for picking prover jobs fix(prover): Use SNARK wrapper VK for picking prover jobs Oct 3, 2023
@ly0va ly0va requested a review from perekopskiy October 3, 2023 12:54
@ly0va ly0va marked this pull request as ready for review October 4, 2023 08:57
@ly0va ly0va force-pushed the lyova-pla-581-use-snark-vk-hash-while-picking-prover-jobs branch from d3c3f9d to 08ba08e Compare October 5, 2023 08:31
@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (867f2bf) 32.14% compared to head (e9babb3) 32.14%.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           boojum-integration     #142   +/-   ##
===================================================
  Coverage               32.14%   32.14%           
===================================================
  Files                     482      482           
  Lines                   25930    25930           
===================================================
  Hits                     8336     8336           
  Misses                  17594    17594           
Files Coverage Δ
core/bin/zksync_server/src/main.rs 100.00% <ø> (ø)
core/lib/config/src/configs/contracts.rs 100.00% <ø> (ø)
core/lib/zksync_core/src/lib.rs 27.15% <ø> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ly0va ly0va merged commit 6040e37 into boojum-integration Oct 5, 2023
ilitteri pushed a commit that referenced this pull request Feb 23, 2024
… Validium mode and Rollup mode (#142)

* add validium env test

* abstract from_env method
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

Successfully merging this pull request may close these issues.

4 participants