public BigInteger calculateUpfrontGasCost(
      final Wei gasPrice, final Wei blobGasPrice, final long totalBlobGas) {
    var cost =
        new BigInteger(1, Longs.toByteArray(getGasLimit())).multiply(gasPrice.getAsBigInteger());

    if (transactionType.supportsBlob()) {
      cost = cost.add(blobGasPrice.getAsBigInteger().multiply(BigInteger.valueOf(totalBlobGas)));
    }

    return cost;
  }
Calculates the up-front cost for the gas and blob gas the transaction can use.

@param gasPrice the gas price to use
@param blobGasPrice the blob gas price to use
@return the up-front cost for the gas the transaction can use.
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Transaction.java