Skip to content

fix(explorer): reduce transaction detail latency - #1229

Merged
emmajam merged 2 commits into
mainfrom
codex/explorer-load-times
Sep 4, 2026
Merged

fix(explorer): reduce transaction detail latency#1229
emmajam merged 2 commits into
mainfrom
codex/explorer-load-times

Conversation

@snario

@snario snario commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • route server-side RPC reads through the low-latency Tempo proxy/direct RPCs, retaining the authenticated Tempo API as a bounded fallback
  • enable viem JSON-RPC batching and cache immutable receipt/transaction-derived data in Cloudflare Cache API
  • remove trace and balance-change queries from blocking transaction SSR and hydrate those panels client-side via cached explorer APIs

Root cause

Receipt and transaction detail routes synchronously fan out across several RPC calls during SSR. In production, the configured TEMPO_API_KEY made the higher-latency API passthrough the sole server transport, so its tail latency compounded across dependent request phases. Each SSR request also created a fresh query cache, so immutable transaction data was recomputed on every page load.

Cloudflare preview

Mainnet Worker preview

GitHub skipped the normal preview job because the PR author association is CONTRIBUTOR; this was uploaded manually with wrangler versions upload --env mainnet --preview-alias pr-1229. It is an isolated Worker version and receives no production traffic.

Edge benchmarks

Repeated requests include a unique query string to bypass page-level HTTP caching. TTFB includes network latency from the same client. The application cache keys intentionally ignore the query string.

Reported hash

0x003acd00bf113c046de81f1123e16767ee67731eb9b06a4dd154fa82f260d822

Route Production median Preview cold Preview warm median Warm improvement
Receipt 583ms 1.180s 71ms 8.2× faster
Transaction 7.622s 811ms 134ms 56.8× faster

The transaction response also shrank from about 784KB to 432KB by moving trace and balance-change payloads off the blocking SSR path.

Previously unseen hashes (cold path)

Three recent hashes per route, requested once from each deployment:

Route Production median Preview median Improvement
Receipt 916ms 639ms 30% faster
Transaction 1.063s 495ms 53% faster

The reported receipt's first preview request was approximately tied with production because both paid the upstream cold-path cost. Subsequent requests are served from Cloudflare's immutable-data cache.

Screenshots

No intended visual change; the balance-change panel now shows its existing skeleton state while deferred data loads. The deployed preview was browser-verified to hydrate the full balance updates and trace data with no console warnings or errors.

Before After
Production transaction Preview transaction

Verification

  • pnpm check
  • pnpm check:types
  • pnpm --filter explorer test --run (124 tests)
  • pnpm precommit
  • production build and Cloudflare Worker version upload
  • browser verification of deployed transaction details, balances, and trace

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Bundle Size Report

Metric Size Δ Change
Total 5.8 MB +1.6 MB (+38.1%)
Gzip 1.7 MB +509.0 KB (+40.8%)
Brotli 1.5 MB +441.7 KB (+40.7%)
Chunk changes (>1KB)
Chunk Change
assets/chains.js (removed) -360.7 KB
assets/tempo-queries.js -301.0 KB
assets/core.js (removed) -189.5 KB
assets/export-rate-limit.js (removed) -177.3 KB
assets/engine-javascript.js (removed) -92.9 KB
assets/decodeAbiParameters.js (removed) -71.7 KB
assets/_hash.js -48.2 KB
assets/AbiItem.js (removed) -27.1 KB
assets/sha2.js (removed) -14.7 KB
assets/queryOptions.js -11.8 KB
assets/Bytes.js -9.6 KB
assets/env.js -8.9 KB
assets/fee-amm-pool-rows.js (removed) -6.6 KB
assets/validators.js (removed) -5.1 KB
assets/wagmi.config.js -1.7 KB
assets/tokens.js -1.3 KB
assets/react.js -1.1 KB
assets/Value.js (removed) -1.0 KB
assets/TransactionCell.js (new) +1.1 KB
assets/jsx-runtime.js (new) +1.1 KB
...and 38 more

Compared against main branch (baseline from 4/27/2026, 4:02:54 PM)

@snario

snario commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Cloudflare deployment

App Environment Status Preview
explorer mainnet Deployed (isolated version) View Preview

Production traffic was not changed.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Bundle Size Report

Metric Size Δ Change
Total 5.8 MB +1.6 MB (+38.1%)
Gzip 1.7 MB +509.6 KB (+40.8%)
Brotli 1.5 MB +442.1 KB (+40.7%)
Chunk changes (>1KB)
Chunk Change
assets/chains.js (removed) -360.7 KB
assets/tempo-queries.js -301.0 KB
assets/core.js (removed) -189.5 KB
assets/export-rate-limit.js (removed) -177.3 KB
assets/engine-javascript.js (removed) -92.9 KB
assets/decodeAbiParameters.js (removed) -71.7 KB
assets/_hash.js -48.2 KB
assets/AbiItem.js (removed) -27.1 KB
assets/sha2.js (removed) -14.7 KB
assets/queryOptions.js -11.8 KB
assets/Bytes.js -9.6 KB
assets/env.js -8.9 KB
assets/fee-amm-pool-rows.js (removed) -6.6 KB
assets/validators.js (removed) -5.1 KB
assets/wagmi.config.js -1.7 KB
assets/tokens.js -1.3 KB
assets/react.js -1.1 KB
assets/Value.js (removed) -1.0 KB
assets/TransactionCell.js (new) +1.1 KB
assets/jsx-runtime.js (new) +1.1 KB
...and 38 more

Compared against main branch (baseline from 4/27/2026, 4:02:54 PM)

@emmajam
emmajam merged commit e75a2db into main Sep 4, 2026
8 checks passed
@emmajam
emmajam deleted the codex/explorer-load-times branch September 4, 2026 09:57
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.

2 participants