Skip to content

Commit

Permalink
Merge pull request #22 from BCWResearch/shanghai-2b
Browse files Browse the repository at this point in the history
fixed tx count, removed gas-per-tx
  • Loading branch information
daniel-bcw authored Aug 16, 2024
2 parents 24ac982 + 1b5adb4 commit 5ec5372
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
9 changes: 1 addition & 8 deletions zero_bin/coordinator/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ pub struct BenchmarkingStats {
pub proof_out_duration: Option<Duration>,
/// The gas used by the block we proved
pub gas_used: u64,
/// The gas used per transaction in the block in the original chain
pub gas_used_per_tx: Vec<u64>,
/// The cumulative gas used by the block we proved. None implies
/// not filled in, not 0.
pub cumulative_gas_used: Option<u64>,
Expand Down Expand Up @@ -103,7 +101,7 @@ 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),
Expand All @@ -120,11 +118,6 @@ impl BenchmarkingStats {
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::<Vec<String>>()
.join(";"),
)
}
}
Expand Down
1 change: 0 additions & 1 deletion zero_bin/coordinator/src/manyprover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ impl ManyProver {
agg_wait_duration: benchmark_block_proof.agg_wait_dur,
agg_duration: benchmark_block_proof.agg_dur,
gas_used: benchmark_block_proof.gas_used,
gas_used_per_tx: benchmark_block_proof.gas_used_per_tx.clone(),
txproof_duration: benchmark_block_proof.proof_dur,
start_time: benchmark_block_proof.start_time,
end_time: benchmark_block_proof.end_time,
Expand Down
13 changes: 4 additions & 9 deletions zero_bin/prover/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ pub struct BenchmarkedGeneratedBlockProof {
pub total_dur: Option<Duration>,
pub n_txs: u64,
pub gas_used: u64,
pub gas_used_per_tx: Vec<u64>,
pub difficulty: u64,
pub start_time: DateTime<Utc>,
pub end_time: DateTime<Utc>,
Expand Down Expand Up @@ -101,14 +100,11 @@ impl BlockProverInput {
batch_size,
)?;

let n_txs = block_generation_inputs.len();
let gas_used = u64::try_from(other_data.b_data.b_meta.block_gas_used).expect("Overflow");
let gas_used_per_tx = block_generation_inputs
let n_txs: u64 = block_generation_inputs
.iter()
.map(|tx| {
u64::try_from(tx.gas_used_after - tx.gas_used_before).expect("Overflow of gas")
})
.collect();
.map(|tx| tx.signed_txns.len() as u64)
.sum();
let gas_used = u64::try_from(other_data.b_data.b_meta.block_gas_used).expect("Overflow");
let difficulty = other_data.b_data.b_meta.block_difficulty;

let seg_ops = ops::SegmentProof {
Expand Down Expand Up @@ -203,7 +199,6 @@ impl BlockProverInput {
agg_dur: Some(agg_dur),
n_txs: n_txs as u64,
gas_used,
gas_used_per_tx,
difficulty: u64::try_from(difficulty).expect("Difficulty overflow"),
start_time,
end_time,
Expand Down

0 comments on commit 5ec5372

Please sign in to comment.