public Wei getUpfrontCost(final long totalBlobGas) {
    Wei maxUpfrontGasCost = getMaxUpfrontGasCost(totalBlobGas);
    Wei result = maxUpfrontGasCost.add(getValue());
    return (maxUpfrontGasCost.compareTo(result) > 0) ? Wei.MAX_WEI : result;
  }
Calculates the up-front cost for the transaction.

<p>The up-front cost is paid by the sender account before the transaction is executed. The
sender must have the amount in its account balance to execute and some of this amount may be
refunded after the transaction has executed.

@return the up-front gas cost for the transaction
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Transaction.java