ethpandaops / dora

Dora the Explorer is a lightweight slot explorer for the ethereum beaconchain
https://beaconlight.ephemery.dev/
GNU General Public License v3.0
79 stars 26 forks source link

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

Closed pk910 closed 2 months ago

pk910 commented 2 months ago

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: