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

Use oldest_block_slot to break of pruning payloads #6745

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

dapplion
Copy link
Collaborator

Issue Addressed

Lighthouse DB persists an "anchor" which has some useful data. One is the anchor_slot. Tree-states on the hot DB wants to use that value and change it's meaning slightly. The only blocker for that change is try_prune_execution_payloads which uses the anchor_slot as optimization to break of early the pruning routine.

BUT it's an easy fix. From @michaelsproul

I was thinking maybe we could recycle the anchor_slot for use here, as it is fairly useless and not used for much. The only load-bearing use of the anchor_slot that I can find is in try_prune_execution_payloads where it is used to halt the pruning process. However, this is not necessary as we could either:

  1. Keep iterating back to Bellatrix, or
  2. Stop iterating back once we find a payload that is missing, or
  3. Use the oldest_block_slot to determine when to stop iterating back. This is my preferred option, as it is also compatible with storing execution payloads older than the anchor_slot, i.e. Store execution payloads during backfill if --prune-payloads false #6510

ref dapplion#39 (comment)

Proposed Changes

This PR implements option 3 of the above citation, quite painless

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.

1 participant