Cleanup benchmarks

This commit is contained in:
Omar Abdulla
2025-10-30 03:53:14 +03:00
parent d2af7f6c2b
commit 2e58cdfa7f
7 changed files with 269 additions and 9 deletions
@@ -112,12 +112,23 @@ impl Watcher {
let all_transactions_submitted = all_transactions_submitted.clone();
let mut blocks_information_stream = self.blocks_stream;
async move {
while let Some(block) = blocks_information_stream.next().await {
while let Some(mut block) = blocks_information_stream.next().await {
// If the block number is equal to or less than the last block before the
// repetition then we ignore it and continue on to the next block.
if block.ethereum_block_information.block_number <= ignore_block_before {
continue;
}
{
let watch_for_transaction_hashes =
watch_for_transaction_hashes.read().await;
for tx_hash in block.ethereum_block_information.transaction_hashes.iter() {
let Some((step_path, _)) = watch_for_transaction_hashes.get(tx_hash)
else {
continue;
};
*block.tx_counts.entry(step_path.clone()).or_default() += 1
}
}
reporter
.report_block_mined_event(block.clone())
.expect("Can't fail");
@@ -189,7 +200,6 @@ pub enum WatcherEvent {
/// streaming the blocks.
ignore_block_before: BlockNumber,
},
/// Informs the watcher that a transaction was submitted and that the watcher should watch for a
/// transaction with this hash in the blocks that it watches.
SubmittedTransaction {
@@ -198,7 +208,6 @@ pub enum WatcherEvent {
/// The step path of the step that the transaction belongs to.
step_path: StepPath,
},
/// Informs the watcher that all of the transactions of this benchmark have been submitted and
/// that it can expect to receive no further transaction hashes and not even watch the channel
/// any longer.
@@ -540,6 +540,7 @@ impl EthereumNode for GethNode {
.to_vec(),
},
substrate_block_information: None,
tx_counts: Default::default(),
})
});
@@ -771,6 +771,7 @@ impl EthereumNode for LighthouseGethNode {
.to_vec(),
},
substrate_block_information: None,
tx_counts: Default::default(),
})
});
@@ -578,6 +578,7 @@ impl EthereumNode for SubstrateNode {
proof_size: block_proof_size,
max_proof_size,
}),
tx_counts: Default::default(),
})
}
});
@@ -210,6 +210,7 @@ impl ZombienetNode {
.with_args(vec![
("--pool-limit", u32::MAX.to_string().as_str()).into(),
("--pool-kbytes", u32::MAX.to_string().as_str()).into(),
("--dev-block-time", 12000u16.to_string().as_str()).into(),
])
})
})
@@ -599,6 +600,7 @@ impl EthereumNode for ZombienetNode {
proof_size: block_proof_size,
max_proof_size,
}),
tx_counts: Default::default(),
})
}
});
+6 -6
View File
@@ -412,8 +412,8 @@ impl ReportAggregator {
{
block_information.sort_by(|a, b| {
a.ethereum_block_information
.block_timestamp
.cmp(&b.ethereum_block_information.block_timestamp)
.block_number
.cmp(&b.ethereum_block_information.block_number)
});
// Computing the TPS.
@@ -466,7 +466,6 @@ impl ReportAggregator {
.filter_map(|block| block.ref_time_block_fullness_percentage())
.map(|v| v as u64)
.collect::<Vec<_>>();
dbg!(&reftime_block_fullness);
if !reftime_block_fullness.is_empty() {
report
.metrics
@@ -482,7 +481,6 @@ impl ReportAggregator {
.filter_map(|block| block.proof_size_block_fullness_percentage())
.map(|v| v as u64)
.collect::<Vec<_>>();
dbg!(&proof_size_block_fullness);
if !proof_size_block_fullness.is_empty() {
report
.metrics
@@ -803,8 +801,9 @@ where
pub fn with_list(
&mut self,
platform_identifier: PlatformIdentifier,
mut list: Vec<T>,
original_list: Vec<T>,
) -> &mut Self {
let mut list = original_list.clone();
list.sort();
let Some(min) = list.first().copied() else {
return self;
@@ -842,7 +841,7 @@ where
.insert(platform_identifier, median);
self.raw
.get_or_insert_default()
.insert(platform_identifier, list);
.insert(platform_identifier, original_list);
self
}
@@ -883,6 +882,7 @@ pub struct ContractInformation {
pub struct MinedBlockInformation {
pub ethereum_block_information: EthereumMinedBlockInformation,
pub substrate_block_information: Option<SubstrateMinedBlockInformation>,
pub tx_counts: BTreeMap<StepPath, usize>,
}
impl MinedBlockInformation {