Skip to content

Improve beacon chain state download - #2966

Merged
naddison36 merged 1 commit into
masterfrom
nicka/beacon-data-download
Aug 8, 2026
Merged

Improve beacon chain state download#2966
naddison36 merged 1 commit into
masterfrom
nicka/beacon-data-download

Conversation

@naddison36

@naddison36 naddison36 commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Improves beacon chain state downloads used by verifyBalances and verifyDeposits.

A production download stalled after receiving response headers, with no visibility into whether data was still being transferred. This change:

  • Reads the response body in binary chunks.
  • Reports downloaded bytes, percentage, and average speed every 10 seconds.
  • Includes downloaded byte counts in timeout errors.
  • Validates that the received body matches the advertised content length.
  • Keeps the state in memory for proof generation.
  • Removes beacon-state disk caching and the obsolete cleanup helper.

No smart contracts or deployment scripts are changed.

Testing

Ran verifyBalances locally in dry-run mode against mainnet and QuickNode:

DEPLOYER_PK=<development-key> \
pnpm exec tsx tasks/run.ts verifyBalances \
  --network mainnet \
  --dryrun

Observed a successful beacon state download and proof generation:

origin:utils:beacon Fetching state for slot 14943527 from the beacon node
origin:utils:beacon Received response headers for state at slot 14943527, downloading body
origin:utils:beacon Downloaded 334324589 bytes for state at slot 14943527

The approximately 319 MiB state downloaded locally in around 9 seconds.

Additional checks:

  • JavaScript and TypeScript formatting
  • JavaScript syntax validation
  • Focused TypeScript lint

Log state data downloaded every 10 seconds
@naddison36
naddison36 merged commit 2b2edb1 into master Aug 8, 2026
10 of 11 checks passed
@naddison36
naddison36 deleted the nicka/beacon-data-download branch August 8, 2026 00:11
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