private Optional<Bytes[]> captureStack(final MessageFrame frame) {
    if (!options.traceStack()) {
      return Optional.empty();
    }

    final Bytes[] stackContents = new Bytes[frame.stackSize()];
    for (int i = 0; i < stackContents.length; i++) {
      // Record stack contents in reverse
      stackContents[i] = frame.getStackItem(stackContents.length - i - 1);
    }
    return Optional.of(stackContents);
  }
Creates the operation tracer.

@param options The options, as passed in through the RPC
@param recordChildCallGas A flag on whether to produce geth style (true) or parity style
    (false) gas amounts for call operations
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/vm/DebugOperationTracer.java