Fix indefinite loop when when validators are present, but VC does not know indices yet. (#6615)
Fix block pruning when no validators seen.
This commit is contained in:
parent
7990cc2d1c
commit
fc2b232b9e
|
@ -114,7 +114,7 @@ proc pollForAttesterDuties*(service: DutiesServiceRef,
|
||||||
vc = service.client
|
vc = service.client
|
||||||
indices = toSeq(vc.attachedValidators[].indices())
|
indices = toSeq(vc.attachedValidators[].indices())
|
||||||
relevantDuties =
|
relevantDuties =
|
||||||
block:
|
if len(indices) > 0:
|
||||||
var duties: seq[RestAttesterDuty]
|
var duties: seq[RestAttesterDuty]
|
||||||
block mainLoop:
|
block mainLoop:
|
||||||
while true:
|
while true:
|
||||||
|
@ -153,6 +153,8 @@ proc pollForAttesterDuties*(service: DutiesServiceRef,
|
||||||
duties.add(duty)
|
duties.add(duty)
|
||||||
break mainLoop
|
break mainLoop
|
||||||
duties
|
duties
|
||||||
|
else:
|
||||||
|
default(seq[RestAttesterDuty])
|
||||||
|
|
||||||
template checkReorg(a, b: untyped): bool =
|
template checkReorg(a, b: untyped): bool =
|
||||||
not(a.dependentRoot == b.get())
|
not(a.dependentRoot == b.get())
|
||||||
|
@ -518,8 +520,8 @@ proc pollForBeaconProposers*(service: DutiesServiceRef) {.async.} =
|
||||||
slot = currentSlot, epoch = currentEpoch, err_name = exc.name,
|
slot = currentSlot, epoch = currentEpoch, err_name = exc.name,
|
||||||
err_msg = exc.msg
|
err_msg = exc.msg
|
||||||
|
|
||||||
service.pruneBeaconProposers(currentEpoch)
|
service.pruneBeaconProposers(currentEpoch)
|
||||||
vc.pruneBlocksSeen(currentEpoch)
|
vc.pruneBlocksSeen(currentEpoch)
|
||||||
|
|
||||||
proc prepareBeaconProposers*(service: DutiesServiceRef) {.async.} =
|
proc prepareBeaconProposers*(service: DutiesServiceRef) {.async.} =
|
||||||
let vc = service.client
|
let vc = service.client
|
||||||
|
|
Loading…
Reference in New Issue