Skip to main content

Persistent states

Nodes periodically store snapshots of the blockchain state. Each state is created at a specific MasterChain block and has a defined time-to-live (TTL). The selection of the block and TTL follows this algorithm:

Only key blocks can be selected. Let ts denote the block’s timestamp. Time is divided into periods of length 2^17 seconds (approximately 1.5 days). For a given block with timestamp ts, we calculate the period as x = floor(ts / 2^17). The first key block from each period is chosen to create a persistent state.

The TTL of a state from period x is calculated as 2^(18 + ctz(x)), where ctz(x) represents the number of trailing zeros in the binary representation of x (i.e., the largest integer y such that x is divisible by 2^y).

This means that persistent states are created every 2^17 seconds (~1.52 days). Half of these states have a TTL of 2^18 seconds (~3 days), while half of the remaining states have a TTL of 2^19 seconds (~6 days), and so forth.

In 2025, there will be several long-term persistent states, each lasting at least 3 months:

Block seqnoBlock time (UTC)TTL (approx. days)Expires at (UTC)
89307062021-01-14 15:08:4012427 days2055-01-24 08:45:44
277470862023-03-02 05:08:111553 days2027-06-02 19:50:19
369076472024-03-24 13:47:57776 days2026-05-10 07:09:01
408211822024-10-04 18:08:08388 days2025-10-28 02:48:40
437922092025-01-09 20:18:17194 days2025-07-23 00:38:33

When the node starts for the first time, it must download a persistent state. This process is implemented in the file validator/manager-init.cpp.

It selects the most recent key block that has a persistent state still available (using the formula mentioned above) and subsequently downloads the corresponding MasterChain state, along with the states for all shards, or if partial shard monitoring is enabled, only the configured shards.

Was this article useful?