Skip to content

Conversation

@tom2drum
Copy link
Collaborator

Description and Related Issue(s)

Resolves #1835

This PR implements graceful service degradation for the home page, allowing it to display data from a public RPC node when the Blockscout API is unavailable. When the API fails, the home page shows recent blocks and transactions fetched directly from the RPC, ensuring users can still access essential blockchain information.

Proposed Changes

  • Added degraded view components (LatestBlocksDegraded, LatestTxsDegraded) that fetch data from RPC when API is unavailable
  • Created RPC data formatting utilities (formatBlockData, formatTxData) to transform RPC responses into the expected data structure
  • Updated home page components (LatestBlocks, LatestTxs) to automatically fall back to degraded views on API errors
  • Added shared fallback components (FallbackBox, FallbackChart) for consistent error and loading states
  • Fixed transaction degraded view when initial query is refetching
  • Fixed memory leak by calling unwatch when components unmount
  • Fixed tab title flickering on home page graphs
  • Added comprehensive tests and visual regression tests for degraded views

Breaking or Incompatible Changes

None.

Additional Information

The implementation follows the design specifications in issue #1835, which outlines what data can be retrieved from RPC nodes (recent blocks, recent transactions, latest block height, gas price) when the API is unavailable.

Checklist for PR author

  • I have tested these changes locally.
  • I added tests to cover any new functionality, following this guide
  • Whenever I fix a bug, I include a regression test to ensure that the bug does not reappear silently.
  • If I have added a feature or functionality that is not privacy-compliant (e.g., tracking, analytics, third-party services), I have disabled it for private mode.
  • If I have added, changed, renamed, or removed an environment variable
    • I updated the list of environment variables in the documentation
    • I made the necessary changes to the validator script according to the guide
    • I added "ENVs" label to this pull request

@tom2drum tom2drum added the design For issues and PRs related to UI and UX improvements label Jan 16, 2026
@tom2drum tom2drum marked this pull request as ready for review January 22, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

design For issues and PRs related to UI and UX improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI/UX: Graceful service degradation: Home page

2 participants