Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
ColoCarletti committed May 3, 2024
2 parents 5f30839 + 3fd6d65 commit 73854f1
Show file tree
Hide file tree
Showing 18 changed files with 1,553 additions and 39 deletions.
141 changes: 132 additions & 9 deletions core/lib/basic_types/src/prover_dal.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
//! Types exposed by the prover DAL for general-purpose use.
use std::{net::IpAddr, ops::Add, str::FromStr};

use chrono::{DateTime, Duration, Utc};
use chrono::{DateTime, Duration, NaiveDateTime, NaiveTime, Utc};
use strum::{Display, EnumString};

use crate::{basic_fri_types::AggregationRound, L1BatchNumber};
use crate::{
basic_fri_types::{AggregationRound, Eip4844Blobs},
protocol_version::ProtocolVersionId,
L1BatchNumber,
};

// This currently lives in `zksync_prover_types` -- we don't want a dependency between prover types (`zkevm_test_harness`) and DAL.
// This will be gone as part of 1.5.0, when EIP4844 becomes normal jobs, rather than special cased ones.
Expand Down Expand Up @@ -93,13 +98,13 @@ pub struct JobPosition {
pub sequence_number: usize,
}

#[derive(Debug, Default)]
#[derive(Debug, Default, PartialEq)]
pub struct ProverJobStatusFailed {
pub started_at: DateTime<Utc>,
pub error: String,
}

#[derive(Debug)]
#[derive(Debug, PartialEq)]
pub struct ProverJobStatusSuccessful {
pub started_at: DateTime<Utc>,
pub time_taken: Duration,
Expand All @@ -114,12 +119,12 @@ impl Default for ProverJobStatusSuccessful {
}
}

#[derive(Debug, Default)]
#[derive(Debug, Default, PartialEq)]
pub struct ProverJobStatusInProgress {
pub started_at: DateTime<Utc>,
}

#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct WitnessJobStatusSuccessful {
pub started_at: DateTime<Utc>,
pub time_taken: Duration,
Expand All @@ -134,13 +139,13 @@ impl Default for WitnessJobStatusSuccessful {
}
}

#[derive(Debug, Default)]
#[derive(Debug, Default, Clone)]
pub struct WitnessJobStatusFailed {
pub started_at: DateTime<Utc>,
pub error: String,
}

#[derive(Debug, strum::Display, strum::EnumString, strum::AsRefStr)]
#[derive(Debug, strum::Display, strum::EnumString, strum::AsRefStr, PartialEq)]
pub enum ProverJobStatus {
#[strum(serialize = "queued")]
Queued,
Expand All @@ -156,7 +161,7 @@ pub enum ProverJobStatus {
Ignored,
}

#[derive(Debug, strum::Display, strum::EnumString, strum::AsRefStr)]
#[derive(Debug, Clone, strum::Display, strum::EnumString, strum::AsRefStr)]
pub enum WitnessJobStatus {
#[strum(serialize = "failed")]
Failed(WitnessJobStatusFailed),
Expand Down Expand Up @@ -229,3 +234,121 @@ impl FromStr for GpuProverInstanceStatus {
}
}
}

pub struct ProverJobFriInfo {
pub id: u32,
pub l1_batch_number: L1BatchNumber,
pub circuit_id: u32,
pub circuit_blob_url: String,
pub aggregation_round: AggregationRound,
pub sequence_number: u32,
pub status: ProverJobStatus,
pub error: Option<String>,
pub attempts: u8,
pub processing_started_at: Option<NaiveDateTime>,
pub created_at: NaiveDateTime,
pub updated_at: NaiveDateTime,
pub time_taken: Option<NaiveTime>,
pub is_blob_cleaned: Option<bool>,
pub depth: u32,
pub is_node_final_proof: bool,
pub proof_blob_url: Option<String>,
pub protocol_version: Option<ProtocolVersionId>,
pub picked_by: Option<String>,
}

pub struct BasicWitnessGeneratorJobInfo {
pub l1_batch_number: L1BatchNumber,
pub merkle_tree_paths_blob_url: Option<String>,
pub attempts: u32,
pub status: WitnessJobStatus,
pub error: Option<String>,
pub created_at: NaiveDateTime,
pub updated_at: NaiveDateTime,
pub processing_started_at: Option<NaiveDateTime>,
pub time_taken: Option<NaiveTime>,
pub is_blob_cleaned: Option<bool>,
pub protocol_version: Option<i32>,
pub picked_by: Option<String>,
pub eip_4844_blobs: Option<Eip4844Blobs>,
}

pub struct LeafWitnessGeneratorJobInfo {
pub id: u32,
pub l1_batch_number: L1BatchNumber,
pub circuit_id: u32,
pub closed_form_inputs_blob_url: Option<String>,
pub attempts: u32,
pub status: WitnessJobStatus,
pub error: Option<String>,
pub created_at: NaiveDateTime,
pub updated_at: NaiveDateTime,
pub processing_started_at: Option<NaiveDateTime>,
pub time_taken: Option<NaiveTime>,
pub is_blob_cleaned: Option<bool>,
pub number_of_basic_circuits: Option<i32>,
pub protocol_version: Option<i32>,
pub picked_by: Option<String>,
}

pub struct NodeWitnessGeneratorJobInfo {
pub id: u32,
pub l1_batch_number: L1BatchNumber,
pub circuit_id: u32,
pub depth: u32,
pub status: WitnessJobStatus,
pub attempts: u32,
pub aggregations_url: Option<String>,
pub processing_started_at: Option<NaiveDateTime>,
pub time_taken: Option<NaiveTime>,
pub error: Option<String>,
pub created_at: NaiveDateTime,
pub updated_at: NaiveDateTime,
pub number_of_dependent_jobs: Option<i32>,
pub protocol_version: Option<i32>,
pub picked_by: Option<String>,
}

pub struct SchedulerWitnessGeneratorJobInfo {
pub l1_batch_number: L1BatchNumber,
pub scheduler_partial_input_blob_url: String,
pub status: WitnessJobStatus,
pub processing_started_at: Option<NaiveDateTime>,
pub time_taken: Option<NaiveTime>,
pub error: Option<String>,
pub created_at: NaiveDateTime,
pub updated_at: NaiveDateTime,
pub attempts: u32,
pub protocol_version: Option<i32>,
pub picked_by: Option<String>,
}

#[derive(Debug, EnumString, Display)]
pub enum ProofCompressionJobStatus {
#[strum(serialize = "queued")]
Queued,
#[strum(serialize = "in_progress")]
InProgress,
#[strum(serialize = "successful")]
Successful,
#[strum(serialize = "failed")]
Failed,
#[strum(serialize = "sent_to_server")]
SentToServer,
#[strum(serialize = "skipped")]
Skipped,
}

pub struct ProofCompressionJobInfo {
pub l1_batch_number: L1BatchNumber,
pub attempts: u32,
pub status: ProofCompressionJobStatus,
pub fri_proof_blob_url: Option<String>,
pub l1_proof_blob_url: Option<String>,
pub error: Option<String>,
pub created_at: NaiveDateTime,
pub updated_at: NaiveDateTime,
pub processing_started_at: Option<NaiveDateTime>,
pub time_taken: Option<NaiveTime>,
pub picked_by: Option<String>,
}
1 change: 1 addition & 0 deletions prover/Cargo.lock

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

3 changes: 2 additions & 1 deletion prover/prover_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ categories.workspace = true
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
env_logger = "0.10"
log = "0.4"
colored = "2.1.0"
thiserror = "1.0.58"

sqlx = { workspace = true }
clap = { workspace = true, features = ["derive"] }
tracing.workspace = true
tracing-subscriber = { workspace = true, features = ["env-filter"] }
bincode.workspace = true
colored.workspace = true
hex.workspace = true
anyhow.workspace = true
zksync_config.workspace = true
Expand All @@ -34,3 +34,4 @@ prover_dal.workspace = true
zksync_eth_client.workspace = true
zksync_contracts.workspace = true
zksync_dal.workspace = true
strum.workspace = true
41 changes: 40 additions & 1 deletion prover/prover_cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,45 @@ Options:

## Status

### Status batch

Displays the proof status for a given batch or a set of batches.

Example:

```bash
$ zk f run --release -- status batch -n 1

== Batch 1 Status ==
> In Progress ⌛️

== Proving Stages ==
-- Aggregation Round 0 --
Basic Witness Generator: Done ✅
> Prover Jobs: In progress ⌛️

-- Aggregation Round 1 --
Leaf Witness Generator: In progress ⌛️
> Prover Jobs: Waiting for proofs ⏱️

-- Aggregation Round 2 --
Node Witness Generator: In progress ⌛️
> Prover Jobs: Waiting for proofs ⏱️

-- Aggregation Round 3 --
Recursion Tip: In progress ⌛️
> Prover Jobs: Waiting for proofs ⏱️

-- Aggregation Round 4 --
Scheduler: In progress ⌛️
> Prover Jobs: Waiting for proofs ⏱️

-- Compressor --
> Compressor job not found 🚫
```

## Status

### Status l1

Retrieve information about the state of the batches sent to L1 and compare the contract hashes in L1 with those stored
Expand Down Expand Up @@ -50,7 +89,7 @@ DB hash: 0x0000000000000000000000000000000000000000000000000000000000000000

## File-Info

Displays de information about a given file:
Displays the information about a given file:

```bash
cargo run -- file-info --file-path /zksync-era/prover/artifacts/proofs_fri/l1_batch_proof_1.bin
Expand Down
5 changes: 1 addition & 4 deletions prover/prover_cli/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use clap::{command, Parser, Subcommand};

use crate::{
commands::{self, get_file_info},
errors::CLIErrors,
};
use crate::commands::{self, get_file_info};

pub const VERSION_STRING: &str = env!("CARGO_PKG_VERSION");

Expand Down

0 comments on commit 73854f1

Please sign in to comment.