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 panic in epochCache.loadEpochStats #118

Closed pk910 closed 2 months ago

pk910 commented 2 months ago

fix panic from peerdas devnet:

panic: runtime error: integer divide by zero

goroutine 966 [running]:
github.com/ethpandaops/dora/indexer/beacon.(*epochCache).loadEpochStats(0xc0001461b0, 0xc000594270)
    /home/runner/work/dora/dora/indexer/beacon/epochcache.go:436 +0x9ea
created by github.com/ethpandaops/dora/indexer/beacon.(*epochCache).runLoaderLoop in goroutine 94
    /home/runner/work/dora/dora/indexer/beacon/epochcache.go:369 +0x145

This is happening when dora tries loading the epoch stats of a fork that no client is part of. This might happen in networks with high amount of reorgs (peerdas forkparties). Such epoch stats should be ignored after several silent retries