private boolean shouldSetMaxFeePerGas(
      final CallParameter callParams, final ProcessableBlockHeader header) {

    // Return false if chain ID is not present
    if (protocolSchedule.getChainId().isEmpty()) {
      return false;
    }

    // Return false if base fee is not present
    if (header.getBaseFee().isEmpty()) {
      return false;
    }

    // Return true if blob gas price should be set
    if (shouldSetBlobGasPrice(callParams)) {
      return true;
    }

    // Return true if all gas price parameters are empty
    if (callParams.getMaxPriorityFeePerGas().isEmpty()
        && callParams.getMaxFeePerGas().isEmpty()
        && callParams.getGasPrice().isEmpty()) {
      return true;
    }

    // Return true if either maxPriorityFeePerGas or maxFeePerGas is present
    // This ensures the transaction is considered EIP-1559 only if these parameters are present
    return callParams.getMaxPriorityFeePerGas().isPresent()
        || callParams.getMaxFeePerGas().isPresent();
  }
Processes a transaction simulation with the provided parameters and executes pre-worldstate
close actions.

@param callParams The call parameters for the transaction.
@param maybeStateOverrides The map of state overrides to apply to the state for this
    transaction.
@param transactionValidationParams The validation parameters for the transaction.
@param operationTracer The tracer for capturing operations during processing.
@param preWorldStateCloseGuard The pre-worldstate close guard for executing pre-close actions.
@param header The block header.
@return An Optional containing the result of the processing.
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java