@Override
  public void tracePostExecution(
      final MessageFrame messageFrame, final Operation.OperationResult executeResult) {
    final Operation currentOp = messageFrame.getCurrentOperation();
    if (currentOp.isVirtualOperation()) {
      return;
    }
    final int opcode = currentOp.getOpcode();
    final Bytes returnData = messageFrame.getReturnData();
    long thisGasCost = executeResult.getGasCost();
    if (currentOp instanceof AbstractCallOperation) {
      thisGasCost += messageFrame.getMessageFrameStack().getFirst().getRemainingGas();
    }

    final StringBuilder sb = new StringBuilder(1024);
    sb.append("{");
    sb.append("\"pc\":").append(pc).append(",");
    boolean eofContract = messageFrame.getCode().getEofVersion() > 0;
    if (eofContract) {
      sb.append("\"section\":").append(section).append(",");
    }
    if (eip3155strict) {
      sb.append("\"op\":").append(opcode).append(",");
    } else {
      sb.append("\"op\":\"").append(fastHexByte(opcode)).append("\",");
    }
    OpcodeInfo opInfo = OpcodeInfo.getOpcode(opcode);
    if (eofContract && opInfo.pcAdvance() > 1) {
      var immediate = messageFrame.getCode().getBytes().slice(pc + 1, opInfo.pcAdvance() - 1);
      sb.append("\"immediate\":\"").append(immediate.toHexString()).append("\",");
    }
    if (eip3155strict) {
      sb.append("\"gas\":\"").append(shortNumber(gas)).append("\",");
      sb.append("\"gasCost\":\"").append(shortNumber(thisGasCost)).append("\",");
    } else {
      sb.append("\"gas\":").append(Long.toUnsignedString(gas)).append(",");
      sb.append("\"gasCost\":").append(Long.toUnsignedString(thisGasCost)).append(",");
    }
    if (memory != null) {
      sb.append("\"memory\":\"").append(memory.toHexString()).append("\",");
    }
    sb.append("\"memSize\":").append(memorySize).append(",");
    if (showStack) {
      sb.append("\"stack\":[").append(commaJoiner.join(stack)).append("],");
    }
    if (showReturnData && !returnData.isEmpty()) {
      sb.append("\"returnData\":\"").append(returnData.toHexString()).append("\",");
    }
    sb.append("\"depth\":").append(depth).append(",");
    if (functionDepth > 0) {
      sb.append("\"functionDepth\":").append(functionDepth).append(",");
    }
    sb.append("\"refund\":").append(messageFrame.getGasRefund()).append(",");
    sb.append("\"opName\":\"").append(currentOp.getName()).append("\"");
    if (executeResult.getHaltReason() != null) {
      sb.append(",\"error\":\"")
          .append(executeResult.getHaltReason().getDescription())
          .append("\"");
    } else if (messageFrame.getRevertReason().isPresent()) {
      sb.append(",\"error\":\"")
          .append(messageFrame.getRevertReason().get().toHexString())
          .append("\"");
    }

    sb.append(storageString).append("}");
    out.println(sb);
  }
Long number as hex string.

@param number the number
@return the string
evm/src/main/java/org/hyperledger/besu/evm/tracing/StandardJsonTracer.java