Skip to content

Commit aab659b

Browse files
committed
Squash into 1 commit
1 parent 8159acd commit aab659b

File tree

10 files changed

+70
-1
lines changed

10 files changed

+70
-1
lines changed

docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,7 @@
568568
"foundations/status",
569569
"foundations/phases",
570570
"foundations/fees",
571+
"foundations/traces",
571572
"foundations/shards",
572573
"foundations/limits",
573574
"foundations/config",
@@ -2121,4 +2122,4 @@
21212122
"permanent": true
21222123
}
21232124
]
2124-
}
2125+
}

foundations/traces.mdx

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
title: "Traces"
3+
---
4+
5+
import { Image } from '/snippets/image.jsx';
6+
7+
A trace is a partially ordered set of messages. This set includes all dependent messages. In other words, if message B was sent while message A was being processed, then both of these messages belong to exactly one trace. Strictly speaking, this set is partially ordered according to the causal relation “A is sent as a result of processing B.”
8+
9+
When drawing a trace, messages are usually drawn on the edges, and the addresses of the accounts to which the messages are sent are drawn at the vertices. Transactions that occurred on the account at that moment in time are also usually signed at the vertex.
10+
11+
### Start of the trace
12+
13+
Most often, a trace begins with an [external message](/foundations/messages/external). It is the first one, since there is no message that could generate an external-in. However, trace may be started not only by external messages but also by [tick-tock transactions](/foundations/messages/tick-tock), commonly used within TON Blockchain [system contracts](/foundations/messages/system). Traces can also start with split and merge transactions, but since they are not currently implemented, this will not occur in a real network.
14+
15+
<div
16+
className="flex justify-center my-4"
17+
>
18+
<Image
19+
src="/resources/images/rpc/trace_def_light.svg"
20+
darkSrc="/resources/images/rpc/trace_def_dark.svg"
21+
alt="Trace diagram"
22+
/>
23+
</div>
24+
25+
As a result, messages in the trace are partially 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. It is important to note that in the network in general, lt is formed as follows:
26+
27+
- lt transactions = lt incoming message + 1
28+
- lt outgoing message = lt transaction + outgoing message index
29+
This scheme is not applicable to the first vertex if the trace is started by special transactions mentioned above, as in that case there is no `incoming message` for the first vertex.
30+
31+
<Image
32+
src="/resources/images/rpc/traces_lt_light.svg"
33+
darkSrc="/resources/images/rpc/traces_lt_dark.svg"
34+
alt="Traces with logical time"
35+
/>
36+
37+
## Traces representation in Tonviewer
38+
39+
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.
40+
41+
## Examples
42+
43+
The NFT transfer illustrates a single operation that consists of multiple messages. To learn how to read traces, follow [this article](/ecosystem/explorers/tonviewer#steps-to-read-a-trace).
44+
45+
This trace is started with an external message and can be inspected in [Tonviewer](https://tonviewer.com/transaction/47d0989633fc03ff3fdca05880ab5760d0321c196501a6a4cbb5578dea2624cb)
46+
47+
<Image
48+
src="/resources/images/rpc/nft_transfer_trace_light.png"
49+
darkSrc="/resources/images/rpc/nft_transfer_trace_dark.png"
50+
alt="NFT transfer trace"
51+
/>
52+
53+
Here is the example of the trace that started with tick-tock transaction
54+
55+
<Image
56+
src="/resources/images/rpc/tick_tock_initiated_trace_light.png"
57+
darkSrc="/resources/images/rpc/tick_tock_initiated_trace_dark.png"
58+
/>
59+
60+
This trace can be also inspected in [Tonviewer](https://tonviewer.com/transaction/9effb91e18be732033fe6aa8c39941f26f5e9566848bc487aa7c6bfecdd9d89d).
61+
62+
## Access using API
63+
64+
To fetch traces data, use the [`GET /traces`](/ecosystem/api/toncenter/v3/actions-and-traces/list-actions-by-filters-tx-msg-trace) endpoint. This method allows finding a trace if any of its parameters are known.
156 KB
Loading
154 KB
Loading
148 KB
Loading
118 KB
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

resources/images/rpc/traces_lt_dark.svg

Lines changed: 1 addition & 0 deletions
Loading

resources/images/rpc/traces_lt_light.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)