Skip to content
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

Prevent reconstruction starting prematurely #6669

Merged

Conversation

michaelsproul
Copy link
Member

Issue Addressed

Fix a long-standing issue most recently reported by @xrchz whereby Lighthouse attempts to start state reconstruction too early.

Dec 02 07:11:49.453 ERRO State reconstruction failed error: MissingHistoricBlocks { oldest_block_slot: Slot(543328) }, service: beacon

Proposed Changes

When starting up, only attempt to start state reconstruction if block backfill is already complete. A similar guard condition already exists at the point in block backfill where we start reconstruction:

if backfill_complete
&& self.genesis_backfill_slot == Slot::new(0)
&& self.config.reconstruct_historic_states
{
self.store_migrator.process_reconstruction();
}

Additional Info

Alternatively we could refactor the reconstruction code itself to just log a debug message and return Ok(()) in the case where reconstruction is not yet ready to start. However due to the limited number of places from which reconstruction can be triggered, I think the current approach is preferable, as it avoids sending and processing an unnecessary event.

@michaelsproul michaelsproul added ready-for-review The code is ready for review database UX-and-logs v6.0.1 Bugfix for v6.0.0 labels Dec 9, 2024
michaelsproul added a commit that referenced this pull request Dec 9, 2024
Squashed commit of the following:

commit fa6fadd
Author: Michael Sproul <michael@sigmaprime.io>
Date:   Mon Dec 9 11:30:49 2024 +1100

    Prevent reconstruction starting prematurely
@michaelsproul michaelsproul mentioned this pull request Dec 9, 2024
Copy link
Member

@jimmygchen jimmygchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@jimmygchen jimmygchen added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Dec 12, 2024
@michaelsproul
Copy link
Member Author

@mergify queue

Copy link

mergify bot commented Dec 12, 2024

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at fc0e0ae

mergify bot added a commit that referenced this pull request Dec 12, 2024
@mergify mergify bot merged commit fc0e0ae into sigp:release-v6.0.1 Dec 12, 2024
29 checks passed
@michaelsproul michaelsproul deleted the dont-start-reconstruction-early branch December 12, 2024 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database ready-for-merge This PR is ready to merge. UX-and-logs v6.0.1 Bugfix for v6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants