Fix block selection methods to include pruned missed slots properly #110
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
slot
>=prunedSlot
):check filter & load block from cache, construct the slot entry on the fly and reconstruct missing blocks
slot
<prunedSlot
&&slot
>=finalizedSlot
):check filter based on cache, check canonical status, load relevant slot entries from db and reconstruct missing blocks
slot
<finalizesSlot
):load filtered slot entries from db