Skip to content

Commit

Permalink
Die after proof
Browse files Browse the repository at this point in the history
Signed-off-by: deniallugo <[email protected]>
  • Loading branch information
Deniallugo committed Jul 27, 2021
1 parent 5441140 commit d9df9fe
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions core/bin/prover/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,5 +232,8 @@ pub async fn prover_work_cycle<PROVER, CLIENT>(
first_block,
last_block
);
if prover_options.prover.die_after_proof {
return;
}
}
}
2 changes: 1 addition & 1 deletion core/bin/zksync_core/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use zksync_storage::ConnectionPool;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let _sentry_guard = vlog::init();

// Handle ctrl+c.
let config = ZkSyncConfig::from_env();
let eth_gateway = EthereumGateway::from_config(&config);
Expand Down
4 changes: 4 additions & 0 deletions core/lib/config/src/configs/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ pub struct Prover {
pub cycle_wait: u64,
/// Timeout for the requests to the prover server in seconds.
pub request_timeout: u64,
/// Flag for dying after proving cycle
pub die_after_proof: bool,
}

impl Prover {
Expand Down Expand Up @@ -93,6 +95,7 @@ mod tests {
heartbeat_interval: 1000,
cycle_wait: 500,
request_timeout: 10,
die_after_proof: false,
},
core: Core {
gone_timeout: 60000,
Expand All @@ -111,6 +114,7 @@ mod tests {
PROVER_PROVER_HEARTBEAT_INTERVAL="1000"
PROVER_PROVER_CYCLE_WAIT="500"
PROVER_PROVER_REQUEST_TIMEOUT="10"
PROVER_PROVER_DIE_AFTER_PROOF=false
PROVER_CORE_GONE_TIMEOUT="60000"
PROVER_CORE_IDLE_PROVERS="1"
PROVER_WITNESS_GENERATOR_PREPARE_DATA_INTERVAL="500"
Expand Down
2 changes: 2 additions & 0 deletions etc/env/base/prover.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ heartbeat_interval=1000 # Milliseconds
cycle_wait=500 # Milliseconds
# Timeout for the requests to the prover server.
request_timeout=10 # Seconds
# Flag for dying after proving cycle
die_after_proof=false

# Core applications settings
[prover.core]
Expand Down

0 comments on commit d9df9fe

Please sign in to comment.