From 2bd5d0374373fec5034d4b86df46f5a4fff193e4 Mon Sep 17 00:00:00 2001 From: zah Date: Thu, 14 Jul 2022 21:48:04 +0300 Subject: [PATCH] Fix a VC crash observed in the local_testnet simulation (#3872) It's not quite clear why this condition was triggered in the local simulation, but it seems a viable scenario after the Keymanager API is integrated in the validator client. The user can temporarily remove all validator keys from a running client before adding another set of keys. --- beacon_chain/validator_client/duties_service.nim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/beacon_chain/validator_client/duties_service.nim b/beacon_chain/validator_client/duties_service.nim index da6cb87e0..6921a64a1 100644 --- a/beacon_chain/validator_client/duties_service.nim +++ b/beacon_chain/validator_client/duties_service.nim @@ -86,6 +86,9 @@ proc pollForAttesterDuties*(vc: ValidatorClientRef, res.add(index) res + if validatorIndices.len == 0: + return 0 + var duties: seq[RestAttesterDuty] var currentRoot: Option[Eth2Digest]