Skip to content

Commit

Permalink
fix(prover): Remove prover-utils from core (matter-labs#819)
Browse files Browse the repository at this point in the history
Last batch of removing old prover from core.
Further improvements will follow up in the core <-> prover integration.
These will be tackled as part of prover <-> core separation.

## Checklist

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] 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 `cargo spellcheck
--cfg=./spellcheck/era.cfg --code 1`.
  • Loading branch information
EmilLuta authored Jan 5, 2024
1 parent ae6e18e commit 2ceb911
Show file tree
Hide file tree
Showing 37 changed files with 139 additions and 274 deletions.
41 changes: 0 additions & 41 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ members = [
"core/lib/state",
"core/lib/storage",
"core/lib/types",
"core/lib/prover_utils",
"core/lib/utils",
"core/lib/vlog",
"core/lib/multivm",
Expand Down
26 changes: 0 additions & 26 deletions core/lib/prover_utils/Cargo.toml

This file was deleted.

22 changes: 0 additions & 22 deletions core/lib/prover_utils/src/gcs_proof_fetcher.rs

This file was deleted.

126 changes: 0 additions & 126 deletions core/lib/prover_utils/src/lib.rs

This file was deleted.

1 change: 0 additions & 1 deletion core/lib/zksync_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ zksync_commitment_utils = { path = "../commitment_utils" }
zksync_eth_client = { path = "../eth_client" }
zksync_eth_signer = { path = "../eth_signer" }
zksync_mempool = { path = "../mempool" }
zksync_prover_utils = { path = "../prover_utils" }
zksync_queued_job_processor = { path = "../queued_job_processor" }
zksync_circuit_breaker = { path = "../circuit_breaker" }
zksync_storage = { path = "../storage" }
Expand Down
25 changes: 22 additions & 3 deletions core/lib/zksync_core/src/eth_sender/aggregator.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
use zksync_config::configs::eth_sender::{ProofLoadingMode, ProofSendingMode, SenderConfig};
use zksync_contracts::BaseSystemContractsHashes;
use zksync_dal::StorageProcessor;
use zksync_object_store::ObjectStore;
use zksync_prover_utils::gcs_proof_fetcher::load_wrapped_fri_proofs_for_range;
use zksync_object_store::{ObjectStore, ObjectStoreError};
use zksync_types::{
aggregated_operations::{
AggregatedActionType, AggregatedOperation, L1BatchCommitOperation, L1BatchExecuteOperation,
L1BatchProofOperation,
L1BatchProofForL1, L1BatchProofOperation,
},
commitment::L1BatchWithMetadata,
helpers::unix_timestamp_ms,
Expand Down Expand Up @@ -418,3 +417,23 @@ async fn extract_ready_subrange(
.collect(),
)
}

pub async fn load_wrapped_fri_proofs_for_range(
from: L1BatchNumber,
to: L1BatchNumber,
blob_store: &dyn ObjectStore,
) -> Vec<L1BatchProofForL1> {
let mut proofs = Vec::new();
for l1_batch_number in from.0..=to.0 {
let l1_batch_number = L1BatchNumber(l1_batch_number);
match blob_store.get(l1_batch_number).await {
Ok(proof) => proofs.push(proof),
Err(ObjectStoreError::KeyNotFound(_)) => (), // do nothing, proof is not ready yet
Err(err) => panic!(
"Failed to load proof for batch {}: {}",
l1_batch_number.0, err
),
}
}
proofs
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use async_trait::async_trait;
use zksync_dal::ConnectionPool;
use zksync_prover_utils::periodic_job::PeriodicJob;
use zksync_utils::time::seconds_since_epoch;

use crate::metrics::{BlockL1Stage, BlockStage, L1StageLatencyLabel, APP_METRICS};
use crate::{
house_keeper::periodic_job::PeriodicJob,
metrics::{BlockL1Stage, BlockStage, L1StageLatencyLabel, APP_METRICS},
};

#[derive(Debug)]
pub struct L1BatchMetricsReporter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ use std::time::Duration;

use async_trait::async_trait;
use zksync_dal::ConnectionPool;
use zksync_prover_utils::periodic_job::PeriodicJob;

use crate::house_keeper::periodic_job::PeriodicJob;

#[derive(Debug)]
pub struct FriProofCompressorJobRetryManager {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use async_trait::async_trait;
use zksync_dal::ConnectionPool;
use zksync_prover_utils::periodic_job::PeriodicJob;
use zksync_types::proofs::JobCountStatistics;

use crate::house_keeper::periodic_job::PeriodicJob;

const PROOF_COMPRESSOR_SERVICE_NAME: &str = "proof_compressor";

#[derive(Debug)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ use std::time::Duration;

use async_trait::async_trait;
use zksync_dal::ConnectionPool;
use zksync_prover_utils::periodic_job::PeriodicJob;

use crate::house_keeper::periodic_job::PeriodicJob;

#[derive(Debug)]
pub struct FriProverJobRetryManager {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use async_trait::async_trait;
use zksync_config::configs::fri_prover_group::FriProverGroupConfig;
use zksync_dal::ConnectionPool;
use zksync_prover_utils::periodic_job::PeriodicJob;

use crate::house_keeper::periodic_job::PeriodicJob;

#[derive(Debug)]
pub struct FriProverStatsReporter {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use async_trait::async_trait;
use zksync_dal::ConnectionPool;
use zksync_prover_utils::periodic_job::PeriodicJob;

use crate::house_keeper::periodic_job::PeriodicJob;

#[derive(Debug)]
pub struct SchedulerCircuitQueuer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ use std::time::Duration;

use async_trait::async_trait;
use zksync_dal::ConnectionPool;
use zksync_prover_utils::periodic_job::PeriodicJob;

use crate::house_keeper::periodic_job::PeriodicJob;

#[derive(Debug)]
pub struct FriWitnessGeneratorJobRetryManager {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ use std::collections::HashMap;

use async_trait::async_trait;
use zksync_dal::ConnectionPool;
use zksync_prover_utils::periodic_job::PeriodicJob;
use zksync_types::proofs::{AggregationRound, JobCountStatistics};

use crate::house_keeper::periodic_job::PeriodicJob;

const FRI_WITNESS_GENERATOR_SERVICE_NAME: &str = "fri_witness_generator";

#[derive(Debug)]
Expand Down
1 change: 1 addition & 0 deletions core/lib/zksync_core/src/house_keeper/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ pub mod fri_prover_queue_monitor;
pub mod fri_scheduler_circuit_queuer;
pub mod fri_witness_generator_jobs_retry_manager;
pub mod fri_witness_generator_queue_monitor;
pub mod periodic_job;
pub mod waiting_to_queued_fri_witness_job_mover;
Loading

0 comments on commit 2ceb911

Please sign in to comment.