Skip to content

Improve /lighthouse/database/reconstruct API: return informative error if backfill not enabled #7654

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: stable
Choose a base branch
from

Conversation

VolodymyrBg
Copy link

Issue Addressed

This PR addresses issue #4788: State reconstruction API doesn't work if genesis backfill hasn't been enabled

Proposed Changes

  • The /lighthouse/database/reconstruct API endpoint now returns a clear, user-friendly error if the node was started without historic block backfill (i.e., without --genesis-backfill or --reconstruct-historic-states).
  • The error message includes instructions to restart the Beacon Node with --reconstruct-historic-states.
  • The API handler was refactored to propagate errors from the reconstruction logic to the HTTP response, instead of only logging them.
  • Documentation (book/src/api-lighthouse.md) was updated to describe the new API behavior and provide example responses.
    Internal logic in process_reconstruction was updated to return a Result, enabling error propagation to the API layer.

Additional Info

  • This change improves UX for users running archival nodes or researchers, making it clear why state reconstruction may fail and how to resolve it.
  • No changes were made to the actual reconstruction logic; only error handling and documentation were improved.
  • Future consideration: If dynamic enabling of backfill becomes possible, the API could be extended to trigger it directly.
  • All changes are backward compatible for nodes already running with the correct flags.

@michaelsproul
Copy link
Member

Hi @VolodymyrBg can you please re-target your PR at the unstable branch? We use unstable for all development

@michaelsproul michaelsproul added the waiting-on-author The reviewer has suggested changes and awaits thier implementation. label Jun 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database waiting-on-author The reviewer has suggested changes and awaits thier implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants