Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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 core/lib/basic_types/src/prover_dal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{
basic_fri_types::AggregationRound, protocol_version::ProtocolVersionId, L1BatchNumber,
};

#[derive(Debug, Clone)]
#[derive(Debug, Clone, Copy)]
pub struct FriProverJobMetadata {
pub id: u32,
pub block_number: L1BatchNumber,
Expand Down
29 changes: 29 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/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ structopt = "0.3.26"
strum = { version = "0.26" }
tempfile = "3"
tokio = "1"
tokio-util = "0.7.11"
toml_edit = "0.14.4"
tracing = "0.1"
tracing-subscriber = "0.3"
Expand Down
38 changes: 38 additions & 0 deletions prover/crates/bin/circuit_prover/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[package]
name = "zksync_circuit_prover"
version.workspace = true
edition.workspace = true
authors.workspace = true
homepage.workspace = true
repository.workspace = true
license.workspace = true
keywords.workspace = true
categories.workspace = true

[dependencies]
tokio = { workspace = true, features = ["macros", "time"] }
tokio-util.workspace = true
anyhow.workspace = true
async-trait.workspace = true
tracing.workspace = true
bincode.workspace = true
clap = { workspace = true, features = ["derive"] }

zksync_config.workspace = true
zksync_object_store.workspace = true
zksync_prover_dal.workspace = true
zksync_prover_fri_types.workspace = true
zksync_prover_fri_utils.workspace = true
zksync_queued_job_processor.workspace = true
zksync_types.workspace = true
zksync_prover_keystore = { workspace = true, features = ["gpu"] }
zksync_env_config.workspace = true
zksync_core_leftovers.workspace = true
zksync_utils.workspace = true

vise.workspace = true
shivini = { workspace = true, features = [
"circuit_definitions",
"zksync",
] }
zkevm_test_harness.workspace = true
39 changes: 39 additions & 0 deletions prover/crates/bin/circuit_prover/src/backoff.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
use std::{ops::Mul, time::Duration};

/// Backoff - convenience structure that takes care of backoff timings.
#[derive(Debug, Clone)]
pub struct Backoff {
base_delay: Duration,
current_delay: Duration,
max_delay: Duration,
}

impl Backoff {
/// The delay multiplication coefficient.
// Currently it's hardcoded, but could be provided in the constructor.
const DELAY_MULTIPLIER: u32 = 2;

/// Create a backoff with base_delay (first delay) and max_delay (maximum delay possible).
pub fn new(base_delay: Duration, max_delay: Duration) -> Self {
Backoff {
base_delay,
current_delay: base_delay,
max_delay,
}
}

/// Get current delay, handling future delays if needed
pub fn delay(&mut self) -> Duration {
let delay = self.current_delay;
self.current_delay = self
.current_delay
.mul(Self::DELAY_MULTIPLIER)
.min(self.max_delay);
delay
}

/// Reset the backoff time for to base delay
pub fn reset(&mut self) {
self.current_delay = self.base_delay;
}
}
Loading
Loading