diff --git a/teku/src/main/java/tech/pegasys/teku/cli/options/ValidatorKeysOptions.java b/teku/src/main/java/tech/pegasys/teku/cli/options/ValidatorKeysOptions.java index f551279bf25..41a7ad9dff8 100644 --- a/teku/src/main/java/tech/pegasys/teku/cli/options/ValidatorKeysOptions.java +++ b/teku/src/main/java/tech/pegasys/teku/cli/options/ValidatorKeysOptions.java @@ -134,10 +134,10 @@ public void configure(TekuConfiguration.Builder builder) { } private List parseValidatorExternalKeys(final boolean allowNoLoadedKeys) { - if (allowNoLoadedKeys) { - return validatorExternalSignerPublicKeys.stream().filter(StringUtils::isNotBlank).toList(); + if (!allowNoLoadedKeys && validatorExternalSignerPublicKeys.isEmpty()) { + throw new InvalidConfigurationException("No validator external signer keys are loaded"); } - return validatorExternalSignerPublicKeys; + return validatorExternalSignerPublicKeys.stream().filter(StringUtils::isNotBlank).toList(); } private URL parseValidatorExternalSignerUrl() {