public Wei getUpfrontGasCost(
      final Wei gasPrice, final Wei blobGasPrice, final long totalBlobGas) {
    if (gasPrice == null || gasPrice.isZero()) {
      return Wei.ZERO;
    }

    final var cost = calculateUpfrontGasCost(gasPrice, blobGasPrice, totalBlobGas);

    if (cost.bitLength() > 256) {
      return Wei.MAX_WEI;
    } else {
      return Wei.of(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