Skip to content

Commit afe9e7c

Browse files
committed
add max block to process to run orchestrator
1 parent 87dee67 commit afe9e7c

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

crates/madara/src/commands/orchestrator.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,20 @@ fn populate_orchestrator_runner(
189189
ProverType::Stwo => panic!("Not supported yet"),
190190
};
191191

192-
let data = context! {
193-
PROVER_TYPE => prover,
194-
MADARA_ORCHESTRATOR_MAX_BLOCK_NO_TO_PROCESS => config.orchestrator. maximum_block_to_process
192+
let max_block_to_process = config.orchestrator.maximum_block_to_process.map_or_else(
193+
|| "".to_string(),
194+
|val| format!("--max-block-to-process {}", val.to_string()),
195+
);
196+
197+
let data = if max_block_to_process.is_empty() {
198+
context! {
199+
PROVER_TYPE => prover
200+
}
201+
} else {
202+
context! {
203+
PROVER_TYPE => prover,
204+
MADARA_ORCHESTRATOR_MAX_BLOCK_NO_TO_PROCESS => max_block_to_process
205+
}
195206
};
196207

197208
// Render the template

deps/orchestrator/run_orchestrator.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ sed -e "s/^MADARA_ORCHESTRATOR_GPS_VERIFIER_CONTRACT_ADDRESS=.*/MADARA_ORCHESTRA
2727
./orchestrator setup --aws --aws-s3 --aws-sqs --aws-sns --aws-event-bridge --event-bridge-type {{ EVENT_BRIDGE_TYPE | default("rule") }}
2828

2929
# Orchestrator run
30-
RUST_LOG=info ./orchestrator run --{{ PROVER_TYPE | default("sharp") }} --{{ AWS_ENABLED | default("aws") }} --{{ SETTLEMENT_NETWORK | default("settle-on-ethereum") }} --aws-s3 --aws-sqs --aws-sns --{{ DA_NETWORK | default("da-on-ethereum") }} --mongodb --min-block-to-process {{ LAST_BLOCK_NUMBER }} --max-block-to-process {{ MADARA_ORCHESTRATOR_MAX_BLOCK_NO_TO_PROCESS }}
30+
RUST_LOG=info ./orchestrator run --{{ PROVER_TYPE | default("sharp") }} --{{ AWS_ENABLED | default("aws") }} --{{ SETTLEMENT_NETWORK | default("settle-on-ethereum") }} --aws-s3 --aws-sqs --aws-sns --{{ DA_NETWORK | default("da-on-ethereum") }} --mongodb --min-block-to-process $LAST_BLOCK_NUMBER {{ MADARA_ORCHESTRATOR_MAX_BLOCK_NO_TO_PROCESS | default("") }}

0 commit comments

Comments
 (0)