From 43e5cb6ff8c652747cc43da5424d69d4ea954517 Mon Sep 17 00:00:00 2001 From: Julian Braha <103399117+julian-bcw@users.noreply.github.com> Date: Mon, 20 May 2024 13:21:49 +0100 Subject: [PATCH 01/16] Update Cargo.toml --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index cb62eebd..9d2ad1a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,3 +43,6 @@ opt-level = 3 incremental = true lto = "fat" codegen-units = 1 + +[build] +rustflags = ["-C", "target-cpu=native"] From 888e668a9efc03b43ad561fb16470e017031ff84 Mon Sep 17 00:00:00 2001 From: Patrick Juen Date: Tue, 21 May 2024 11:04:59 +0800 Subject: [PATCH 02/16] revert circuit sizes --- deploy/helm/zero-bin/values.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/deploy/helm/zero-bin/values.yaml b/deploy/helm/zero-bin/values.yaml index aaccdbf3..c571d1b1 100644 --- a/deploy/helm/zero-bin/values.yaml +++ b/deploy/helm/zero-bin/values.yaml @@ -39,13 +39,13 @@ hull: SERVER_ADDR: value: 0.0.0.0:8080 ARITHMETIC_CIRCUIT_SIZE: - value: 23..30 + value: 16..23 BYTE_PACKING_CIRCUIT_SIZE: value: 9..21 CPU_CIRCUIT_SIZE: - value: 17..30 + value: 12..25 KECCAK_CIRCUIT_SIZE: - value: 20..28 + value: 14..20 KECCAK_SPONGE_CIRCUIT_SIZE: value: 9..15 LOGIC_CIRCUIT_SIZE: @@ -113,13 +113,13 @@ hull: RUST_BACKTRACE: value: full ARITHMETIC_CIRCUIT_SIZE: - value: 23..30 + value: 16..23 BYTE_PACKING_CIRCUIT_SIZE: value: 9..21 CPU_CIRCUIT_SIZE: - value: 17..30 + value: 12..25 KECCAK_CIRCUIT_SIZE: - value: 20..28 + value: 14..20 KECCAK_SPONGE_CIRCUIT_SIZE: value: 9..15 LOGIC_CIRCUIT_SIZE: From 247d3d77ec103e827084764a8eb6ac0b34cfbd51 Mon Sep 17 00:00:00 2001 From: Patrick Juen Date: Tue, 21 May 2024 17:27:51 +0800 Subject: [PATCH 03/16] configure jobs to run on self hosted runners --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7fb99ca2..98a48889 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,7 +17,7 @@ env: jobs: build: name: Build docker images - runs-on: ubuntu-latest + runs-on: gha-runner-set permissions: contents: 'read' id-token: 'write' @@ -83,7 +83,7 @@ jobs: deploy: name: Deploy to GKE - runs-on: ubuntu-latest + runs-on: gha-runner-set needs: build permissions: contents: 'read' From 9bdf3d30b1272529f081f7d57224830b8cd8f34e Mon Sep 17 00:00:00 2001 From: StephenMal Date: Tue, 21 May 2024 22:05:49 -0400 Subject: [PATCH 04/16] Stop tracking coordinator/benchmark_out --- .gitignore | 4 ++++ coordinator/benchmark_out/test.csv | 4 ---- coordinator/benchmark_out/test2.csv | 12 ------------ coordinator/benchmark_out/testparallel.csv | 4 ---- coordinator/benchmark_out/testparallelgas.csv | 4 ---- coordinator/benchmark_out/testz.csv | 11 ----------- 6 files changed, 4 insertions(+), 35 deletions(-) delete mode 100644 coordinator/benchmark_out/test.csv delete mode 100644 coordinator/benchmark_out/test2.csv delete mode 100644 coordinator/benchmark_out/testparallel.csv delete mode 100644 coordinator/benchmark_out/testparallelgas.csv delete mode 100644 coordinator/benchmark_out/testz.csv diff --git a/.gitignore b/.gitignore index 42acc248..2b0d4923 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,7 @@ proofs/ # Serialized generated prover & verifier state used by plonky2 prover_state_* verifier_state_* + +# Coordinator output +coordinator/benchmark_out/ +coordinator/proof_out/ diff --git a/coordinator/benchmark_out/test.csv b/coordinator/benchmark_out/test.csv deleted file mode 100644 index f580a989..00000000 --- a/coordinator/benchmark_out/test.csv +++ /dev/null @@ -1,4 +0,0 @@ -block_number, number_txs, cumulative_number_txs, fetch_duration, proof_duration, start_time, end_time, overall_elapsed_time, proof_out_duration, gas_used, gas_used_per_tx, cumulative_gas_used, difficulty -19, 0, 0, 0.416245218, 39.113425192, 16-05-2024 01:46:20, 16-05-2024 01:46:59, 39, , 0, "", 0, 0 -20, 0, 0, 0.365843929, 39.78131432, 16-05-2024 01:46:59, 16-05-2024 01:47:39, 79, , 0, "", 0, 0 -21, 0, 0, 0.371192162, 40.249504184, 16-05-2024 01:47:39, 16-05-2024 01:48:20, 120, , 0, "", 0, 0 \ No newline at end of file diff --git a/coordinator/benchmark_out/test2.csv b/coordinator/benchmark_out/test2.csv deleted file mode 100644 index 4e13d5fa..00000000 --- a/coordinator/benchmark_out/test2.csv +++ /dev/null @@ -1,12 +0,0 @@ -block_number, number_txs, fetch_duration, proof_duration, gas_used, difficulty -10, 12, 0.270660939, 302.903039359, 252000, 0 -11, 12, 0.267672793, 301.158470093, 252000, 0 -12, 12, 0.310933291, 289.011095462, 252000, 0 -13, 12, 0.267179401, 287.964083265, 252000, 0 -14, 12, 0.313130734, 300.80843453, 252000, 0 -15, 12, 0.268713646, 299.767212942, 252000, 0 -16, 12, 0.312803298, 302.778635199, 252000, 0 -17, 12, 0.305608077, 307.162705639, 252000, 0 -18, 12, 0.387204276, 301.510345318, 252000, 0 -19, 12, 0.357288419, 306.084095495, 252000, 0 -20, 12, 0.368750955, 300.512840948, 252000, 0 \ No newline at end of file diff --git a/coordinator/benchmark_out/testparallel.csv b/coordinator/benchmark_out/testparallel.csv deleted file mode 100644 index b52d1a6d..00000000 --- a/coordinator/benchmark_out/testparallel.csv +++ /dev/null @@ -1,4 +0,0 @@ -block_number, number_txs, cumulative_number_txs, fetch_duration, proof_duration, start_time, end_time, overall_elapsed_time, proof_out_duration, gas_used, cumulative_gas_used, difficulty -7, 12, 12, 0.354999525, 602.796564585, 22-04-2024 22:11:38, 22-04-2024 22:21:40, , , 252000, 252000, 0 -8, 12, 24, 0.240492353, 605.2606692, 22-04-2024 22:11:38, 22-04-2024 22:21:43, , , 252000, 504000, 0 -9, 12, 36, 0.273154329, 299.283522421, 22-04-2024 22:21:41, 22-04-2024 22:26:40, , , 252000, 756000, 0 \ No newline at end of file diff --git a/coordinator/benchmark_out/testparallelgas.csv b/coordinator/benchmark_out/testparallelgas.csv deleted file mode 100644 index 502ea747..00000000 --- a/coordinator/benchmark_out/testparallelgas.csv +++ /dev/null @@ -1,4 +0,0 @@ -block_number, number_txs, cumulative_number_txs, fetch_duration, proof_duration, start_time, end_time, overall_elapsed_time, proof_out_duration, gas_used, cumulative_gas_used, difficulty -7, 12, 12, 0.327376841, 596.68060493, 22-04-2024 22:57:48, 22-04-2024 23:07:45, 597, , 252000, 252000, 0 -8, 12, 24, 0.242282669, 599.136444092, 22-04-2024 22:57:48, 22-04-2024 23:07:47, 599, , 252000, 504000, 0 -9, 12, 36, 0.250841678, 608.681361392, 22-04-2024 23:07:45, 22-04-2024 23:17:54, 1205, , 252000, 756000, 0 \ No newline at end of file diff --git a/coordinator/benchmark_out/testz.csv b/coordinator/benchmark_out/testz.csv deleted file mode 100644 index c9a08bd4..00000000 --- a/coordinator/benchmark_out/testz.csv +++ /dev/null @@ -1,11 +0,0 @@ -block_number, number_txs, fetch_duration, proof_duration, gas_used, difficulty -1, 0, 0.183798107, 39.44462568, 0, 0 -2, 0, 0.193665507, 36.858188481, 0, 0 -3, 0, 0.220206325, 36.757255408, 0, 0 -4, 0, 0.22509771, 36.602745608, 0, 0 -5, 0, 0.22041644, 36.727475638, 0, 0 -6, 2, 0.261391894, 47.012471306, 42000, 0 -7, 12, 0.257552474, 291.705178126, 252000, 0 -8, 12, 0.25249587, 326.47593614, 252000, 0 -9, 12, 0.256132939, 306.392647597, 252000, 0 -10, 12, 0.289759258, 300.279278174, 252000, 0 \ No newline at end of file From 968becd3ce6ab572faa1e348396730a8c61d0ca2 Mon Sep 17 00:00:00 2001 From: StephenMal Date: Tue, 21 May 2024 22:06:54 -0400 Subject: [PATCH 05/16] Commented out num workers from .env for in-memory, and made it so it uses zerobin default if missing from .env --- .env | 2 +- coordinator/src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 72b0ccf4..fd36fea0 100644 --- a/.env +++ b/.env @@ -11,7 +11,7 @@ MEMORY_CIRCUIT_SIZE=17..28 # Persistent-Leader specific PALADIN_SERIALIZER=POSTCARD # POSTCARD/CMOP (if not provided, uses value from `default` trait) PALADIN_RUNTIME=MEMORY # MEMORY/AMQP: -> DEFAULTS TO MEMORY -PALADIN_AMQP_NUM_WORKERS=1 # ONLY WHEN RUNTIME IS "MEMORY" +# PALADIN_AMQP_NUM_WORKERS=1 # ONLY WHEN RUNTIME IS "MEMORY" PSM_CIRCUIT_PERSISTENCE=NONE # NONE/DISK # SERVER_ADDR=0.0.0.0:8080 # Defaults to "0.0.0.0:8080" # PROOF_OUT_LOCAL_DIRPATH=proofs_out/ diff --git a/coordinator/src/main.rs b/coordinator/src/main.rs index fa6434db..e7bfc8a3 100644 --- a/coordinator/src/main.rs +++ b/coordinator/src/main.rs @@ -284,7 +284,7 @@ fn build_paladin_config_from_env() -> Config { "Number of workers not specified for InMemory runtime, using default: {}", DFLT_NUM_WORKERS ); - Some(DFLT_NUM_WORKERS) + None //Some(DFLT_NUM_WORKERS) } (paladin::config::Runtime::InMemory, Err(env::VarError::NotUnicode(os_str))) => { info!("Non-Unicode input for number of workers: {:?}", os_str); From dcd5cecc033b2533f8a4fce4287ebbf9a320f7a4 Mon Sep 17 00:00:00 2001 From: StephenMal Date: Tue, 21 May 2024 22:08:20 -0400 Subject: [PATCH 06/16] Separated timing into more specific times --- Cargo.toml | 3 ++ coordinator/README.md | 16 ++++++ coordinator/src/benchmarking.rs | 19 ++++--- coordinator/src/manyprover.rs | 26 +++++---- prover/src/lib.rs | 93 ++++++++++++++++++++++++++++++++- 5 files changed, 140 insertions(+), 17 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cb62eebd..a8919a9a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,3 +43,6 @@ opt-level = 3 incremental = true lto = "fat" codegen-units = 1 + +[build] +rustflags = ["-C", "target-cpu=native"] \ No newline at end of file diff --git a/coordinator/README.md b/coordinator/README.md index 2c7f8990..b76a29aa 100644 --- a/coordinator/README.md +++ b/coordinator/README.md @@ -119,6 +119,22 @@ The example below proves blocks [1,10] using the RPC function listed in ZeroBin, } ``` +```json +{ + "run_name": "run", + "start_block_number": 18, + "terminate_on": { + "EndBlock": {"block_number": 21} + }, + "block_source": { + "ZeroBinRpc": {"rpc_url": "http://35.208.84.178:8545/"} + }, + "benchmark_output": { + "LocalCsv": {"file_name": "test.csv"} + } +} +``` + An example not recording the proofs, and posting the results to a google cloud storage bucket. ```json diff --git a/coordinator/src/benchmarking.rs b/coordinator/src/benchmarking.rs index 3e60e963..4829e214 100644 --- a/coordinator/src/benchmarking.rs +++ b/coordinator/src/benchmarking.rs @@ -31,7 +31,11 @@ pub struct BenchmarkingStats { pub fetch_duration: Duration, /// The amount of time elapsed during the process of proving this block, /// stored as a [Duration] - pub proof_duration: Duration, + pub total_proof_duration: Duration, + + pub prep_duration: Option, + pub txproof_duration: Option, + pub agg_duration: Option, /// The start time of the proof. [BenchmarkingStats::proof_duration] is a /// more reliable value to use for the proof duration. Timestamps measured /// in UTC. @@ -61,7 +65,7 @@ impl BenchmarkingStats { /// Returns a header row pub fn header_row() -> String { String::from( - "block_number, number_txs, cumulative_number_txs, fetch_duration, proof_duration, start_time, end_time, overall_elapsed_time, proof_out_duration, gas_used, gas_used_per_tx, cumulative_gas_used, difficulty", + "block_number, number_txs, cumulative_number_txs, fetch_duration, total_proof_duration, prep_duration, txproof_duration, agg_duration, start_time, end_time, overall_elapsed_time, proof_out_duration, gas_used, cumulative_gas_used, difficulty, gas_used_per_tx", ) } @@ -98,24 +102,27 @@ impl BenchmarkingStats { #[allow(clippy::format_in_format_args)] pub fn as_csv_row(&self) -> String { format!( - "{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, \"{}\", {}, {}", + "{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, \"{}\"", self.block_number, self.n_txs, Self::unwrap_to_string(self.cumulative_n_txs), self.fetch_duration.as_secs_f64(), - self.proof_duration.as_secs_f64(), + self.total_proof_duration.as_secs_f64(), + Self::unwrap_duration_to_string(self.prep_duration), + Self::unwrap_duration_to_string(self.txproof_duration), + Self::unwrap_duration_to_string(self.agg_duration), self.start_time.format("%d-%m-%Y %H:%M:%S"), self.end_time.format("%d-%m-%Y %H:%M:%S"), Self::unwrap_to_string(self.overall_elapsed_seconds), Self::unwrap_duration_to_string(self.proof_out_duration), self.gas_used, + Self::unwrap_to_string(self.cumulative_gas_used), + self.difficulty, self.gas_used_per_tx .iter() .map(|gas| gas.to_string()) .collect::>() .join(";"), - Self::unwrap_to_string(self.cumulative_gas_used), - self.difficulty, ) } } diff --git a/coordinator/src/manyprover.rs b/coordinator/src/manyprover.rs index 15ca17e4..0e24efc8 100644 --- a/coordinator/src/manyprover.rs +++ b/coordinator/src/manyprover.rs @@ -308,20 +308,20 @@ impl ManyProver { info!("Starting to prove block {}", block_num); let proof_start_instance = Instant::now(); let proof_start_stamp: DateTime = SystemTime::now().into(); - let proof = match prover_input.prove(runtime.as_ref(), None, true).await { - Ok(proof) => proof, + let benchmarked_proof = match prover_input.prove_and_benchmark(runtime.as_ref(), None, true).await { + Ok(benchmarked_proof) => benchmarked_proof, Err(err) => { error!("Failed to generate block {}'s proof: {}", block_num, err); return Err(ManyProverError::Proof(err)); } }; - let proof_duration = proof_start_instance.elapsed(); + let total_proof_duration = proof_start_instance.elapsed(); let proof_end_stamp: DateTime = SystemTime::now().into(); info!( "Proved block {} in {} seconds", block_num, - proof_duration.as_secs_f64() + total_proof_duration.as_secs_f64() ); // Create the benchmarking statistics and return both. @@ -331,7 +331,10 @@ impl ManyProver { n_txs: n_txs as u64, cumulative_n_txs: None, fetch_duration, - proof_duration, + total_proof_duration, + prep_duration: benchmarked_proof.prep_dur, + txproof_duration: benchmarked_proof.proof_dur, + agg_duration: benchmarked_proof.agg_dur, start_time: proof_start_stamp, end_time: proof_end_stamp, overall_elapsed_seconds: None, @@ -341,7 +344,7 @@ impl ManyProver { cumulative_gas_used: None, difficulty, }, - proof, + proof: benchmarked_proof.proof, }) } @@ -762,7 +765,7 @@ impl ManyProver { let proof_start_instance = Instant::now(); // The stamp will signify the starting process of this proof. let proof_start_stamp: DateTime = SystemTime::now().into(); - let proof = match prover_input.prove(self.runtime.as_ref(), prev, true).await { + let benchmarked_proof = match prover_input.prove_and_benchmark(self.runtime.as_ref(), prev, true).await { Ok(proof) => proof, Err(err) => { error!( @@ -820,7 +823,7 @@ impl ManyProver { let proof_out_time: Option = match &self.proof_out { Some(proof_out) => { let proof_out_start = Instant::now(); - match proof_out.write(&proof) { + match proof_out.write(&benchmarked_proof.proof) { Ok(_) => { info!("Successfully wrote proof"); Some(proof_out_start.elapsed()) @@ -837,7 +840,7 @@ impl ManyProver { // If we need to keep the proof, save it in prev, otherwise do not. prev = match self.input_request.forward_prev { Some(false) | None => None, - Some(true) => Some(proof.intern), + Some(true) => Some(benchmarked_proof.proof.intern), }; //------------------------------------------------------------------------ @@ -852,7 +855,10 @@ impl ManyProver { n_txs, cumulative_n_txs: Some(cumulative_n_txs), fetch_duration, - proof_duration, + total_proof_duration: proof_duration, + prep_duration: benchmarked_proof.prep_dur, + txproof_duration: benchmarked_proof.proof_dur, + agg_duration: benchmarked_proof.agg_dur, start_time: proof_start_stamp, end_time: proof_end_stamp, overall_elapsed_seconds: Some( diff --git a/prover/src/lib.rs b/prover/src/lib.rs index 710a75ab..63e70444 100644 --- a/prover/src/lib.rs +++ b/prover/src/lib.rs @@ -1,3 +1,5 @@ +use std::time::{Duration, Instant}; + use anyhow::Result; use ethereum_types::U256; #[cfg(feature = "test_only")] @@ -14,7 +16,6 @@ use trace_decoder::{ trace_protocol::BlockTrace, types::{CodeHash, OtherBlockData}, }; -#[cfg(feature = "test_only")] use tracing::info; #[derive(Debug, Deserialize, Serialize)] @@ -26,11 +27,101 @@ fn resolve_code_hash_fn(_: &CodeHash) -> Vec { todo!() } +pub struct BenchmarkedGeneratedBlockProof { + pub proof: GeneratedBlockProof, + pub prep_dur: Option, + pub proof_dur: Option, + pub agg_dur: Option, +} + +impl From for GeneratedBlockProof { + fn from(value: BenchmarkedGeneratedBlockProof) -> Self { + value.proof + } +} + impl ProverInput { pub fn get_block_number(&self) -> U256 { self.other_data.b_data.b_meta.block_number } + #[cfg(not(feature = "test_only"))] + pub async fn prove_and_benchmark( + self, + runtime: &Runtime, + previous: Option, + save_inputs_on_error: bool, + ) -> Result { + let prep_start = Instant::now(); + + let block_number = self.get_block_number(); + let other_data = self.other_data; + let txs = self.block_trace.into_txn_proof_gen_ir( + &ProcessingMeta::new(resolve_code_hash_fn), + other_data.clone(), + )?; + + let prep_dur = prep_start.elapsed(); + + info!( + "Completed pre-proof work for block {} in {} secs", + block_number, + prep_dur.as_secs_f64() + ); + + let proof_start = Instant::now(); + let agg_proof = IndexedStream::from(txs) + .map(&TxProof { + save_inputs_on_error, + }) + .fold(&ops::AggProof { + save_inputs_on_error, + }) + .run(runtime) + .await?; + let proof_dur = proof_start.elapsed(); + + info!( + "Completed tx proofs for block {} in {} secs", + block_number, + proof_dur.as_secs_f64() + ); + + if let proof_gen::proof_types::AggregatableProof::Agg(proof) = agg_proof { + let agg_start = Instant::now(); + let prev = previous.map(|p| GeneratedBlockProof { + b_height: block_number.as_u64() - 1, + intern: p, + }); + + let block_proof = paladin::directive::Literal(proof) + .map(&ops::BlockProof { + prev, + save_inputs_on_error, + }) + .run(runtime) + .await?; + + let agg_dur = agg_start.elapsed(); + + info!( + "Completed tx proof agg for block {} in {} secs", + block_number, + agg_dur.as_secs_f64() + ); + + // Return the block proof + Ok(BenchmarkedGeneratedBlockProof { + proof: block_proof.0, + proof_dur: Some(proof_dur), + prep_dur: Some(prep_dur), + agg_dur: Some(agg_dur), + }) + } else { + anyhow::bail!("AggProof is is not GeneratedAggProof") + } + } + /// Evaluates a singular block #[cfg(not(feature = "test_only"))] pub async fn prove( From 117b115c4080b365cad2522c8c06abb306406f55 Mon Sep 17 00:00:00 2001 From: Stephen-BCW <142766175+Stephen-BCW@users.noreply.github.com> Date: Wed, 22 May 2024 01:08:39 -0400 Subject: [PATCH 07/16] Switched back to ubuntu-latest --- .github/workflows/deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 98a48889..b3bd677f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,7 +17,7 @@ env: jobs: build: name: Build docker images - runs-on: gha-runner-set + runs-on: ubuntu-latest #gha-runner-set permissions: contents: 'read' id-token: 'write' @@ -83,7 +83,7 @@ jobs: deploy: name: Deploy to GKE - runs-on: gha-runner-set + runs-on: ubuntu-latest #gha-runner-set needs: build permissions: contents: 'read' @@ -118,4 +118,4 @@ jobs: run: |- pwd && ls -lh cd ./deploy/helm - helm upgrade zero-bin ./zero-bin -f ./zero-bin/values.yaml --set hull.config.specific.version=sha-${GITHUB_SHA} -n zkevm --install \ No newline at end of file + helm upgrade zero-bin ./zero-bin -f ./zero-bin/values.yaml --set hull.config.specific.version=sha-${GITHUB_SHA} -n zkevm --install From e96b3aa8e28bfe52f64dfe2b8362614d929c3ecb Mon Sep 17 00:00:00 2001 From: Stephen-BCW <142766175+Stephen-BCW@users.noreply.github.com> Date: Wed, 22 May 2024 01:17:04 -0400 Subject: [PATCH 08/16] Undid changing to ubuntu-latest --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b3bd677f..4bc951b2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,7 +17,7 @@ env: jobs: build: name: Build docker images - runs-on: ubuntu-latest #gha-runner-set + runs-on: gha-runner-set permissions: contents: 'read' id-token: 'write' @@ -83,7 +83,7 @@ jobs: deploy: name: Deploy to GKE - runs-on: ubuntu-latest #gha-runner-set + runs-on: gha-runner-set needs: build permissions: contents: 'read' From 09aad71e2cad1265c907028521392c280743b55d Mon Sep 17 00:00:00 2001 From: Julian Braha <103399117+julian-bcw@users.noreply.github.com> Date: Wed, 22 May 2024 10:20:28 +0100 Subject: [PATCH 09/16] Undo native-cpu --- Cargo.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9d2ad1a0..cb62eebd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,6 +43,3 @@ opt-level = 3 incremental = true lto = "fat" codegen-units = 1 - -[build] -rustflags = ["-C", "target-cpu=native"] From d08a3119d17a7185654e113071b0869a62eb2ca9 Mon Sep 17 00:00:00 2001 From: Peter Romfeld Date: Wed, 22 May 2024 15:03:53 +0800 Subject: [PATCH 10/16] local env setup with `nix` --- .cargo/config.toml | 9 ++++++ .envrc.template | 4 +++ containers.nix | 63 ++++++++++++++++++++++++++++++++++++++++++ coordinator.Dockerfile | 9 +++--- deps.nix | 35 +++++++++++++++++++++++ leader.Dockerfile | 9 +++--- overlay.nix | 16 +++++++++++ pkgs.nix | 14 ++++++++++ shell.nix | 17 ++++++++++++ worker.Dockerfile | 9 +++--- 10 files changed, 170 insertions(+), 15 deletions(-) create mode 100644 .cargo/config.toml create mode 100644 .envrc.template create mode 100644 containers.nix create mode 100644 deps.nix create mode 100644 overlay.nix create mode 100644 pkgs.nix create mode 100644 shell.nix diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000..46829851 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,9 @@ +[build] +rustflags = [ + "-C", + "target-cpu=native", + + # FIXME: this is a workaround not a SOLUTION! + "-C", + "link-dead-code", +] diff --git a/.envrc.template b/.envrc.template new file mode 100644 index 00000000..aa54a6e0 --- /dev/null +++ b/.envrc.template @@ -0,0 +1,4 @@ +# shellcheck disable=SC2148 +watch_file {pkgs,deps,overlay}.nix +watch_file utils/tf.sh +use nix diff --git a/containers.nix b/containers.nix new file mode 100644 index 00000000..749e5626 --- /dev/null +++ b/containers.nix @@ -0,0 +1,63 @@ +with (import ./pkgs.nix); +let + ci-deps = pkgs.callPackage ./deps.nix { inherit pkgs; env = "ci"; }; + +in rec { + base = pkgs.dockerTools.buildLayeredImage { + name = "base"; + tag = "latest"; + + extraCommands = '' + mkdir -m 1777 tmp + mkdir -p usr/bin run bin lib64 + ln -s ${pkgs.coreutils}/bin/env usr/bin/env + + # github-actions + ln -s ${pkgs.glibc}/lib/ld-linux-x86-64.so.2 lib64/ld-linux-x86-64.so.2 + ''; + + contents = [ + pkgs.bash pkgs.coreutils pkgs.gnugrep + pkgs.jq + pkgs.curl + pkgs.cacert + + # github-actions + pkgs.gnutar pkgs.gzip + ]; + + config = { + Env = [ + "SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt" + "LC_ALL=C.UTF-8" "LANG=C.UTF-8" + + # github-actions + "LD_LIBRARY_PATH=${lib.makeLibraryPath [ pkgs.stdenv.cc.cc ]}" + ]; + }; + }; + + + ci-tools = pkgs.dockerTools.buildLayeredImage { + name = "ci-tools"; + tag = "latest"; + fromImage = base; + contents = ci-deps.packages; + + # we should be able to extend from base image, but no time for that right now + config = { + Env = [ + "SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt" + "LC_ALL=C.UTF-8" "LANG=C.UTF-8" + + "LD_LIBRARY_PATH=${lib.makeLibraryPath [ + pkgs.stdenv.cc.cc # github-actions + + pkgs.openssl + ## not sure if needed, maybe tests just dont cover them + pkgs.jemalloc pkgs.zstd pkgs.secp256k1 + ]}" + ]; + }; + }; +} diff --git a/coordinator.Dockerfile b/coordinator.Dockerfile index 2eaf2ed3..e695148a 100644 --- a/coordinator.Dockerfile +++ b/coordinator.Dockerfile @@ -1,4 +1,4 @@ -FROM rustlang/rust:nightly-bullseye-slim as builder +FROM rustlang/rust:nightly as builder # Install jemalloc RUN apt-get update && apt-get install -y libjemalloc2 libjemalloc-dev make libssl-dev pkg-config @@ -22,9 +22,8 @@ COPY prover/Cargo.toml ./prover/Cargo.toml COPY leader/Cargo.toml ./leader/Cargo.toml COPY coordinator/Cargo.toml ./coordinator/Cargo.toml -COPY ./rust-toolchain.toml ./ - -RUN cargo build --release --bin coordinator +COPY rust-toolchain.toml . +COPY .cargo ./.cargo COPY coordinator ./coordinator COPY ops ./ops @@ -41,7 +40,7 @@ RUN \ touch leader/src/main.rs && \ touch coordinator/src/main.rs -RUN cargo build --release --bin coordinator +RUN cargo build --release --bin coordinator FROM debian:bullseye-slim RUN apt-get update && apt-get install -y ca-certificates libjemalloc2 diff --git a/deps.nix b/deps.nix new file mode 100644 index 00000000..6db44df5 --- /dev/null +++ b/deps.nix @@ -0,0 +1,35 @@ +{ pkgs, lib, env ? "local"}: + +let + is_local = (env == "local"); + is_ci = (env == "ci"); + + + jq-to-table = (pkgs.writeScriptBin "jq-to-table" '' + ${pkgs.jq}/bin/jq -r '(map(keys) | add | unique) as $cols + | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] + | @csv' | ${pkgs.csvkit}/bin/csvlook + ''); + +in with pkgs; { + packages = [ + coreutils # GNU + diffutils + bash + ] ++ lib.optionals (is_local || is_ci) [ + rust-bin.nightly.latest.default + pkg-config + openssl + + ## seems to compile without these -sys deps, until i know better lets just have them + ## cargo tree | grep -i sys + jemalloc + zstd + secp256k1 + + gitleaks jq-to-table + trivy + ] ++ lib.optionals is_local [ + skopeo + ]; +} diff --git a/leader.Dockerfile b/leader.Dockerfile index 18b0a910..7a7ebe22 100644 --- a/leader.Dockerfile +++ b/leader.Dockerfile @@ -1,4 +1,4 @@ -FROM rustlang/rust:nightly-bullseye-slim as builder +FROM rustlang/rust:nightly as builder # Install jemalloc RUN apt-get update && apt-get install -y libjemalloc2 libjemalloc-dev make @@ -20,9 +20,8 @@ COPY rpc/Cargo.toml ./rpc/Cargo.toml COPY prover/Cargo.toml ./prover/Cargo.toml COPY leader/Cargo.toml ./leader/Cargo.toml -COPY ./rust-toolchain.toml ./ - -RUN cargo build --release --bin leader +COPY rust-toolchain.toml . +COPY .cargo ./.cargo COPY ops ./ops COPY common ./common @@ -36,7 +35,7 @@ RUN \ touch prover/src/lib.rs && \ touch leader/src/main.rs -RUN cargo build --release --bin leader +RUN cargo build --release --bin leader FROM debian:bullseye-slim RUN apt-get update && apt-get install -y ca-certificates libjemalloc2 diff --git a/overlay.nix b/overlay.nix new file mode 100644 index 00000000..7ba0494a --- /dev/null +++ b/overlay.nix @@ -0,0 +1,16 @@ +self: super: +{ + + # kubernetes = super.kubernetes.overrideAttrs (old: rec { + # version = "1.25.12"; + # name = "kubernetes-${version}"; + + # src = super.fetchFromGitHub { + # owner = "kubernetes"; + # repo = "kubernetes"; + # rev = "v${version}"; + # hash = "sha256-eGvTzBNFevHi3qgqzdURH6jGUeKjwJxYfzPu+tGa294="; + # }; + # }); + +} diff --git a/pkgs.nix b/pkgs.nix new file mode 100644 index 00000000..ee34685c --- /dev/null +++ b/pkgs.nix @@ -0,0 +1,14 @@ +let + rev = "8dee8bf3fd491cca2e6b541e17cd8bed4894dda6"; + sha = "1f02613346b8555qwypkr2jrx2vw18l3hfj3kr78rd0aff9sg3z3"; + +in (import (builtins.fetchTarball { + name = "nixpkgs-pinned-${rev}"; + url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz"; + sha256 = sha; + }) { + overlays = [ + (import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz")) + (import ./overlay.nix) + ]; +}) diff --git a/shell.nix b/shell.nix new file mode 100644 index 00000000..965ffc31 --- /dev/null +++ b/shell.nix @@ -0,0 +1,17 @@ +{ env ? "local" }: + +## import pinned package tree +with (import ./pkgs.nix); +let + deps = pkgs.callPackage ./deps.nix { inherit pkgs env; }; +in pkgs.mkShell { + buildInputs = deps.packages; + + # RUST_BACKTRACE = 1; + LD_LIBRARY_PATH = lib.makeLibraryPath [ + pkgs.openssl + + ## not sure if needed, maybe tests just dont cover them + pkgs.jemalloc pkgs.zstd pkgs.secp256k1 + ]; +} diff --git a/worker.Dockerfile b/worker.Dockerfile index ecf7ae91..9c1eb793 100644 --- a/worker.Dockerfile +++ b/worker.Dockerfile @@ -1,4 +1,4 @@ -FROM rustlang/rust:nightly-bullseye-slim as builder +FROM rustlang/rust:nightly as builder # Install jemalloc RUN apt-get update && apt-get install -y libjemalloc2 libjemalloc-dev make @@ -16,9 +16,8 @@ COPY common/Cargo.toml ./common/Cargo.toml COPY ops/Cargo.toml ./ops/Cargo.toml COPY worker/Cargo.toml ./worker/Cargo.toml -COPY ./rust-toolchain.toml ./ - -RUN cargo build --release --bin worker +COPY rust-toolchain.toml . +COPY .cargo ./.cargo COPY common ./common COPY ops ./ops @@ -28,7 +27,7 @@ RUN \ touch ops/src/lib.rs && \ touch worker/src/main.rs -RUN cargo build --release --bin worker +RUN cargo build --release --bin worker FROM debian:bullseye-slim RUN apt-get update && apt-get install -y ca-certificates libjemalloc2 From b40c683f5234c761cc7de9bcc76ad8c56d073b03 Mon Sep 17 00:00:00 2001 From: Peter Romfeld Date: Wed, 22 May 2024 20:16:46 +0800 Subject: [PATCH 11/16] pin nightly version --- deps.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deps.nix b/deps.nix index 6db44df5..5d270bd6 100644 --- a/deps.nix +++ b/deps.nix @@ -17,7 +17,8 @@ in with pkgs; { diffutils bash ] ++ lib.optionals (is_local || is_ci) [ - rust-bin.nightly.latest.default + # rust-bin.nightly.latest.default + rust-bin.nightly."2024-05-21".default pkg-config openssl From 102b310be36688a4cc3f2611a4052b587533d0db Mon Sep 17 00:00:00 2001 From: Peter Romfeld Date: Wed, 22 May 2024 20:47:07 +0800 Subject: [PATCH 12/16] remove unused watch_file --- .envrc.template | 1 - 1 file changed, 1 deletion(-) diff --git a/.envrc.template b/.envrc.template index aa54a6e0..6ec5cc87 100644 --- a/.envrc.template +++ b/.envrc.template @@ -1,4 +1,3 @@ # shellcheck disable=SC2148 watch_file {pkgs,deps,overlay}.nix -watch_file utils/tf.sh use nix From d2ef24d10e077af749bb8d17a4d7ec672afacfa3 Mon Sep 17 00:00:00 2001 From: Peter Romfeld Date: Thu, 23 May 2024 10:43:04 +0800 Subject: [PATCH 13/16] install unzip --- .github/workflows/deploy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4bc951b2..a1fdc31b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -107,6 +107,8 @@ jobs: cluster_name: 'immutable-prod' location: 'us-central1' + - name: Install zip + uses: montudor/action-zip@v1 - name: Install helm uses: azure/setup-helm@v4.1.0 with: From ca80833e06e96086d9910cee9580a93545a5a72d Mon Sep 17 00:00:00 2001 From: Peter Romfeld Date: Thu, 23 May 2024 10:55:48 +0800 Subject: [PATCH 14/16] update action instead --- .github/workflows/deploy.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a1fdc31b..b3b85707 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -107,10 +107,8 @@ jobs: cluster_name: 'immutable-prod' location: 'us-central1' - - name: Install zip - uses: montudor/action-zip@v1 - name: Install helm - uses: azure/setup-helm@v4.1.0 + uses: azure/setup-helm@v4.2.0 with: version: 3.14.3 id: install From dd5be95bf41196dea02b8eb35071dcade510b223 Mon Sep 17 00:00:00 2001 From: StephenMal Date: Thu, 23 May 2024 00:43:05 -0400 Subject: [PATCH 15/16] Revert back to older state --- .cargo/config.toml | 9 ------ .envrc.template | 3 -- .github/workflows/deploy.yml | 6 ++-- Cargo.toml | 4 +-- containers.nix | 63 ------------------------------------ coordinator.Dockerfile | 4 +-- deps.nix | 36 --------------------- leader.Dockerfile | 5 +-- overlay.nix | 16 --------- pkgs.nix | 14 -------- shell.nix | 17 ---------- worker.Dockerfile | 4 +-- 12 files changed, 12 insertions(+), 169 deletions(-) delete mode 100644 .cargo/config.toml delete mode 100644 .envrc.template delete mode 100644 containers.nix delete mode 100644 deps.nix delete mode 100644 overlay.nix delete mode 100644 pkgs.nix delete mode 100644 shell.nix diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index 46829851..00000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,9 +0,0 @@ -[build] -rustflags = [ - "-C", - "target-cpu=native", - - # FIXME: this is a workaround not a SOLUTION! - "-C", - "link-dead-code", -] diff --git a/.envrc.template b/.envrc.template deleted file mode 100644 index 6ec5cc87..00000000 --- a/.envrc.template +++ /dev/null @@ -1,3 +0,0 @@ -# shellcheck disable=SC2148 -watch_file {pkgs,deps,overlay}.nix -use nix diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 93d23d20..517fbfbe 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,7 +17,7 @@ env: jobs: build: name: Build docker images - runs-on: gha-runner-set + runs-on: ubuntu-latest permissions: contents: 'read' id-token: 'write' @@ -83,7 +83,7 @@ jobs: deploy: name: Deploy to GKE - runs-on: gha-runner-set + runs-on: ubuntu-latest needs: build permissions: contents: 'read' @@ -108,7 +108,7 @@ jobs: location: 'us-central1' - name: Install helm - uses: azure/setup-helm@v4.2.0 + uses: azure/setup-helm@v4.1.0 with: version: 3.14.3 id: install diff --git a/Cargo.toml b/Cargo.toml index a8919a9a..721a3775 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,5 +44,5 @@ incremental = true lto = "fat" codegen-units = 1 -[build] -rustflags = ["-C", "target-cpu=native"] \ No newline at end of file +# [build] +# rustflags = ["-C", "target-cpu=native"] \ No newline at end of file diff --git a/containers.nix b/containers.nix deleted file mode 100644 index 749e5626..00000000 --- a/containers.nix +++ /dev/null @@ -1,63 +0,0 @@ -with (import ./pkgs.nix); -let - ci-deps = pkgs.callPackage ./deps.nix { inherit pkgs; env = "ci"; }; - -in rec { - base = pkgs.dockerTools.buildLayeredImage { - name = "base"; - tag = "latest"; - - extraCommands = '' - mkdir -m 1777 tmp - mkdir -p usr/bin run bin lib64 - ln -s ${pkgs.coreutils}/bin/env usr/bin/env - - # github-actions - ln -s ${pkgs.glibc}/lib/ld-linux-x86-64.so.2 lib64/ld-linux-x86-64.so.2 - ''; - - contents = [ - pkgs.bash pkgs.coreutils pkgs.gnugrep - pkgs.jq - pkgs.curl - pkgs.cacert - - # github-actions - pkgs.gnutar pkgs.gzip - ]; - - config = { - Env = [ - "SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt" - "LC_ALL=C.UTF-8" "LANG=C.UTF-8" - - # github-actions - "LD_LIBRARY_PATH=${lib.makeLibraryPath [ pkgs.stdenv.cc.cc ]}" - ]; - }; - }; - - - ci-tools = pkgs.dockerTools.buildLayeredImage { - name = "ci-tools"; - tag = "latest"; - fromImage = base; - contents = ci-deps.packages; - - # we should be able to extend from base image, but no time for that right now - config = { - Env = [ - "SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt" - "LC_ALL=C.UTF-8" "LANG=C.UTF-8" - - "LD_LIBRARY_PATH=${lib.makeLibraryPath [ - pkgs.stdenv.cc.cc # github-actions - - pkgs.openssl - ## not sure if needed, maybe tests just dont cover them - pkgs.jemalloc pkgs.zstd pkgs.secp256k1 - ]}" - ]; - }; - }; -} diff --git a/coordinator.Dockerfile b/coordinator.Dockerfile index ecb010af..a8dd6b58 100644 --- a/coordinator.Dockerfile +++ b/coordinator.Dockerfile @@ -22,8 +22,8 @@ COPY prover/Cargo.toml ./prover/Cargo.toml COPY leader/Cargo.toml ./leader/Cargo.toml COPY coordinator/Cargo.toml ./coordinator/Cargo.toml -COPY rust-toolchain.toml . -COPY .cargo ./.cargo +COPY ./rust-toolchain.toml ./ +RUN cargo build --release --bin coordinator COPY coordinator ./coordinator COPY ops ./ops diff --git a/deps.nix b/deps.nix deleted file mode 100644 index 5d270bd6..00000000 --- a/deps.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ pkgs, lib, env ? "local"}: - -let - is_local = (env == "local"); - is_ci = (env == "ci"); - - - jq-to-table = (pkgs.writeScriptBin "jq-to-table" '' - ${pkgs.jq}/bin/jq -r '(map(keys) | add | unique) as $cols - | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] - | @csv' | ${pkgs.csvkit}/bin/csvlook - ''); - -in with pkgs; { - packages = [ - coreutils # GNU - diffutils - bash - ] ++ lib.optionals (is_local || is_ci) [ - # rust-bin.nightly.latest.default - rust-bin.nightly."2024-05-21".default - pkg-config - openssl - - ## seems to compile without these -sys deps, until i know better lets just have them - ## cargo tree | grep -i sys - jemalloc - zstd - secp256k1 - - gitleaks jq-to-table - trivy - ] ++ lib.optionals is_local [ - skopeo - ]; -} diff --git a/leader.Dockerfile b/leader.Dockerfile index bcbf0f0a..128671c2 100644 --- a/leader.Dockerfile +++ b/leader.Dockerfile @@ -20,8 +20,9 @@ COPY rpc/Cargo.toml ./rpc/Cargo.toml COPY prover/Cargo.toml ./prover/Cargo.toml COPY leader/Cargo.toml ./leader/Cargo.toml -COPY rust-toolchain.toml . -COPY .cargo ./.cargo +COPY ./rust-toolchain.toml ./ + +RUN cargo build --release --bin leader COPY ops ./ops COPY common ./common diff --git a/overlay.nix b/overlay.nix deleted file mode 100644 index 7ba0494a..00000000 --- a/overlay.nix +++ /dev/null @@ -1,16 +0,0 @@ -self: super: -{ - - # kubernetes = super.kubernetes.overrideAttrs (old: rec { - # version = "1.25.12"; - # name = "kubernetes-${version}"; - - # src = super.fetchFromGitHub { - # owner = "kubernetes"; - # repo = "kubernetes"; - # rev = "v${version}"; - # hash = "sha256-eGvTzBNFevHi3qgqzdURH6jGUeKjwJxYfzPu+tGa294="; - # }; - # }); - -} diff --git a/pkgs.nix b/pkgs.nix deleted file mode 100644 index ee34685c..00000000 --- a/pkgs.nix +++ /dev/null @@ -1,14 +0,0 @@ -let - rev = "8dee8bf3fd491cca2e6b541e17cd8bed4894dda6"; - sha = "1f02613346b8555qwypkr2jrx2vw18l3hfj3kr78rd0aff9sg3z3"; - -in (import (builtins.fetchTarball { - name = "nixpkgs-pinned-${rev}"; - url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz"; - sha256 = sha; - }) { - overlays = [ - (import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz")) - (import ./overlay.nix) - ]; -}) diff --git a/shell.nix b/shell.nix deleted file mode 100644 index 965ffc31..00000000 --- a/shell.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ env ? "local" }: - -## import pinned package tree -with (import ./pkgs.nix); -let - deps = pkgs.callPackage ./deps.nix { inherit pkgs env; }; -in pkgs.mkShell { - buildInputs = deps.packages; - - # RUST_BACKTRACE = 1; - LD_LIBRARY_PATH = lib.makeLibraryPath [ - pkgs.openssl - - ## not sure if needed, maybe tests just dont cover them - pkgs.jemalloc pkgs.zstd pkgs.secp256k1 - ]; -} diff --git a/worker.Dockerfile b/worker.Dockerfile index 3206059b..71d79b1a 100644 --- a/worker.Dockerfile +++ b/worker.Dockerfile @@ -16,8 +16,8 @@ COPY common/Cargo.toml ./common/Cargo.toml COPY ops/Cargo.toml ./ops/Cargo.toml COPY worker/Cargo.toml ./worker/Cargo.toml -COPY rust-toolchain.toml . -COPY .cargo ./.cargo +COPY ./rust-toolchain.toml ./ +RUN cargo build --release --bin worker COPY common ./common COPY ops ./ops From 5a1968a0364ed8f94a4f83e61c63bdf2570729af Mon Sep 17 00:00:00 2001 From: StephenMal Date: Thu, 23 May 2024 00:49:02 -0400 Subject: [PATCH 16/16] fixed formatting --- coordinator/src/manyprover.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/coordinator/src/manyprover.rs b/coordinator/src/manyprover.rs index 0e24efc8..614ca05a 100644 --- a/coordinator/src/manyprover.rs +++ b/coordinator/src/manyprover.rs @@ -308,7 +308,10 @@ impl ManyProver { info!("Starting to prove block {}", block_num); let proof_start_instance = Instant::now(); let proof_start_stamp: DateTime = SystemTime::now().into(); - let benchmarked_proof = match prover_input.prove_and_benchmark(runtime.as_ref(), None, true).await { + let benchmarked_proof = match prover_input + .prove_and_benchmark(runtime.as_ref(), None, true) + .await + { Ok(benchmarked_proof) => benchmarked_proof, Err(err) => { error!("Failed to generate block {}'s proof: {}", block_num, err); @@ -765,7 +768,10 @@ impl ManyProver { let proof_start_instance = Instant::now(); // The stamp will signify the starting process of this proof. let proof_start_stamp: DateTime = SystemTime::now().into(); - let benchmarked_proof = match prover_input.prove_and_benchmark(self.runtime.as_ref(), prev, true).await { + let benchmarked_proof = match prover_input + .prove_and_benchmark(self.runtime.as_ref(), prev, true) + .await + { Ok(proof) => proof, Err(err) => { error!(