From 955f67cdef3155bd19cf7e6ab0435035346e0d99 Mon Sep 17 00:00:00 2001 From: Niran Babalola Date: Mon, 23 Mar 2026 23:41:24 -0500 Subject: [PATCH] Use per-tx execution time sum on bundle detail page Same fix as the block page: use sum of results[i].executionTimeUs instead of totalExecutionTimeUs, which on 0.6 includes setup, teardown, and state root overhead. --- src/app/bundles/[uuid]/page.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/bundles/[uuid]/page.tsx b/src/app/bundles/[uuid]/page.tsx index 47e32ed..43b40ed 100644 --- a/src/app/bundles/[uuid]/page.tsx +++ b/src/app/bundles/[uuid]/page.tsx @@ -307,7 +307,15 @@ function TransactionDetails({ } function SimulationCard({ meter }: { meter: MeterBundleResponse }) { - const totalTimeUs = meter.totalExecutionTimeUs + meter.stateRootTimeUs; + // TODO: Switch to meter.totalExecutionTimeUs once 0.7 is deployed. + // On 0.6, totalExecutionTimeUs is the wall-clock total_time_us which includes + // setup, teardown, and state root (double-counting stateRootTimeUs). PR #1111 + // fixes this on main to be the sum of per-tx execution times. + const executionTimeUs = meter.results.reduce( + (sum, r) => sum + r.executionTimeUs, + 0, + ); + const totalTimeUs = executionTimeUs + meter.stateRootTimeUs; return ( @@ -316,7 +324,7 @@ function SimulationCard({ meter }: { meter: MeterBundleResponse }) {
Execution
- {meter.totalExecutionTimeUs.toLocaleString()}μs + {executionTimeUs.toLocaleString()}μs