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
23 changes: 23 additions & 0 deletions harnesses/permissions-scan/cmd/script/static.go
Original file line number Diff line number Diff line change
@@ -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")
}
13 changes: 9 additions & 4 deletions src/components/count-leaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string | null>(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
Expand Down Expand Up @@ -75,7 +79,7 @@ export function CountLeaderboard({
/>
<CountStat
label="Gap"
value={gapRatio > 0 ? `${gapRatio.toFixed(1)}×` : "-"}
value={gapRatio != null && gapRatio > 0 ? `${gapRatio.toFixed(1)}×` : "-"}
hint="leader vs lowest"
/>
</dl>
Expand All @@ -87,7 +91,8 @@ export function CountLeaderboard({
</p>
<ol className="mt-4 space-y-3">
{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;
Expand Down
1 change: 1 addition & 0 deletions src/lib/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading