Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@
"foundations/status",
"foundations/phases",
"foundations/fees",
"foundations/traces",
"foundations/shards",
"foundations/limits",
"foundations/config",
Expand Down Expand Up @@ -1680,4 +1681,4 @@
"destination": "/contribute"
}
]
}
}
59 changes: 59 additions & 0 deletions foundations/traces.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
title: "Traces"
---

import { Aside } from "/snippets/aside.jsx";
import { Image } from '/snippets/image.jsx';

A trace is a set of messages and transactions produced by a single external message.

Each _i-th_ transaction in the trace is triggered by a message sent during the action phase of some earlier _j-th_ transaction, where _j \< i_.

<div
className="flex justify-center my-4"
>
<Image
src="/resources/images/rpc/trace_def_light.svg"
darkSrc="/resources/images/rpc/trace_def_dark.svg"
alt="Trace diagram"
/>
</div>

All messages and transactions in the trace are ordered by their [logical time (lt)](/foundations/whitepapers/tblkch#1-4-1-logical-time), reflecting their logical dependencies. The diagram shows transactions on independent accounts, each triggered by an incoming message, with `lt` values indicated for every message.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're ordered by which messages sent which. Logical time is not used directly to order the trace.


<Image
src="/resources/images/rpc/traces_lt_light.svg"
darkSrc="/resources/images/rpc/traces_lt_dark.svg"
alt="Traces with logical time"
/>

<Aside
type={"note"}
>
Transactions may be triggered not only by external messages but also by [tick-tock](/foundations/whitepapers/tblkch#4-2-4-kinds-of-transactions) events, commonly used within internal TON Blockchain contracts, such as governance or elector contracts.

**Example:** [Tick-tock initiated trace](https://tonviewer.com/transaction/c386d3f7cc797aeb4d126a17da9055e47e79a1bce73262e8d665d94636f97bdc).
</Aside>

## Using traces in Tonviewer

In [Tonviewer](https://tonviewer.com/), traces are visualized as [directed acyclic graphs (DAGs)](https://en.wikipedia.org/wiki/Directed_acyclic_graph), where _transactions are nodes_ and _messages are edges_, showing the full sequence of account state changes triggered by a single external message.

### Tracing operations

Traces show the execution flow of an operation, such as a Jetton or NFT transfer, illustrating how transactions and messages connect to produce the final result. Each trace is an automatically generated tree of related transactions derived from message propagation.

**Example**

The NFT transfer illustrates a single operation that consists of **three transactions**, each triggered by messages. To learn how to read traces, follow [this article](/ecosystem/explorers/tonviewer#steps-to-analyze-an-operation).
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[HIGH] Broken internal anchor to Tonviewer section

The in-doc link points to /ecosystem/explorers/tonviewer#steps-to-analyze-an-operation, but the target page’s actual heading is “Steps to read a trace,” which renders as the anchor #steps-to-read-a-trace. This makes the link 404/misdirect, which is release‑blocking. Evidence: ecosystem/explorers/tonviewer.mdx:55-56 shows the heading “### Steps to read a trace” (out-of-diff reference).

Suggested change
The NFT transfer illustrates a single operation that consists of **three transactions**, each triggered by messages. To learn how to read traces, follow [this article](/ecosystem/explorers/tonviewer#steps-to-analyze-an-operation).
The NFT transfer illustrates a single operation that consists of **three transactions**, each triggered by messages. To learn how to read traces, follow [this article](/ecosystem/explorers/tonviewer#steps-to-read-a-trace).

Please leave a reaction 👍/👎 to this suggestion to improve future reviews for everyone!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why "three transactions" is so important that reader's attention has to be attracted during the skimming of the article text?


<Image
src="/resources/images/rpc/nft_transfer_trace_light.png"
darkSrc="/resources/images/rpc/nft_transfer_trace_dark.png"
alt="NFT transfer trace"
/>

## Access using API

To fetch transaction data, use the [`GET /traces`](/ecosystem/api/toncenter/v3/actions-and-traces/list-actions-by-filters-tx-msg-trace) endpoint.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[HIGH] API endpoint label/link mismatch misleads readers

The text label says “GET /traces” but links to the Actions reference page, which defines openapi: get /api/v3/actions. The correct Traces reference (matching the label) is list-completed-traces-with-actions.mdx, which defines openapi: get /api/v3/traces. Evidence: ecosystem/api/toncenter/v3/actions-and-traces/list-actions-by-filters-tx-msg-trace.mdx:1-3 (actions) and ecosystem/api/toncenter/v3/actions-and-traces/list-completed-traces-with-actions.mdx:1-3 (traces).

Suggested change
To fetch transaction data, use the [`GET /traces`](/ecosystem/api/toncenter/v3/actions-and-traces/list-actions-by-filters-tx-msg-trace) endpoint.
To fetch transaction data, use the [`GET /traces`](/ecosystem/api/toncenter/v3/actions-and-traces/list-completed-traces-with-actions) endpoint.

Please leave a reaction 👍/👎 to this suggestion to improve future reviews for everyone!

This method returns all transactions related to a given operation without requiring individual parsing.
Binary file added resources/images/rpc/nft_transfer_trace_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/images/rpc/trace_def_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/images/rpc/trace_def_light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/images/rpc/traces_lt_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/images/rpc/traces_lt_light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.