Skip to content

Commit

Permalink
feat(Prover CLI): status batch --verbose (#1899)
Browse files Browse the repository at this point in the history
This pull request introduces a new flag, verbose, to the status batch
command. Retrieves detailed information about the prover jobs for each
aggregation round, and circuit for a specific batch number.

To run the command:

```bash
zk f cargo run -- status batch -n [1..] --verbose
```

This command accepts any number of L1 batch numbers.

Example output:

```
$ cargo run --release -- status batch -n 1 --verbose

== Batch 1 Status ==

-- Aggregation Round 0 --
> Basic Witness Generator: Successful ✅
v Prover Jobs: In Progress ⌛️
   > VM: Successful ✅
   > DecommitmentsFilter: Successful ✅
   > Decommiter: Successful ✅
   > LogDemultiplexer: Successful ✅
   > KeccakPrecompile: In Progress ⌛️
     - Total jobs: 60
     - Successful: 4
     - In Progress: 1
     - Queued: 55
     - Failed: 0
   > RamValidation: Successful ✅
   > StorageFilter: Queued 📥
   > StorageApplicator: Successful ✅
   > EventsRevertsFilter: Queued 📥
   > L1MessagesRevertsFilter: Queued 📥
   > L1MessagesHasher: Queued 📥
   > EIP4844Repack: Queued 📥

-- Aggregation Round 1 --
v Leaf Witness Generator: In Progress ⌛️
   > VM: Successful ✅
   > DecommitmentsFilter: Successful ✅
   > Decommiter: Successful ✅
   > LogDemultiplexer: Successful ✅
   > KeccakPrecompile: Waiting for Proof ⏱️
   > RamValidation: Successful ✅
   > StorageFilter: Waiting for Proof ⏱️
   > StorageApplicator: Successful ✅
   > EventsRevertsFilter: Waiting for Proof ⏱️
   > L1MessagesRevertsFilter: Waiting for Proof ⏱️
   > L1MessagesHasher: Waiting for Proof ⏱️
   > EIP4844Repack: Waiting for Proof ⏱️
> Prover Jobs: Successful ✅

-- Aggregation Round 2 --
v Node Witness Generator: In Progress ⌛️
   > VM: Successful ✅
   > DecommitmentsFilter: Successful ✅
   > Decommiter: Successful ✅
   > LogDemultiplexer: Successful ✅
   > KeccakPrecompile: Waiting for Proof ⏱️
   > RamValidation: Successful ✅
   > StorageFilter: Waiting for Proof ⏱️
   > StorageApplicator: Successful ✅
   > EventsRevertsFilter: Waiting for Proof ⏱️
   > L1MessagesRevertsFilter: Waiting for Proof ⏱️
   > L1MessagesHasher: Waiting for Proof ⏱️
   > EIP4844Repack: Waiting for Proof ⏱️
> Prover Jobs: Successful ✅

-- Aggregation Round 3 --
 > Recursion Tip: Waiting for Proof ⏱️

-- Aggregation Round 4 --
 > Scheduler: Waiting for Proof ⏱️

-- Compression --
 > Compressor: Jobs not found 🚫
```

## 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).
- [ ] Tests for the changes have been added / updated.
- [ ] 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`.

---------

Co-authored-by: Joaquin Carletti <[email protected]>
Co-authored-by: Ivan Litteri <[email protected]>
Co-authored-by: Ivan Litteri <[email protected]>
Co-authored-by: ilitteri <[email protected]>
  • Loading branch information
5 people authored May 15, 2024
1 parent 28d715c commit cf80184
Show file tree
Hide file tree
Showing 10 changed files with 614 additions and 327 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions core/lib/basic_types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ serde_json.workspace = true
chrono.workspace = true
strum = { workspace = true, features = ["derive"] }
num_enum.workspace = true
sqlx = { workspace = true, feature= ["derive"]}
anyhow.workspace = true
url = { workspace = true, features = ["serde"] }

Expand Down
43 changes: 38 additions & 5 deletions core/lib/basic_types/src/prover_dal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ pub struct JobPosition {
pub sequence_number: usize,
}

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

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

#[derive(Debug, Default, PartialEq)]
#[derive(Debug, Default, PartialEq, Clone)]
pub struct ProverJobStatusInProgress {
pub started_at: DateTime<Utc>,
}
Expand All @@ -146,7 +146,7 @@ pub struct WitnessJobStatusFailed {
pub error: String,
}

#[derive(Debug, strum::Display, strum::EnumString, strum::AsRefStr, PartialEq)]
#[derive(Debug, strum::Display, strum::EnumString, strum::AsRefStr, PartialEq, Clone)]
pub enum ProverJobStatus {
#[strum(serialize = "queued")]
Queued,
Expand Down Expand Up @@ -238,6 +238,7 @@ impl FromStr for GpuProverInstanceStatus {
}
}

#[derive(Debug, Clone)]
pub struct ProverJobFriInfo {
pub id: u32,
pub l1_batch_number: L1BatchNumber,
Expand All @@ -260,6 +261,7 @@ pub struct ProverJobFriInfo {
pub picked_by: Option<String>,
}

#[derive(Debug, Clone)]
pub struct BasicWitnessGeneratorJobInfo {
pub l1_batch_number: L1BatchNumber,
pub merkle_tree_paths_blob_url: Option<String>,
Expand All @@ -276,6 +278,7 @@ pub struct BasicWitnessGeneratorJobInfo {
pub eip_4844_blobs: Option<Eip4844Blobs>,
}

#[derive(Debug, Clone)]
pub struct LeafWitnessGeneratorJobInfo {
pub id: u32,
pub l1_batch_number: L1BatchNumber,
Expand All @@ -294,6 +297,7 @@ pub struct LeafWitnessGeneratorJobInfo {
pub picked_by: Option<String>,
}

#[derive(Debug, Clone)]
pub struct NodeWitnessGeneratorJobInfo {
pub id: u32,
pub l1_batch_number: L1BatchNumber,
Expand All @@ -312,6 +316,22 @@ pub struct NodeWitnessGeneratorJobInfo {
pub picked_by: Option<String>,
}

#[derive(Debug, Clone)]
pub struct RecursionTipWitnessGeneratorJobInfo {
pub l1_batch_number: L1BatchNumber,
pub status: WitnessJobStatus,
pub attempts: u32,
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_final_node_jobs: Option<i32>,
pub protocol_version: Option<i32>,
pub picked_by: Option<String>,
}

#[derive(Debug, Clone)]
pub struct SchedulerWitnessGeneratorJobInfo {
pub l1_batch_number: L1BatchNumber,
pub scheduler_partial_input_blob_url: String,
Expand All @@ -326,7 +346,7 @@ pub struct SchedulerWitnessGeneratorJobInfo {
pub picked_by: Option<String>,
}

#[derive(Debug, EnumString, Display)]
#[derive(Debug, EnumString, Display, Clone)]
pub enum ProofCompressionJobStatus {
#[strum(serialize = "queued")]
Queued,
Expand All @@ -342,6 +362,7 @@ pub enum ProofCompressionJobStatus {
Skipped,
}

#[derive(Debug, Clone)]
pub struct ProofCompressionJobInfo {
pub l1_batch_number: L1BatchNumber,
pub attempts: u32,
Expand All @@ -355,3 +376,15 @@ pub struct ProofCompressionJobInfo {
pub time_taken: Option<NaiveTime>,
pub picked_by: Option<String>,
}

// This function corrects circuit IDs for the node witness generator.
//
// - Circuit IDs in the node witness generator are 2 higher than in other rounds.
// - The `EIP4844Repack` circuit (ID 255) is an exception and is set to 18.
pub fn correct_circuit_id(circuit_id: i16, aggregation_round: AggregationRound) -> u32 {
match (circuit_id, aggregation_round) {
(18, AggregationRound::NodeAggregation) => 255,
(circuit_id, AggregationRound::NodeAggregation) => (circuit_id as u32) - 2,
_ => circuit_id as u32,
}
}
2 changes: 2 additions & 0 deletions prover/Cargo.lock

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

1 change: 1 addition & 0 deletions prover/prover_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ zksync_dal.workspace = true
strum.workspace = true
colored.workspace = true
sqlx.workspace = true
circuit_definitions.workspace = true
Loading

0 comments on commit cf80184

Please sign in to comment.