Skip to content

Commit

Permalink
Merge pull request #1795 from matter-labs/deniallugo-drop-prover-afte…
Browse files Browse the repository at this point in the history
…r-finish-job

Die after proof
  • Loading branch information
popzxc authored Jul 27, 2021
2 parents 59a8899 + ff016c9 commit c35c155
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
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;
}
}
}
1 change: 1 addition & 0 deletions core/bin/prover/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ impl Default for MockProverConfigs {
heartbeat_interval: 1000,
cycle_wait: 500,
request_timeout: 1,
die_after_proof: false,
},
core: zksync_config::configs::prover::Core {
gone_timeout: 2,
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 c35c155

Please sign in to comment.