Skip to content

feat(network): add Zcash network dashboard - #407

Merged
MatiasOS merged 7 commits into
issue-398-zcash-corefrom
issue-398-zcash-dashboard
Nov 21, 2026
Merged

MatiasOS merged 7 commits into
issue-398-zcash-corefrom
issue-398-zcash-dashboard

Conversation

@MatiasOS

@MatiasOS MatiasOS commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Description

Adds the Zcash network dashboard at /zec and /tzec, and makes both networks visible across the app.

The dashboard is designed around the hosted gateway limit of about 5 requests per minute per IP:

  • Stats and the tip block load first, in 3 calls. Earlier block summaries then load one at a time.
  • Block summaries are cached across refreshes, so each 90s refresh usually costs 3–4 calls.
  • The navbar block indicator polls Zcash every 90s. Without this it would use the 12s EVM default, which alone is about 5 calls a minute.

Related Issue

Part of #398. Stacked on #406.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Performance improvement
  • Other (please describe):

Changes Made

  • src/config/networks.json: zec and tzec entries, taken from explorer-metadata with slugs added.
  • /zec and /tzec routes, with a lazy-loaded page.
  • useZcashDashboard plus the dashboard components:
    • Stats: height, difficulty, mempool, and chain supply with the shielded share.
    • A value pools bar covering Transparent, Sprout, Sapling, Orchard, Lockbox and Ironwood.
    • Latest blocks.
    • Latest transactions, with a badge for each transaction's kind.
  • i18n:
    • A new zcash namespace and a tooltips.zcash section in all 5 locales.
    • Relative times are localized, instead of reusing the English-only Bitcoin formatter.
  • NetworkBlockIndicator: a Zcash branch with a 90s poll.
  • useRpcLatencyTest: Zcash endpoints are tested with getblockcount.
  • README.md and .claude/rules/commands.md: list the Zcash networks and slugs.
  • A hermetic e2e spec at e2e/tests/shared/mocked/zcash-dashboard.spec.ts, with RPC traffic served from mainnet block 3,483,400.

Screenshots (if applicable)

Checked locally against mocked RPC data in dark, light and 400px-wide layouts.

Checklist

  • I have run npm run format:fix and npm run lint:fix
  • I have run npm run typecheck with no errors
  • I have run tests with npm run test:run
  • I have tested my changes locally
  • I have updated documentation if needed
  • My code follows the project's architecture patterns

Additional Notes

  • METADATA_VERSION isn't bumped yet. The explorer-metadata publish of @openscan/metadata 1.3.0-alpha.0 failed, because npm requires --tag for prereleases. Until it's published:
  • The dashboard links to the blocks, block, txs and tx pages. Those pages arrive in the next PRs of the stack.
  • The navbar mempool link will ship with the mempool page.
  • Tests (before the review follow-up):
    • npm run test:run: 150 passing.
    • npx playwright test --project=mocked e2e/tests/shared/mocked/zcash-dashboard.spec.ts: 2 passing.

Review follow-up

  • One getblockchaininfo for the navbar and the dashboard. The navbar's height poll used getblockcount while the dashboard fetched the same height; both now share one response for 30s.
  • Network switches. The dashboard aborts its requests when the network changes, so a slow (rate-limited) zec response can't fill the tzec page. The in-flight guard is per network, so switching no longer skips the new fetch.
  • Failed blocks show as rows instead of gaps, and are retried on the next refresh.
  • First-load latency sync skips Zcash. It probed both Tatum hosts of zec and tzec on every fresh load: two of the mainnet gateways' ~5 requests per minute, spent before the dashboard's own calls.
  • Shared ZcashKindBadge, ZcashOutputValue and ZcashSkeleton cells, typed label keys (labels.ts, moved down from feat(zcash): add transaction pages with shielded bundles and fee lookup #409) and useZcashNetworkFromPath. Skeleton sizes are CSS classes, not inline styles.
  • Relative times use the pluralized block:time keys (useTimeAgo), so useZcashTimeAgo and the zcash:common keys are gone. Percentages follow the viewer's locale; count keys have plural forms.
  • feat: add Zcash to the explorer (adapter, pages, routes) #398 §5 lists useNetworkDashboard.ts and settings/index.tsx. Neither needs a Zcash branch: the hook is EVM-only, and RPC settings already list every network.
  • Merge the stack as one unit. Until the later PRs land, links to /zec/blocks, /zec/tx/… and /zec/address/… fall through to the :networkId catch-all.

Tests after the follow-up

  • npm run test:run: 198 passing.
  • Hermetic Zcash e2e specs at this PR: 4 passed, no retries.

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

🚀 Preview: https://pr-407--openscan.netlify.app
📝 Commit: dbae080d9748f820d265ff84a48324925789384a

The dashboard loads stats and the tip block first, then earlier block summaries one at a time, and caches summaries across refreshes so a 90s refresh stays within hosted gateway rate limits.
The navbar polled getblockcount while the dashboard fetched
getblockchaininfo for the same height. Both now read one
getblockchaininfo response, shared for 30s per network and endpoint
list. One caller aborting doesn't cancel it for the others, and a
failed response isn't reused.

The per-endpoint state (unsupported methods, chain info) now lives in
a ZcashSession from getZcashSession().
- The dashboard aborts its requests when the network changes, so a slow
  (rate-limited) zec response can't fill the tzec page. The in-flight
  guard is per network, so switching no longer skips the new fetch.
- Blocks that fail to load are listed as unavailable rows instead of
  gaps, and retried on the next refresh.
- The navbar indicator shares one code path for UTXO chains and maps
  poll intervals by network type.
- Shared ZcashKindBadge, ZcashOutputValue and ZcashSkeleton cells,
  typed label keys (labels.ts) and useZcashNetworkFromPath; skeleton
  sizes move from inline styles to CSS classes.
- Relative times use the pluralized block:time keys (useTimeAgo), so
  useZcashTimeAgo and the zcash:common keys are gone.
- Percentages follow the viewer's locale; count keys get plural forms.
- Remove the unused loadingBlocks and lastUpdated fields.
Auto-sync probes every network with two or more endpoints 1.5s after
the first load. With Zcash support in the latency test, that sent
getblockcount to both Tatum hosts of zec and tzec on every fresh load:
two of the ~5 requests per minute the mainnet gateways share per IP,
spent before the dashboard's own calls. Zcash endpoints keep their
order instead; the manual latency test on the RPC page still covers
them.
@MatiasOS
MatiasOS force-pushed the issue-398-zcash-dashboard branch from da85e45 to dbae080 Compare November 20, 2026 23:44
@MatiasOS
MatiasOS merged commit 7ae49ff into dev Nov 21, 2026
7 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.

1 participant