@Override
  public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
    if (validatorProvider.getVoteProviderAtHead().isPresent()) {
      final Address validatorAddress;
      try {
        validatorAddress = requestContext.getRequiredParameter(0, Address.class);
      } catch (JsonRpcParameterException e) {
        throw new InvalidJsonRpcParameters(
            "Invalid validator address parameter (index 0)",
            RpcErrorType.INVALID_ADDRESS_PARAMS,
            e);
      }
      final Boolean add;
      try {
        add = requestContext.getRequiredParameter(1, Boolean.class);
      } catch (JsonRpcParameterException e) {
        throw new InvalidJsonRpcParameters(
            "Invalid vote type parameter (index 1)", RpcErrorType.INVALID_VOTE_TYPE_PARAMS, e);
      }
      LOG.trace(
          "Received RPC rpcName={} voteType={} address={}",
          getName(),
          add ? VoteType.ADD : VoteType.DROP,
          validatorAddress);

      if (add) {
        validatorProvider.getVoteProviderAtHead().get().authVote(validatorAddress);
      } else {
        validatorProvider.getVoteProviderAtHead().get().dropVote(validatorAddress);
      }
      return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), true);
    } else {
      return new JsonRpcErrorResponse(
          requestContext.getRequest().getId(), RpcErrorType.METHOD_NOT_ENABLED);
    }
  }
Instantiates a new Qbft propose validator vote.

@param validatorProvider the validator provider
consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/jsonrpc/methods/QbftProposeValidatorVote.java