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
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 blocksslot
<prunedSlot
&&slot
>=finalizedSlot
): check filter based on cache, check canonical status, load relevant slot entries from db and reconstruct missing blocksslot
<finalizesSlot
): load filtered slot entries from db