private void timeLimitedSelection() {
    final var txSelectionTask =
        new FutureTask<Void>(
            () -> {
              selectorsStateManager.blockSelectionStarted();

              LOG.debug("Starting plugin transaction selection");
              transactionSelectionService.selectPendingTransactions(
                  this, blockSelectionContext.pendingBlockHeader());

              LOG.atDebug()
                  .setMessage("Starting internal pool transaction selection, stats {}")
                  .addArgument(blockSelectionContext.transactionPool()::logStats)
                  .log();
              blockSelectionContext.transactionPool().selectTransactions(this::evaluateTransaction);
            },
            null);
    ethScheduler.scheduleBlockCreationTask(txSelectionTask);

    try {
      txSelectionTask.get(blockTxsSelectionMaxTime, TimeUnit.MILLISECONDS);
    } catch (InterruptedException | ExecutionException e) {
      if (isCancelled.get()) {
        throw new CancellationException("Cancelled during transaction selection");
      }
      LOG.warn("Error during block transaction selection", e);
    } catch (TimeoutException e) {
      // synchronize since we want to be sure that there is no concurrent state update
      synchronized (isTimeout) {
        isTimeout.set(true);
      }

      cancelEvaluatingTxWithGraceTime(txSelectionTask);

      final var logBuilder =
          LOG.atWarn()
              .setMessage(
                  "Interrupting the selection of transactions for block inclusion as it exceeds"
                      + " the maximum configured duration of {}ms")
              .addArgument(blockTxsSelectionMaxTime);

      if (LOG.isTraceEnabled()) {
        logBuilder.setCause(e).log();
      } else {
        logBuilder.log();
      }
    }
  }
Builds a list of transactions for a block by iterating over all transactions in the
PendingTransactions pool. This operation can be long-running and, if executed in a separate
thread, can be cancelled via the isCancelled supplier, which would result in a
CancellationException.

@return The {@code TransactionSelectionResults} containing the results of transaction
    evaluation.
ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/BlockTransactionSelector.java