Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VC: Fix infinite loop when validators do not have indices yet. #6615

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions beacon_chain/validator_client/duties_service.nim
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ proc pollForAttesterDuties*(service: DutiesServiceRef,
vc = service.client
indices = toSeq(vc.attachedValidators[].indices())
relevantDuties =
block:
if len(indices) > 0:
var duties: seq[RestAttesterDuty]
block mainLoop:
while true:
Expand Down Expand Up @@ -153,6 +153,8 @@ proc pollForAttesterDuties*(service: DutiesServiceRef,
duties.add(duty)
break mainLoop
duties
else:
default(seq[RestAttesterDuty])

template checkReorg(a, b: untyped): bool =
not(a.dependentRoot == b.get())
Expand Down Expand Up @@ -518,8 +520,8 @@ proc pollForBeaconProposers*(service: DutiesServiceRef) {.async.} =
slot = currentSlot, epoch = currentEpoch, err_name = exc.name,
err_msg = exc.msg

service.pruneBeaconProposers(currentEpoch)
vc.pruneBlocksSeen(currentEpoch)
service.pruneBeaconProposers(currentEpoch)
vc.pruneBlocksSeen(currentEpoch)

proc prepareBeaconProposers*(service: DutiesServiceRef) {.async.} =
let vc = service.client
Expand Down
Loading