@Override
  protected void executeTask() {
    final String blockIdentifier = blockNumber + " (" + hash + ")";
    LOG.debug(
        "Downloading block {} from peer {}.",
        blockIdentifier,
        assignedPeer.map(EthPeer::toString).orElse("<any>"));
    if (synchronizerConfiguration.isPeerTaskSystemEnabled()) {
      ethContext
          .getScheduler()
          .scheduleServiceTask(
              () -> {
                downloadHeaderUsingPeerTaskSystem()
                    .thenCompose(this::completeBlock)
                    .whenComplete((r, t) -> completeTask(r, t, blockIdentifier));
              });
    } else {
      downloadHeader()
          .thenCompose(
              (peerTaskResult) -> CompletableFuture.completedFuture(peerTaskResult.getResult()))
          .thenCompose(this::completeBlock)
          .whenComplete((r, t) -> completeTask(r, t, blockIdentifier));
    }
  }
Downloads a block from a peer. Will complete exceptionally if block cannot be downloaded.
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/GetBlockFromPeerTask.java