private Optional<Errors> validateVoterOnlyRequest(int remoteNodeId, int requestEpoch) {
        if (requestEpoch < quorum.epoch()) {
            return Optional.of(Errors.FENCED_LEADER_EPOCH);
        } else if (remoteNodeId < 0) {
            return Optional.of(Errors.INVALID_REQUEST);
        } else {
            return Optional.empty();
        }
    }
Validate common state for requests to establish leadership.

These include the Vote, BeginQuorumEpoch and EndQuorumEpoch RPCs. If an error is present in
the returned value, it should be returned in the response.
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java