@Override
  public TransactionSelectionResult evaluateTransactionPreProcessing(
      final TransactionEvaluationContext evaluationContext) {

    final long cumulativeGasUsed = getWorkingState();

    if (transactionTooLargeForBlock(evaluationContext.getTransaction(), cumulativeGasUsed)) {
      LOG.atTrace()
          .setMessage("Transaction {} too large to select for block creation")
          .addArgument(evaluationContext.getPendingTransaction()::toTraceLog)
          .log();
      if (blockOccupancyAboveThreshold(cumulativeGasUsed)) {
        LOG.trace("Block occupancy above threshold, completing operation");
        return TransactionSelectionResult.BLOCK_OCCUPANCY_ABOVE_THRESHOLD;
      } else if (blockFull(cumulativeGasUsed)) {
        LOG.trace("Block full, completing operation");
        return TransactionSelectionResult.BLOCK_FULL;
      } else {
        return TransactionSelectionResult.TX_TOO_LARGE_FOR_REMAINING_GAS;
      }
    }
    return TransactionSelectionResult.SELECTED;
  }
Evaluates a transaction considering other transactions in the same block. If the transaction is
too large for the block returns a selection result based on block occupancy.

@param evaluationContext The current selection session data.
@return The result of the transaction selection.
ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/BlockSizeTransactionSelector.java