Skip to content

refactor: consolidate beaconchain fetchers into single endpoint#17115

Merged
wackerow merged 2 commits into
devfrom
refactor/consolidate-beaconchain-fetcher
Jan 20, 2026
Merged

refactor: consolidate beaconchain fetchers into single endpoint#17115
wackerow merged 2 commits into
devfrom
refactor/consolidate-beaconchain-fetcher

Conversation

@pettinarip
Copy link
Copy Markdown
Member

@pettinarip pettinarip commented Jan 19, 2026

Summary

  • Combines fetchBeaconChainEpoch and fetchBeaconChainEthstore into a single fetchBeaconChain function
  • Fixes 429 rate limit errors from beaconcha.in API (supports only 1 req/sec) caused by parallel fetching
  • Fetches epoch and ethstore data sequentially with 1s delay between calls

Test plan

  • Local dev server runs without errors (USE_MOCK_DATA=true pnpm dev)
  • Verify homepage loads beaconchain data correctly
  • Verify staking page loads all metrics (totalEthStaked, validatorscount, apr)

Combines fetchBeaconChainEpoch and fetchBeaconChainEthstore into a single
fetchBeaconChain function that fetches both epoch and ethstore data
sequentially (respecting the 1 req/sec rate limit).

This reduces code duplication and simplifies the data layer by having
one storage key and one getter for all beaconchain data (totalEthStaked,
validatorscount, and apr).
@netlify
Copy link
Copy Markdown

netlify Bot commented Jan 19, 2026

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 53c025c
🔍 Latest deploy log https://app.netlify.com/projects/ethereumorg/deploys/696eff54b5869c0008c69976
😎 Deploy Preview https://deploy-preview-17115.ethereum.it
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 57 (🟢 up 4 from production)
Accessibility: 94 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 59 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the tooling 🔧 Changes related to tooling of the project label Jan 19, 2026
@wackerow wackerow merged commit 63dbabd into dev Jan 20, 2026
2 checks passed
@wackerow wackerow deleted the refactor/consolidate-beaconchain-fetcher branch January 20, 2026 04:07
@wackerow wackerow mentioned this pull request Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tooling 🔧 Changes related to tooling of the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants