Skip to content

Commit

Permalink
feat: prover components versioning (#1660)
Browse files Browse the repository at this point in the history
## What ❔

Use the defined protocol version on the components of prover subsystems.
Refactor queries to check the protocol version of the job they are
trying to access.

## Why ❔

To be consistent with protocol versions.
To be able to run 2 different versions of provers at the same time with
no intersection

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [x] Tests for the changes have been added / updated.
- [x] Documentation comments have been added / updated.
- [x] Code has been formatted via `zk fmt` and `zk lint`.
- [x] Spellcheck has been run via `zk spellcheck`.
- [x] Linkcheck has been run via `zk linkcheck`.
  • Loading branch information
Artemka374 authored May 7, 2024
1 parent 9b58a4d commit 29a4ffc
Show file tree
Hide file tree
Showing 42 changed files with 408 additions and 202 deletions.
4 changes: 4 additions & 0 deletions core/lib/basic_types/src/protocol_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ impl ProtocolVersionId {
Self::Version24
}

pub fn current_prover_version() -> Self {
Self::Version23
}

pub fn next() -> Self {
Self::Version25
}
Expand Down
7 changes: 5 additions & 2 deletions prover/proof_fri_compressor/src/compressor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use zksync_prover_fri_types::{
};
use zksync_prover_interface::outputs::L1BatchProofForL1;
use zksync_queued_job_processor::JobProcessor;
use zksync_types::L1BatchNumber;
use zksync_types::{L1BatchNumber, ProtocolVersionId};
use zksync_vk_setup_data_server_fri::keystore::Keystore;

use crate::metrics::METRICS;
Expand All @@ -40,6 +40,7 @@ pub struct ProofCompressor {
compression_mode: u8,
verify_wrapper_proof: bool,
max_attempts: u32,
protocol_version: ProtocolVersionId,
}

impl ProofCompressor {
Expand All @@ -49,13 +50,15 @@ impl ProofCompressor {
compression_mode: u8,
verify_wrapper_proof: bool,
max_attempts: u32,
protocol_version: ProtocolVersionId,
) -> Self {
Self {
blob_store,
pool,
compression_mode,
verify_wrapper_proof,
max_attempts,
protocol_version,
}
}

Expand Down Expand Up @@ -135,7 +138,7 @@ impl JobProcessor for ProofCompressor {
let pod_name = get_current_pod_name();
let Some(l1_batch_number) = conn
.fri_proof_compressor_dal()
.get_next_proof_compression_job(&pod_name)
.get_next_proof_compression_job(&pod_name, &self.protocol_version)
.await
else {
return Ok(None);
Expand Down
5 changes: 5 additions & 0 deletions prover/proof_fri_compressor/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use zksync_config::configs::{FriProofCompressorConfig, ObservabilityConfig, Post
use zksync_env_config::{object_store::ProverObjectStoreConfig, FromEnv};
use zksync_object_store::ObjectStoreFactory;
use zksync_queued_job_processor::JobProcessor;
use zksync_types::ProtocolVersionId;
use zksync_utils::wait_for_tasks::ManagedTasks;

use crate::{
Expand Down Expand Up @@ -69,12 +70,16 @@ async fn main() -> anyhow::Result<()> {
let blob_store = ObjectStoreFactory::new(object_store_config.0)
.create_store()
.await;

let protocol_version = ProtocolVersionId::current_prover_version();

let proof_compressor = ProofCompressor::new(
blob_store,
pool,
config.compression_mode,
config.verify_wrapper_proof,
config.max_attempts,
protocol_version,
);

let (stop_sender, stop_receiver) = watch::channel(false);
Expand Down

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 29a4ffc

Please sign in to comment.