Skip to content

Commit 06afcf4

Browse files
dzhelezovclaude
andcommitted
chore(portal): wave-4 follow-up hygiene (FinalizedHead stubs, doc drift)
Promised in the PR #45 merge comment: - portal-realtime.test.ts: two bare-number `finalizedHead: async () => 673` stubs → object form `async () => ({ number: 673 })`. FinalizedHead is object-only since #45 (the bare-number variant was dropped); these two test-only stubs were the last holdouts. - pr-quality-gate/SKILL.md: drop `realtime.ts` from the source↔test pair list and `statediffs.json` from the fixture list — both deleted in #45. - harness/euler-multichain/probe.mjs: rewrite the stale header comment; the mirrored `portal/realtime.ts` module was deleted in #45. The comment now describes what the probe does with no dead cross-reference. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent e2185c8 commit 06afcf4

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

.agents/skills/pr-quality-gate/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ by `scripts/sync-upstream.sh`. Keep that in mind for Step 2.
2323
3. If tests are missing, **write them** (Step 3 conventions) before proceeding, or flag it explicitly
2424
in the PR body under a `## Missing tests` section.
2525

26-
The current source ↔ test pairs are `portal.ts`, `portal-transform.ts`, `realtime.ts`,
26+
The current source ↔ test pairs are `portal.ts`, `portal-transform.ts`,
2727
`portal-realtime.ts`, `portal-realtime-wire.ts` — each with a matching `*.test.ts`.
2828

2929
## Step 2: Run the Portal tests (they must be green)
@@ -59,8 +59,8 @@ fixtures. Match the existing style rather than inventing utilities:
5959
- **Mock the Portal per test:** stand up a local `http` server or pass a `fetchImpl` stub that replays
6060
canned batches (see `mockPortal(...)` in `portal-realtime-wire.test.ts`). Model realistic Portal
6161
responses — `204`/`409`/`503`, finalized-head advances, chunk boundaries.
62-
- **Fixtures** live in `portal/__fixtures__/*.json` (`receipts.json`, `statediffs.json`,
63-
`traces.json`), loaded with `readFileSync(join(__dirname, "__fixtures__"), ...)`.
62+
- **Fixtures** live in `portal/__fixtures__/*.json` (`receipts.json`, `traces.json`),
63+
loaded with `readFileSync(join(__dirname, "__fixtures__"), ...)`.
6464
- **Matchers:** `toBe` / `toEqual` for values, `toMatch` for hex-shape checks, `toMatchInlineSnapshot`
6565
for large structured output. Assert against the **RPC shape** the Portal transform must reproduce
6666
(hex normalization, accessList shape, receipt/status fields) — that byte-for-byte parity vs RPC is

harness/euler-multichain/probe.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env node
2-
// Endpoint health probe for the realtime soak — evaluates each endpoint's latency / tip-freshness /
3-
// responsiveness. Standalone (no imports beyond node) so it survives an overnight run alongside ponder.
4-
// Mirrors portal/realtime.ts (unit-tested). Writes PROBE_METRICS_FILE (rolling JSON) + a .log trail.
2+
// Endpoint health probe for the realtime soak — polls each configured endpoint and records its
3+
// latency, tip-freshness (how far behind chain head it reports), and responsiveness. Standalone (no
4+
// imports beyond node) so it survives an overnight run alongside ponder. Writes PROBE_METRICS_FILE
5+
// (rolling JSON) + a .log trail.
56
//
67
// REALTIME_RPC_KEY=... [SQD_RPC_KEY=...] [PROBE_INTERVAL_MS=15000] node probe.mjs
78
import fs from 'node:fs';

portal/portal-realtime.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ test('portalRealtimeEvents: a 1-block orphan at tip heals via 409 fork negotiati
438438
anchor,
439439
fetchImpl: mockForkFetch(conns, bodies, () => ac.abort()),
440440
signal: ac.signal,
441-
finalizedHead: async () => 673, // floor stays at the anchor; nothing new finalizes
441+
finalizedHead: async () => ({ number: 673 }), // floor stays at the anchor; nothing new finalizes
442442
finalizePollMs: 999999,
443443
})) {
444444
events.push(e);
@@ -884,7 +884,7 @@ test('portalRealtimeEvents: the unknown-parent gap fatal MESSAGE carries the win
884884
anchor,
885885
fetchImpl: mockFetch(batches, () => ac.abort()),
886886
signal: ac.signal,
887-
finalizedHead: async () => 673,
887+
finalizedHead: async () => ({ number: 673 }),
888888
finalizePollMs: 999999,
889889
});
890890
let msg = '';

0 commit comments

Comments
 (0)