From f4eaef88b8a9a4b449173fd26bd87360076e0c54 Mon Sep 17 00:00:00 2001
From: Florent Tapponnier <160007691+Flotapponnier@users.noreply.github.com>
Date: Mon, 3 Aug 2026 17:28:34 +0200
Subject: [PATCH 1/2] fix: handle +Inf in CountLeaderboard and fmtValue for
no-exit custody benches
---
src/components/count-leaderboard.tsx | 13 +++++++++----
src/lib/format.ts | 1 +
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/components/count-leaderboard.tsx b/src/components/count-leaderboard.tsx
index 0888c716..11a8fadc 100644
--- a/src/components/count-leaderboard.tsx
+++ b/src/components/count-leaderboard.tsx
@@ -24,19 +24,23 @@ export function CountLeaderboard({
headerActions?: ReactNode;
}) {
const ranked = rankResults(benchmark.results, benchmark.higherIsBetter);
- const max = Math.max(...ranked.map((r) => r.ms.p50)) || 1;
+ // Exclude +Inf from max so finite bars render at meaningful widths
+ // instead of collapsing to 0% (Inf/Inf = NaN).
+ const finiteVals = ranked.map((r) => r.ms.p50).filter(Number.isFinite);
+ const max = Math.max(...finiteVals) || 1;
const colors = useMemo(() => buildProviderColors(benchmark.results), [benchmark.results]);
const [hoveredSlug, setHoveredSlug] = useState(null);
const validRanked = ranked.filter((r) => r.ms.p50 > 0);
const leader = validRanked[0];
const trailer = validRanked[validRanked.length - 1];
- const gapRatio =
+ const rawGap =
leader && trailer && leader.ms.p50 > 0
? benchmark.higherIsBetter
? leader.ms.p50 / trailer.ms.p50
: trailer.ms.p50 / leader.ms.p50
: 0;
+ const gapRatio = Number.isFinite(rawGap) ? rawGap : null;
// range: always ascending (best → worst). for lower-is-better leader is min,
// trailer is max; for higher-is-better flip them so low is still left.
const [rangeMin, rangeMax] = benchmark.higherIsBetter
@@ -75,7 +79,7 @@ export function CountLeaderboard({
/>
0 ? `${gapRatio.toFixed(1)}×` : "-"}
+ value={gapRatio != null && gapRatio > 0 ? `${gapRatio.toFixed(1)}×` : "-"}
hint="leader vs lowest"
/>
@@ -87,7 +91,8 @@ export function CountLeaderboard({
{ranked.map((r, i) => {
- const pct = (r.ms.p50 / max) * 100;
+ // +Inf venues get full-width bar (visually "worst"); finite bar otherwise.
+ const pct = Number.isFinite(r.ms.p50) ? (r.ms.p50 / max) * 100 : 100;
const color = colors.get(r.slug) ?? "var(--color-ink-soft)";
const hasFormula = Boolean(r.formula);
const isHovered = hoveredSlug === r.slug;
diff --git a/src/lib/format.ts b/src/lib/format.ts
index 5677c2f6..47d1b7dd 100644
--- a/src/lib/format.ts
+++ b/src/lib/format.ts
@@ -82,6 +82,7 @@ export function fmtUnit(value: number, unit: string) {
return `${value.toFixed(1)}x`;
}
if (unit === "count") {
+ if (!Number.isFinite(value)) return "∞";
// Sub-unit values are common when a "count" bench is measuring an
// error or gap that converges toward zero (e.g. gas-oracle prediction
// error in gwei — PublicNode feeHistory's p50 sits around 1e-9,
From d33836cc2987dda96951ed056f0baf3a315c7272 Mon Sep 17 00:00:00 2001
From: Florent Tapponnier <160007691+Flotapponnier@users.noreply.github.com>
Date: Mon, 3 Aug 2026 17:29:02 +0200
Subject: [PATCH 2/2] fix: emit +Inf for no-exit venues (CountLeaderboard now
handles it correctly)
---
.../permissions-scan/cmd/script/static.go | 23 +++++++++++++++++++
1 file changed, 23 insertions(+)
create mode 100644 harnesses/permissions-scan/cmd/script/static.go
diff --git a/harnesses/permissions-scan/cmd/script/static.go b/harnesses/permissions-scan/cmd/script/static.go
new file mode 100644
index 00000000..65cdb15d
--- /dev/null
+++ b/harnesses/permissions-scan/cmd/script/static.go
@@ -0,0 +1,23 @@
+package main
+
+import (
+ "fmt"
+ "math"
+)
+
+var staticHours = map[string]float64{
+ "lighter": 336, // 14-day Desert Mode from Ethereum priority queue (ZK self-exit)
+ "ostium": 720, // 3 × 30-day maxSettlementInterval (tryNewSettlement() public)
+ "gains": math.Inf(1), // oracle epochs required; no time-based override
+ "gmx": math.Inf(1), // keeper CONTROLLER role required; no user override
+ "vertex": math.Inf(1), // impl contracts unverified; slow-mode unconfirmed on-chain
+ "hyperliquid": math.Inf(1), // 2/3 validator co-sign; bridge EOA-upgradeable, no timelock
+ "aster": math.Inf(1), // 2/3 internal validators; no escape hatch documented
+}
+
+func emitStatic() {
+ for venue, hours := range staticHours {
+ worstCaseHoursGauge.WithLabelValues(venue).Set(hours)
+ }
+ fmt.Println("[STATIC] perp_exit_worst_case_hours emitted for all 7 venues")
+}