protected long processEstimateGas(final TransactionSimulatorResult result) {
    final long gasUsedByTransaction = result.result().getEstimateGasUsedByTransaction();

    // no more than 64/63 of the remaining gas can be passed to the sub calls
    return ((long) ((gasUsedByTransaction + CALL_STIPEND) * SUB_CALL_REMAINING_GAS_RATIO));
  }
Estimate gas by adding call stipend and compute the necessary gas for sub calls

@param result transaction simulator result
@return estimate gas
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthEstimateGas.java