Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- added contender version to bottom of reports ([#452](https://github.com/flashbots/contender/pull/452/changes))
- enable custom data dir at runtime ([453](https://github.com/flashbots/contender/pull/453/changes))
- clean up html report UI, support batched `eth_sendRawTransaction` latency metrics ([#455](https://github.com/flashbots/contender/pull/455))

## [0.8.1](https://github.com/flashbots/contender/releases/tag/v0.8.1) - 2026-02-09

Expand Down
15 changes: 14 additions & 1 deletion crates/cli/src/default_scenarios/fill_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,20 @@ pub async fn fill_block(
block_gas_limit.unwrap_or(30_000_000)
};

let num_txs = txs_per_block.unwrap_or(txs_per_second.unwrap_or_default());
let num_txs = match (txs_per_block, txs_per_second) {
(Some(0), _) | (_, Some(0)) => {
return Err(CliError::Args(
crate::commands::error::ArgsError::SpamRateNotFound,
));
}
(Some(n), _) => n,
(_, Some(n)) => n,
(None, None) => {
return Err(CliError::Args(
crate::commands::error::ArgsError::SpamRateNotFound,
));
}
};
let gas_per_tx = gas_limit / num_txs;

info!("Attempting to fill blocks with {gas_limit} gas; sending {num_txs} txs, each with gas limit {gas_per_tx}.");
Expand Down
17 changes: 16 additions & 1 deletion crates/core/src/test_scenario.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,7 @@ where
})
.collect();

let hist = self.prometheus.hist.get();
tasks.push(tokio::task::spawn(async move {
// Build json-rpc batch payload with multiple eth_sendRawTransaction requests
let mut requests = Vec::with_capacity(signed_chunk.len());
Expand All @@ -1138,9 +1139,23 @@ where
}));
}

// === PROMETHEUS LATENCY METRICS ===
let mut timer = hist.as_ref().map(|h| {
h.with_label_values(&["eth_sendRawTransaction"])
.start_timer()
});

let resp = match http_client.post(rpc_url).json(&requests).send().await {
Ok(r) => r,
Ok(r) => {
if let Some(t) = timer.take() {
t.observe_duration()
}
r
}
Err(e) => {
if let Some(t) = timer.take() {
t.observe_duration()
}
warn!("failed to send JSON-RPC batch: {e:?}");
return;
}
Expand Down
1 change: 1 addition & 0 deletions crates/report/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- added contender version to bottom of reports ([#452](https://github.com/flashbots/contender/pull/452/changes))
- use `std::path::Path` instead of `str` where applicable ([453](https://github.com/flashbots/contender/pull/453/changes))
- clean up html report UI, support batched `eth_sendRawTransaction` latency metrics ([#455](https://github.com/flashbots/contender/pull/455/changes))

## [0.8.1](https://github.com/flashbots/contender/releases/tag/v0.8.1) - 2026-02-09

Expand Down
7 changes: 3 additions & 4 deletions crates/report/src/block_trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,11 @@ pub async fn get_block_traces(
) -> Result<Vec<TxTraceReceipt>> {
// get tx traces for all txs in all_blocks
let mut all_traces = vec![];
if full_blocks.is_empty() {
let total_txs: usize = full_blocks.iter().map(|b| b.transactions.len()).sum();
if full_blocks.is_empty() || total_txs == 0 {
return Ok(all_traces);
}
let (sender, mut receiver) = tokio::sync::mpsc::channel::<TxTraceReceipt>(
full_blocks.iter().map(|b| b.transactions.len()).sum(),
);
let (sender, mut receiver) = tokio::sync::mpsc::channel::<TxTraceReceipt>(total_txs);

for block in full_blocks {
let mut tx_tasks = vec![];
Expand Down
21 changes: 14 additions & 7 deletions crates/report/src/template.html.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,20 @@
.map(slot => `0x${slot.slice(0,4)}...${slot.slice(-4)}`);
const data = {{data.chart_data.heatmap.matrix}};

// Pre-compute total writes per slot (y-axis index)
const slotTotals = new Array(storageSlots.length).fill(0);
data.forEach(function(entry) {
slotTotals[entry[1]] += entry[2];
});

// Specify the configuration items and data for the chart
var option = {
tooltip: {
position: 'top'
position: 'top',
formatter: function(params) {
const slotIdx = params.value[1];
return `${storageSlots[slotIdx]}<br/>Block: ${blocks[params.value[0]]}<br/>Writes: ${params.value[2]}<br/>Total slot writes: ${slotTotals[slotIdx]}`;
}
},
grid: {
height: '70%',
Expand Down Expand Up @@ -380,10 +390,7 @@
type: 'heatmap',
data: data,
label: {
show: true,
formatter: function (params) {
return params.value[2] > 0 ? params.value[2] : '-';
}
show: false
},
emphasis: {
itemStyle: {
Expand Down Expand Up @@ -466,9 +473,9 @@
data: buckets,
nameGap: 2,
axisLabel: {
interval: 0,
interval: buckets.length > 20 ? Math.floor(buckets.length / 20) - 1 : 0,
rotate: 45
}
},
},
yAxis: {
type: 'value',
Expand Down
Loading