diff --git a/core/bin/prover/src/lib.rs b/core/bin/prover/src/lib.rs index fc5d45d89d..1adeb7377f 100644 --- a/core/bin/prover/src/lib.rs +++ b/core/bin/prover/src/lib.rs @@ -232,5 +232,8 @@ pub async fn prover_work_cycle( first_block, last_block ); + if prover_options.prover.die_after_proof { + return; + } } } diff --git a/core/bin/prover/tests/tests.rs b/core/bin/prover/tests/tests.rs index 3bc77924fa..19d09e41ee 100644 --- a/core/bin/prover/tests/tests.rs +++ b/core/bin/prover/tests/tests.rs @@ -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, diff --git a/core/lib/config/src/configs/prover.rs b/core/lib/config/src/configs/prover.rs index 499eccff73..fe0643bd5c 100644 --- a/core/lib/config/src/configs/prover.rs +++ b/core/lib/config/src/configs/prover.rs @@ -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 { @@ -93,6 +95,7 @@ mod tests { heartbeat_interval: 1000, cycle_wait: 500, request_timeout: 10, + die_after_proof: false, }, core: Core { gone_timeout: 60000, @@ -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" diff --git a/etc/env/base/prover.toml b/etc/env/base/prover.toml index 202ac29ed9..b3036e1d20 100644 --- a/etc/env/base/prover.toml +++ b/etc/env/base/prover.toml @@ -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]