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

feat: ProverJobProcessor & circuit prover #3287

Merged
merged 8 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-prover-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
ci_run zkstack prover run --component=witness-generator --round=all-rounds --docker=false &>prover_logs/witness-generator.log &
- name: Run Circuit Prover
run: |
ci_run zkstack prover run --component=circuit-prover --witness-vector-generator-count=10 --docker=false &>prover_logs/circuit_prover.log &
ci_run zkstack prover run --component=circuit-prover -l=23 -h=3 --docker=false &>prover_logs/circuit_prover.log &
- name: Wait for prover jobs to finish
env:
DATABASE_URL: postgres://postgres:notsecurepassword@localhost:5432/zksync_prover_localhost_proving_chain
Expand Down
19 changes: 18 additions & 1 deletion core/lib/basic_types/src/prover_dal.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Types exposed by the prover DAL for general-purpose use.
use std::{net::IpAddr, ops::Add, str::FromStr};
use std::{net::IpAddr, ops::Add, str::FromStr, time::Instant};

use chrono::{DateTime, Duration, NaiveDateTime, NaiveTime, Utc};
use serde::{Deserialize, Serialize};
Expand All @@ -18,6 +18,23 @@ pub struct FriProverJobMetadata {
pub sequence_number: usize,
pub depth: u16,
pub is_node_final_proof: bool,
pub pick_time: Instant,
}

impl FriProverJobMetadata {
/// Checks whether the metadata corresponds to a scheduler proof or not.
pub fn is_scheduler_proof(&self) -> anyhow::Result<bool> {
if self.aggregation_round == AggregationRound::Scheduler {
if self.circuit_id != 1 {
return Err(anyhow::anyhow!(
"Invalid circuit id {} for Scheduler proof",
self.circuit_id
));
}
return Ok(true);
}
Ok(false)
}
EmilLuta marked this conversation as resolved.
Show resolved Hide resolved
}

#[derive(Debug, Clone, Copy, Default)]
Expand Down
41 changes: 39 additions & 2 deletions prover/Cargo.lock

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

3 changes: 3 additions & 0 deletions prover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ strum_macros = "0.26"
tempfile = "3"
tokio = "1"
tokio-util = "0.7.11"
tokio-stream = "0.1.16"
toml_edit = "0.14.4"
tracing = "0.1"
tracing-subscriber = "0.3"
Expand Down Expand Up @@ -100,6 +101,8 @@ zksync_prover_fri_types = { path = "crates/lib/prover_fri_types" }
zksync_prover_fri_utils = { path = "crates/lib/prover_fri_utils" }
zksync_prover_keystore = { path = "crates/lib/keystore" }
zksync_vk_setup_data_generator_server_fri = { path = "crates/bin/vk_setup_data_generator_server_fri" }
zksync_prover_job_processor = { path = "crates/lib/prover_job_processor" }
zksync_circuit_prover_service = { path = "crates/lib/circuit_prover_service" }
zksync_prover_job_monitor = { path = "crates/bin/prover_job_monitor" }

# for `perf` profiling
Expand Down
4 changes: 4 additions & 0 deletions prover/crates/bin/circuit_prover/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "zksync_circuit_prover"
description = "ZKsync circuit prover binary implementation"
version.workspace = true
edition.workspace = true
authors.workspace = true
Expand All @@ -8,6 +9,7 @@ repository.workspace = true
license.workspace = true
keywords.workspace = true
categories.workspace = true
publish = false

[dependencies]
tokio = { workspace = true, features = ["macros", "time"] }
Expand All @@ -29,6 +31,8 @@ zksync_prover_keystore = { workspace = true, features = ["gpu"] }
zksync_env_config.workspace = true
zksync_core_leftovers.workspace = true
zksync_utils.workspace = true
zksync_circuit_prover_service.workspace = true
zksync_prover_job_processor.workspace = true

vise.workspace = true
shivini = { workspace = true, features = [
Expand Down
Loading
Loading