Skip to content
Open
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
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CI

on:
pull_request:
push:
branches: [main]
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.cache/biome
key: biome-${{ runner.os }}-${{ hashFiles('biome.json') }}
restore-keys: biome-${{ runner.os }}-
- uses: biomejs/setup-biome@v2
with:
version: 2.1.2
- run: biome ci --linter-enabled=true --formatter-enabled=true

typecheck:
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml
- run: pnpm install --frozen-lockfile
- run: pnpm typecheck

build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml
- run: pnpm install --frozen-lockfile
Comment on lines +43 to +57

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 next build runs without required env vars

frontend/config/env.ts exposes NEXT_PUBLIC_EVENTS_WS_URL via getEnvOrThrow, which throws if the variable is unset. While the getter is lazy and won't fire during the webpack compile pass itself, any page that calls publicEnv.EVENTS_WS_URL during server-side rendering or static generation will cause next build to throw and fail the job. Consider adding an env: block (using GitHub Actions secrets) or providing dummy values so the build job gives reliable signal rather than potentially failing for a config reason instead of a code reason.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/ci.yml
Line: 43-57

Comment:
**`next build` runs without required env vars**

`frontend/config/env.ts` exposes `NEXT_PUBLIC_EVENTS_WS_URL` via `getEnvOrThrow`, which throws if the variable is unset. While the getter is lazy and won't fire during the webpack compile pass itself, any page that calls `publicEnv.EVENTS_WS_URL` during server-side rendering or static generation will cause `next build` to throw and fail the job. Consider adding an `env:` block (using GitHub Actions secrets) or providing dummy values so the build job gives reliable signal rather than potentially failing for a config reason instead of a code reason.

How can I resolve this? If you propose a fix, please make it concise.

- run: pnpm build
Comment thread
kyscott18 marked this conversation as resolved.

rust:
runs-on: ubuntu-latest
# Match the backend Dockerfile's build image so bindgen sees a libclang
# new enough for the upstream C23 (`constexpr`) headers from monad-bft.
container: rust:1.91-slim
steps:
- name: Install build dependencies
run: |
apt-get update
apt-get install -y git curl gcc g++ cmake pkg-config libssl-dev libclang-dev libzstd-dev libhugetlbfs-dev
- uses: actions/checkout@v4
- run: rustup component add rustfmt clippy
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all --check
- run: cargo clippy --all-targets --all-features -- -D warnings
- run: cargo build --all-targets
24 changes: 0 additions & 24 deletions .github/workflows/lint.yml

This file was deleted.

22 changes: 22 additions & 0 deletions frontend/components/network-activity-tracker/tps-chart.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client'

import Image from 'next/image'
import { useEffect, useState } from 'react'
import { Area, AreaChart, CartesianGrid, XAxis, YAxis } from 'recharts'
import {
type ChartConfig,
Expand All @@ -21,11 +22,28 @@ const chartConfig = {
},
} satisfies ChartConfig

/** Visible time window, matching the TPS history kept by useTps */
const WINDOW_MS = 5 * 60 * 1000

export function TpsChart() {
const { currentTps, peakTps, history } = useTps()
const totalTransactions = useTotalTransactions()
const hasData = history.length > 0

// Advance a "now" clock every animation frame so the time-windowed X axis
// domain slides continuously. New points enter smoothly from the right edge
// instead of popping in a discrete category slot.
const [now, setNow] = useState(() => Date.now())
useEffect(() => {
let frame: number
const tick = () => {
setNow(Date.now())
frame = requestAnimationFrame(tick)
}
frame = requestAnimationFrame(tick)
return () => cancelAnimationFrame(frame)
}, [])

return (
<div className="flex flex-col h-full">
<div className="flex flex-col gap-3 pb-10 xs:flex-row xs:items-start xs:justify-between">
Expand Down Expand Up @@ -77,6 +95,10 @@ export function TpsChart() {
<CartesianGrid stroke="var(--chart-grid)" vertical={false} />
<XAxis
dataKey="timestamp"
type="number"
scale="time"
domain={[Math.max(now - WINDOW_MS, history[0].timestamp), now]}
allowDataOverflow
tickLine={false}
axisLine={false}
tickMargin={8}
Expand Down
3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint"
"lint": "eslint",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@number-flow/react": "0.5.10",
Expand Down
Loading
Loading