Skip to content

Commit 054f398

Browse files
committed
gui: shred visualizaiton support
1 parent 08cea50 commit 054f398

File tree

6 files changed

+612
-149
lines changed

6 files changed

+612
-149
lines changed

book/api/websocket.md

Lines changed: 116 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,31 @@ errors.
318318
NOTE: this message is only supported on the Firedancer client, the
319319
Frankendancer client will always publish `null` for this message
320320

321+
#### `summary.catch_up_history`
322+
| frequency | type | example |
323+
|-----------|------------------|-----------|
324+
| *Once* | `CatchUpHistory` | see below |
325+
326+
This validator records a history of all slots that were received from
327+
turbine as well as slots for which a repair request was made while it is
328+
catching up. After catching up, slots are no longer recorded in this
329+
history.
330+
331+
::: details Example
332+
333+
```json
334+
{
335+
"topic": "summary",
336+
"key": "catch_up_history",
337+
"value": {
338+
"repair": [11, 12, 13, ...],
339+
"turbine": [21, 22, 23, ...]
340+
}
341+
}
342+
```
343+
344+
:::
345+
321346
#### `summary.startup_time_nanos`
322347
| frequency | type | example |
323348
|-----------|----------|---------------------|
@@ -1514,6 +1539,7 @@ initially replay one but the cluster votes on the other one.
15141539
| failed_vote_transactions | `number\|null` | Total number of failed vote transactions in the block. This should be near-zero in a healthy cluster |
15151540
| max_compute_units | `number\|null` | The maximum number of compute units that can be packed into the slot. This limit is one of many consensus-critical limits defined by the solana protocol, and helps keeps blocks small enough for validators consume them quickly. It may grow occasionally via on-chain feature activations |
15161541
| compute_units | `number\|null` | Total number of compute units used by the slot. Compute units are a synthetic metric that attempt to capture, based on the content of the block, the various costs that go into processing that block (i.e. cpu, memory, and disk utilization). They are based on certain transaction features, like the number of included signatures, the number of included signature verfication programs, the number of included writeable accounts, the size of the instruction data, the size of the on-chain loaded account data, and the number of computation steps. NOTE: "compute units" is an overloaded term that is often used in misleading contexts to refer to only a single part of the whole consensus-critical cost formula. For example, the getBlock RPC call includes a "computeUnitsConsumed" which actually only refers only the execution compute units associated with a transaction, but excludes other costs like signature costs, data costs, etc. This API will always use compute units in a way that includes ALL consensus-relevant costs, unless otherwise specified |
1542+
| shreds | `number\|null` | Total number of shreds in the successfully replayed block. Note value is only available in the Firedancer client and will be 0 or null in the Frankendancer client |
15171543
| transaction_fee | `string\|null` | Total amount of transaction fees that this slot collects in lamports after any burning |
15181544
| priority_fee | `string\|null` | Total amount of priority fees that this slot collects in lamports after any burning |
15191545
| tips | `string\|null` | Total amount of tips that this slot collects in lamports, across all block builders, after any commission to the block builder is subtracted |
@@ -1544,6 +1570,90 @@ immediately prior epoch. Recent non-rooted slots may be included, and
15441570
included skipped slots will not become unskipped as a later slot has
15451571
rooted.
15461572

1573+
#### `slot.live_shreds`
1574+
| frequency | type | example |
1575+
|-------------|---------------|---------|
1576+
| *10ms* | `SlotShred[]` | below |
1577+
1578+
The validator sends a continous stream of update messages with detailed
1579+
information about the time and duration of different shred state
1580+
transitions (i.e. shred events). A given event is only ever sent once
1581+
and is broadcast to all WebSocket clients.
1582+
1583+
:::details Example
1584+
1585+
```json
1586+
{
1587+
"topic": "slot",
1588+
"key": "shreds",
1589+
"value": {
1590+
"reference_slot": 289245044,
1591+
"reference_ts": "1739657041588242791",
1592+
"slot_delta": [0, 0],
1593+
"shred_idx": [1234, null],
1594+
"event": [0, 1],
1595+
"event_ts_delta": ["1000000", "2000000"]
1596+
}
1597+
}
1598+
```
1599+
1600+
:::
1601+
1602+
**`SlotShred`**
1603+
| Field | Type | Description |
1604+
|-----------------|--------------------|-------------|
1605+
| reference_slot | `number`   | The smallest slot number across all the shreds in a given message |
1606+
| reference_ts | `number`   | The smallest UNIX nanosecond event timestamp number across all the events in a given message |
1607+
| slot_delta | `number[]`   | `reference_slot + slot_delta[i]` is the slot to which shred event `i` belongs |
1608+
| shred_idxs | `(number\|null)[]` | `shred_idxs[i]` is the slot shred index of the shred for shred event `i`. If null, then shred event `i` applies to all shreds in the slot (i.e. this is used for `slot_complete`) |
1609+
| events | `string[]` | `events[i]` is the name of shred event `i`. Possible values are `repair_request`, `shred_received`, `shred_replayed`, and `slot_complete` |
1610+
| events_ts_delta | `string[]` | `reference_ts + events_ts_delta[i]` is the UNIX nanosecond timestamp when shred event `i` occured |
1611+
1612+
#### `slot.query_shreds`
1613+
| frequency | type | example |
1614+
|-------------|---------------|---------|
1615+
| *Request* | `SlotShred[]\null` | below |
1616+
1617+
| param | type | description |
1618+
|-------|----------|-------------|
1619+
| slot | `number` | The requested slot for which the reponse will provide shred timing data |
1620+
1621+
WebSocket clients may request historical shred metadata on a per-slot
1622+
basis. For slots that are too old (i.e. they've been expired from an
1623+
in-memory store) or too new (i.e. they haven't been finalized yet), the
1624+
response value will be `null`.
1625+
1626+
::: details Example
1627+
1628+
```json
1629+
{
1630+
"topic": "slot",
1631+
"key": "query_shreds",
1632+
"id": 32,
1633+
"params": {
1634+
"slot": 289245044
1635+
}
1636+
}
1637+
```
1638+
1639+
```json
1640+
{
1641+
"topic": "slot",
1642+
"key": "query_shreds",
1643+
"id": 32,
1644+
"value": {
1645+
"reference_slot": 289245044,
1646+
"reference_ts": "1739657041588242791",
1647+
"slot_delta": [0, 0],
1648+
"shred_idx": [1234, null],
1649+
"event": [0, 1],
1650+
"event_ts_delta": ["1000000", "2000000"]
1651+
}
1652+
}
1653+
```
1654+
1655+
:::
1656+
15471657
#### `slot.update`
15481658
| frequency | type | example |
15491659
|-------------|---------------|---------|
@@ -1675,7 +1785,8 @@ explicitly mentioned, skipped slots are not included.
16751785
"vote_transactions": 6746,
16761786
"failed_transactions": 3703,
16771787
"max_compute_units": 48000000,
1678-
"compute_units": 0
1788+
"compute_units": 0,
1789+
"shreds": 123
16791790
}
16801791
}
16811792
}
@@ -1720,7 +1831,8 @@ explicitly mentioned, skipped slots are not included.
17201831
"vote_transactions": 6746,
17211832
"failed_transactions": 3703,
17221833
"max_compute_units": 48000000,
1723-
"compute_units": 0
1834+
"compute_units": 0,
1835+
"shreds": 123
17241836
},
17251837
"waterfall": {
17261838
"in": {
@@ -1855,7 +1967,8 @@ explicitly mentioned, skipped slots are not included.
18551967
"vote_transactions": 6746,
18561968
"failed_transactions": 3703,
18571969
"max_compute_units": 48000000,
1858-
"compute_units": 0
1970+
"compute_units": 0,
1971+
"shreds": 123
18591972
},
18601973
"transactions": {
18611974
"start_timestamp_nanos": "1739657041688346791",

0 commit comments

Comments
 (0)