Solana slot subscriptions send both slot and root. Which one should a progress chart use?

When receiving updates from a Solana node using slotSubscribe, each notification includes slot, parent, and root. slot is the slot the node has processed and reported; parent is that slot’s parent. root is the root slot at the time the node sends the notification.

These three fields answer different questions. To plot node processing progress, use slot. To retain the root progress reported by the node at that moment, use root. If you use the largest number in the notification as the root progress, the chart will prematurely mark slots the node has only just processed as rooted. Likewise, parent describes which parent slot the current slot connects to; it cannot replace root.

When storing the data, you can save these three fields together with the local receipt time. If the gap between two progress lines grows, compare the notifications subsequently sent by the same node. The slot difference is a difference in position; converting it directly into a fixed number of seconds would discard the timing information actually observed. To confirm a specific payment, separately verify the confirmation status and execution result of that transaction.

$SOL #SOL #Solana

Original documentation https://solana.com/developers/docs/rpc/websocket/slotsubscribe