From 19453b311f8a57ee33c793daa218ec2e9b6db1ba Mon Sep 17 00:00:00 2001 From: pk910 Date: Mon, 14 Oct 2024 11:08:22 +0200 Subject: [PATCH] fix endless loop when validator set cannot be loaded on dead chain --- indexer/beacon/canonical.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indexer/beacon/canonical.go b/indexer/beacon/canonical.go index f959bb1d..3275f9c7 100644 --- a/indexer/beacon/canonical.go +++ b/indexer/beacon/canonical.go @@ -365,7 +365,7 @@ func (indexer *Indexer) GetCanonicalValidatorSet(overrideForkId *ForkKey) []*v1. for { epoch := chainState.EpochOfSlot(canonicalHead.Slot) - if headEpoch-epoch > 2 { + if headEpoch-epoch > 2 || epoch == 0 { return validatorSet }