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

Fix block selection methods to include pruned missed slots properly #110

Merged
merged 6 commits into from
Aug 23, 2024

Conversation

pk910
Copy link
Member

@pk910 pk910 commented Aug 22, 2024

One more regression coming from #83

This fixes #109 by reimplementing the 2 central slot selection methods (GetDbBlocksForSlots & GetDbBlocksByFilter)

Background:
The old indexer stored all old unfinalized slot assignments (including missing slots) in db after some epochs.
this is no longer the case with the new indexer, as missing slot duties may differ depending on which fork is seen as canonical.
for the new indexer, the proposer duties are available in cache for all unfinalized epochs.

I've missed updating the two slot selection methods for this slight logic change,
therefore it still tried to load missing slots from db, which is no longer possible.

the two slot selection methods need to construct or load slots in 3 different ways depending on cache processing status:

  • If slot is unfinalized & unpruned (slot >= prunedSlot):
    check filter & load block from cache, construct the slot entry on the fly and reconstruct missing blocks
  • If slot is unfinalized & pruned (slot < prunedSlot && slot >= finalizedSlot):
    check filter based on cache, check canonical status, load relevant slot entries from db and reconstruct missing blocks
  • If slot is finalized (slot < finalizesSlot):
    load filtered slot entries from db

@pk910 pk910 requested a review from skylenet August 23, 2024 09:29
@pk910 pk910 merged commit 2304064 into master Aug 23, 2024
3 checks passed
@pk910 pk910 deleted the pk910/fix-missing-pruned-blocks branch August 23, 2024 11:20
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.

Dora does not show proposer duties for old unfinalized slots
2 participants