private boolean transactionTooLargeForBlock(
      final Transaction transaction, final long cumulativeGasUsed) {

    return transaction.getGasLimit() > blockGasLimit - cumulativeGasUsed;
  }
Checks if the transaction is too large for the block.

@param transaction The transaction to be checked. block.
@param cumulativeGasUsed The cumulative gas used by previous txs.
@return True if the transaction is too large for the block, false otherwise.
ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/BlockSizeTransactionSelector.java