private Optional<Long> getBlobGasUsed(
      final Transaction transaction, final ProtocolSpec protocolSpec) {
    return transaction.getType().supportsBlob()
        ? Optional.of(protocolSpec.getGasCalculator().blobGasCost(transaction.getBlobCount()))
        : Optional.empty();
  }
Calculates the blob gas used for data in a transaction.

@param transaction the transaction to calculate the gas for
@param protocolSpec the protocol specification to use for gas calculation
@return an Optional containing the blob gas used for data if the transaction type supports
    blobs, otherwise returns an empty Optional
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/BlockchainQueries.java