Skip to content

feat(tips): audit-events data layer + Basescan-style explorer - #55

Merged
montycheese merged 4 commits into
mainfrom
niran/transaction-events-query
Aug 13, 2026
Merged

feat(tips): audit-events data layer + Basescan-style explorer#55
montycheese merged 4 commits into
mainfrom
niran/transaction-events-query

Conversation

@montycheese

@montycheese montycheese commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Ports niran/transaction-events-query from tips-ui into omni-ui. omni-ui pulled in tips-ui earlier but this branch was never merged, so this brings the changes across — adapted to omni-ui's consolidated, multi-chain, viem-free TIPS surface. This is the transaction observability migration the earlier tips commits explicitly prepped for (S3 → audit events).

What changed

Data layer — audit-first, S3 fallback

  • audit-events.ts — audit events JSON-RPC client (base_getTransactionEventsByHash|ByBlockNumber|ByBlockHash|ByBundle, base_getRejectedTransactionEvents) + pure adapters mapping raw records onto the shared domain types. Chain-aware via the resolved TIPS_<CHAIN>_AUDIT_RPC_URL.
  • transaction-lookup.ts — canonical multi-source lookup: audit events + on-chain tx/receipt + legacy S3 archive, queried in parallel, merged, with per-source coverage. Dependency-injected for testability.
  • transaction-list.ts / block-list.ts — cursor-paginated explorer listings straight from the execution RPC.
  • receipts.ts + rpc.ts — batched receipt lookup and raw JSON-RPC helpers (omni-ui has no viem; the branch's viem usage was reimplemented on fetch).
  • transaction-data.ts — source-agnostic domain types; s3.ts re-exports them for back-compat.
  • Routes txn / block / bundle / rejected are now audit-first with S3 fallback; new /api/tips/txs; /api/tips/blocks is now cursor-paginated.
  • The block read-through cache (getBlockFromCache / cacheBlockData) is intentionally retained (per the earlier prep commits), unlike the tips-ui branch which removed it.

Explorer UI — reskinned to the Base design system, chain-aware links

  • /tips/blocks and /tips/txs paginated list pages + shared ExplorerTables.
  • /tips/txn/[hash] is now the canonical multi-source detail view (previously a redirect to the bundle page): on-chain status, simulation results, audit/archive timeline, and a data-provenance footer.
  • EventHistoryRow timeline component; the block page gains a base-fee stat + event history; bundle tx hashes link to the canonical txn page; dashboard search routes to /txn.

Config

  • Per-chain TIPS_<CHAIN>_AUDIT_RPC_URL (opt-in). When unset for a chain, the routes fall back to the S3 archive. Added to .env.example.

Notable adaptations vs. the source branch

  • Multi-chain: every data function takes a TipsChain and resolves per-chain env (config.ts), vs. the single-deployment tips-ui branch.
  • viem-free: list/lookup/receipt/bundle chain reads reimplemented as raw JSON-RPC.
  • Consolidated UI: reskinned into omni-ui's app/components/ui/* kit + bds-* tokens rather than tips-ui's standalone light-mode pages.
  • Types centralized in transaction-data.ts (branch used the same pattern).

Verification

  • npm run typecheck — clean
  • npm run lint — clean (only pre-existing warnings in unrelated files)
  • npm test — all passing, incl. 30+ ported tests (audit adapters, lookup, list/format helpers)
  • npm run build:internal — succeeds; all new routes compile (/tips/blocks, /tips/txs, /tips/txn/[hash], /api/tips/txs)
  • npm run docs:check — current (TIPS is internal-only, excluded from public docs)

TIPS remains gated to the internal build target (NEXT_PUBLIC_DEPLOY_TARGET=internal); the section stays fully absent from the public build.

Port niran/transaction-events-query from tips-ui, adapted to omni-ui's
consolidated, multi-chain, viem-free TIPS surface. This is the transaction
observability migration the earlier tips commits prepped for (S3 → audit).

Data layer (audit-first, S3 fallback):
- audit-events.ts: audit events JSON-RPC client (base_getTransactionEventsBy*)
  + adapters onto the shared transaction-data types; chain-aware via the
  resolved TIPS_<CHAIN>_AUDIT_RPC_URL.
- transaction-lookup.ts: canonical multi-source lookup (audit + on-chain
  tx/receipt + legacy S3 archive) with per-source coverage; DI-based.
- transaction-list.ts / block-list.ts: cursor-paginated explorer listings.
- receipts.ts + rpc.ts: batched receipts and raw JSON-RPC helpers (no viem).
- transaction-data.ts: source-agnostic domain types (s3.ts re-exports them).
- Routes txn/block/bundle/rejected are audit-first with S3 fallback; new
  /api/tips/txs; /api/tips/blocks is now cursor-paginated. The block
  read-through cache (getBlockFromCache/cacheBlockData) is intentionally kept.

Explorer UI (reskinned to the Base design system, chain-aware links):
- /tips/blocks and /tips/txs paginated list pages + shared ExplorerTables.
- /tips/txn/[hash] is now the canonical multi-source detail view (was a
  redirect): on-chain status, simulation, audit/archive timeline, provenance.
- EventHistoryRow timeline; block page gains base fee + event history; bundle
  tx hashes link to the canonical txn page; dashboard search routes to /txn.

Config: per-chain TIPS_<CHAIN>_AUDIT_RPC_URL (opt-in; absent → S3 fallback).
Tests: ported to vitest (audit adapters, lookup, list/format helpers).

Co-Authored-By: Claude <noreply@anthropic.com>
@cb-heimdall

cb-heimdall commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
omni-ui Ready Ready Preview Aug 13, 2026 5:15pm

Request Review

viem is already a dependency on main (used by the b20 demo and vibenet
explorer), so match it — and the source tips-ui branch — instead of hand-rolling
JSON-RPC for the execution-chain reads.

- viem.ts: memoized per-endpoint public client (publicClientFor(rpcUrl)),
  keeping the reads chain-aware via getRpcUrl(chain).
- transaction-lookup.ts: getTransaction/getTransactionReceipt via viem.
- transaction-list.ts: getBlockNumber/getBlock via viem.
- block/[hash] + bundle/[hash] routes: getBlock/getTransaction via viem.

block-list.ts and receipts.ts stay on raw JSON-RPC (rpc.ts) — that matches the
source branch, which also hand-rolled the latest-block walk and the batched
eth_getTransactionReceipt call. Wire shapes are unchanged, so the client/UI and
the response types are unaffected; typecheck, tests, and build:internal pass.

Co-Authored-By: Claude <noreply@anthropic.com>
Remove tips-ui "ported from" attributions and migration/history framing from
comments across the TIPS modules; keep only what a reader needs to understand
the code as it stands (chain-awareness, server-only boundaries, current
behavior). Comment-only change — no code, types, or behavior affected.

Co-Authored-By: Claude <noreply@anthropic.com>
@montycheese

Copy link
Copy Markdown
Contributor Author

Context for reviewers (kept out of the code comments)

A few design/porting notes that are useful for review but don't belong as long-lived source comments:

  • Origin. This is a port of niran/transaction-events-query from tips-ui, adapted to omni-ui's consolidated TIPS surface.
  • Multi-chain. tips-ui was one deployment per chain (chain baked into TIPS_UI_* env). Here one deployment serves all chains, so every data function takes a TipsChain and resolves per-chain TIPS_<CHAIN>_* env (config.ts), including the new TIPS_<CHAIN>_AUDIT_RPC_URL.
  • viem vs raw JSON-RPC. Execution-chain reads use viem (matches the b20/vibenet code already on main and the source branch). block-list.ts and receipts.ts intentionally stay on raw JSON-RPC (rpc.ts) — the source branch also hand-rolled the latest-block walk and the batched eth_getTransactionReceipt call, and there's no clean viem batch equivalent for arbitrary receipts.
  • S3 is the fallback source. Routes prefer the audit events RPC and fall back to S3 when audit isn't configured for a chain or returns nothing.
  • Block cache retained. getBlockFromCache / cacheBlockData (the app's read-through cache of RPC block data) is kept, matching the earlier prep commits — unlike the tips-ui branch, which removed the write path. The block route builds live from RPC, writes through to the cache, and falls back to it only when the RPC can't serve the block.
  • Types. Domain types are centralized in transaction-data.ts and re-exported from s3.ts.

Note: the last commit also de-attributes a few tips-ui references in files from the original import (MeteringCard.tsx, TipsExplorerLink.tsx, format.ts, config.ts) — happy to split those into a separate PR if you'd prefer to keep this one strictly feature-scoped.

@cb-heimdall

Copy link
Copy Markdown
Collaborator

Review Error for niran @ 2026-08-13 17:11:59 UTC
User failed mfa authentication, see go/mfa-help

@montycheese
montycheese merged commit 84c4da9 into main Aug 13, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants