PeerTaskExecutorResult<List<BlockHeader>> requestHeadersUsingPeerTaskSystem() {
    final long range = maximumPossibleCommonAncestorNumber - minimumPossibleCommonAncestorNumber;
    final int skipInterval = initialQuery ? 0 : calculateSkipInterval(range, headerRequestSize);
    final int count =
        initialQuery ? headerRequestSize : calculateCount((double) range, skipInterval);
    LOG.debug(
        "Searching for common ancestor with {} between {} and {}",
        peer,
        minimumPossibleCommonAncestorNumber,
        maximumPossibleCommonAncestorNumber);
    GetHeadersFromPeerTask task =
        new GetHeadersFromPeerTask(
            maximumPossibleCommonAncestorNumber,
            count,
            skipInterval,
            Direction.REVERSE,
            protocolSchedule);
    return ethContext.getPeerTaskExecutor().executeAgainstPeer(task, peer);
  }
Finds the common ancestor with the given peer. It is assumed that the peer will at least share
the same genesis block with this node. Running this task against a peer with a non-matching
genesis block will result in undefined behavior: the task may complete exceptionally or in some
cases this node's genesis block will be returned.
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/tasks/DetermineCommonAncestorTask.java