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

[Merged by Bors] - Fix block backfill with genesis skip slots #4820

Closed

Conversation

michaelsproul
Copy link
Member

Issue Addressed

Closes #4817.

Proposed Changes

  • Fill in the linear block roots array between 0 and the slot of the first block (e.g. slots 0 and 1 on Holesky).
  • Backport the --freezer, --skip and --limit options for lighthouse db inspect from tree-states. This allows us to easily view the database corruption of 4817 using lighthouse db inspect --network holesky --freezer --column bbr --output values --limit 2.
  • Backport the iter_column_from change and MemoryStore overhaul from tree-states. These are required to enable lighthouse db inspect.
  • Rework freezer_upper_limit to allow state lookups for slots below the state_lower_limit. Currently state lookups will fail until state reconstruction completes entirely.

There is a new regression test for the main bug, but no test for the freezer_upper_limit fix because we don't currently support running state reconstruction partially (see #3026). This will be fixed once we merge tree-states! In lieu of an automated test, I've tested manually on a Holesky node while it was reconstructing.

Additional Info

Users who backfilled Holesky to slot 0 (e.g. using --reconstruct-historic-states) need to either:

  • Re-sync from genesis.
  • Re-sync using checkpoint sync and the changes from this PR.

Due to the recency of the Holesky genesis, writing a custom pass to fix up broken databases (which would require its own thorough testing) was deemed unnecessary. This is the primary reason for this PR being marked backwards-incompat.

This will create few conflicts with Deneb, which I've already resolved on tree-states-deneb and will be happy to backport to Deneb once this PR is merged to unstable.

@michaelsproul michaelsproul added bug Something isn't working ready-for-review The code is ready for review database backwards-incompat Backwards-incompatible API change v4.6.0 ETA Q1 2024 labels Oct 10, 2023
Copy link
Member

@paulhauner paulhauner left a comment

Choose a reason for hiding this comment

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

I spent a while getting my head across this and it looks good.

Nice one!

@michaelsproul michaelsproul added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Oct 27, 2023
@michaelsproul
Copy link
Member Author

bors r+

bors bot pushed a commit that referenced this pull request Oct 27, 2023
## Issue Addressed

Closes #4817.

## Proposed Changes

- Fill in the linear block roots array between 0 and the slot of the first block (e.g. slots 0 and 1 on Holesky).
- Backport the `--freezer`, `--skip` and `--limit` options for `lighthouse db inspect` from tree-states. This allows us to easily view the database corruption of 4817 using `lighthouse db inspect --network holesky --freezer --column bbr --output values --limit 2`.
- Backport the `iter_column_from` change and `MemoryStore` overhaul from tree-states. These are required to enable `lighthouse db inspect`.
- Rework `freezer_upper_limit` to allow state lookups for slots below the `state_lower_limit`. Currently state lookups will fail until state reconstruction completes entirely.

There is a new regression test for the main bug, but no test for the `freezer_upper_limit` fix because we don't currently support running state reconstruction partially (see #3026). This will be fixed once we merge `tree-states`! In lieu of an automated test, I've tested manually on a Holesky node while it was reconstructing.

## Additional Info

Users who backfilled Holesky to slot 0 (e.g. using `--reconstruct-historic-states`) need to either:

- Re-sync from genesis.
- Re-sync using checkpoint sync and the changes from this PR.

Due to the recency of the Holesky genesis, writing a custom pass to fix up broken databases (which would require its own thorough testing) was deemed unnecessary. This is the primary reason for this PR being marked `backwards-incompat`.

This will create few conflicts with Deneb, which I've already resolved on `tree-states-deneb` and will be happy to backport to Deneb once this PR is merged to unstable.
@bors
Copy link

bors bot commented Oct 27, 2023

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request Oct 27, 2023
## Issue Addressed

Closes #4817.

## Proposed Changes

- Fill in the linear block roots array between 0 and the slot of the first block (e.g. slots 0 and 1 on Holesky).
- Backport the `--freezer`, `--skip` and `--limit` options for `lighthouse db inspect` from tree-states. This allows us to easily view the database corruption of 4817 using `lighthouse db inspect --network holesky --freezer --column bbr --output values --limit 2`.
- Backport the `iter_column_from` change and `MemoryStore` overhaul from tree-states. These are required to enable `lighthouse db inspect`.
- Rework `freezer_upper_limit` to allow state lookups for slots below the `state_lower_limit`. Currently state lookups will fail until state reconstruction completes entirely.

There is a new regression test for the main bug, but no test for the `freezer_upper_limit` fix because we don't currently support running state reconstruction partially (see #3026). This will be fixed once we merge `tree-states`! In lieu of an automated test, I've tested manually on a Holesky node while it was reconstructing.

## Additional Info

Users who backfilled Holesky to slot 0 (e.g. using `--reconstruct-historic-states`) need to either:

- Re-sync from genesis.
- Re-sync using checkpoint sync and the changes from this PR.

Due to the recency of the Holesky genesis, writing a custom pass to fix up broken databases (which would require its own thorough testing) was deemed unnecessary. This is the primary reason for this PR being marked `backwards-incompat`.

This will create few conflicts with Deneb, which I've already resolved on `tree-states-deneb` and will be happy to backport to Deneb once this PR is merged to unstable.
@bors
Copy link

bors bot commented Oct 27, 2023

Pull request successfully merged into unstable.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title Fix block backfill with genesis skip slots [Merged by Bors] - Fix block backfill with genesis skip slots Oct 27, 2023
@bors bors bot closed this Oct 27, 2023
@michaelsproul michaelsproul deleted the fix-state-reconstruction branch October 27, 2023 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backwards-incompat Backwards-incompatible API change bug Something isn't working database ready-for-merge This PR is ready to merge. v4.6.0 ETA Q1 2024
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants