@Override
  public void tracePostExecution(final MessageFrame frame, final OperationResult operationResult) {
    final Operation currentOperation = frame.getCurrentOperation();
    final String opcode = currentOperation.getName();
    final int opcodeNumber = (opcode != null) ? currentOperation.getOpcode() : Integer.MAX_VALUE;
    final WorldUpdater worldUpdater = frame.getWorldUpdater();
    final Bytes outputData = frame.getOutputData();
    final Optional<Bytes[]> memory = captureMemory(frame);
    final Optional<Bytes[]> stackPostExecution = captureStack(frame);

    if (lastFrame != null) {
      lastFrame.setGasRemainingPostExecution(gasRemaining);
    }
    final Optional<Map<UInt256, UInt256>> storage = captureStorage(frame);
    final Optional<Map<Address, Wei>> maybeRefunds =
        frame.getRefunds().isEmpty() ? Optional.empty() : Optional.of(frame.getRefunds());
    long thisGasCost = operationResult.getGasCost();
    if (recordChildCallGas && currentOperation instanceof AbstractCallOperation) {
      thisGasCost += frame.getMessageFrameStack().getFirst().getRemainingGas();
    }
    lastFrame =
        new TraceFrame(
            pc,
            Optional.of(opcode),
            opcodeNumber,
            gasRemaining,
            thisGasCost == 0 ? OptionalLong.empty() : OptionalLong.of(thisGasCost),
            frame.getGasRefund(),
            depth,
            Optional.ofNullable(operationResult.getHaltReason())
                .or(frame::getExceptionalHaltReason),
            frame.getRecipientAddress(),
            frame.getApparentValue(),
            inputData,
            outputData,
            preExecutionStack,
            memory,
            storage,
            worldUpdater,
            frame.getRevertReason(),
            maybeRefunds,
            Optional.ofNullable(frame.getMessageFrameStack().peek()).map(MessageFrame::getCode),
            frame.getCurrentOperation().getStackItemsProduced(),
            stackPostExecution,
            currentOperation.isVirtualOperation(),
            frame.getMaybeUpdatedMemory(),
            frame.getMaybeUpdatedStorage());
    traceFrames.add(lastFrame);
    frame.reset();
  }
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