Crates.io | zksync_snapshots_applier |
lib.rs | zksync_snapshots_applier |
version | |
source | src |
created_at | 2024-07-14 04:21:58.888574 |
updated_at | 2024-07-14 04:21:58.888574 |
description | Library for applying ZKsync state snapshots |
homepage | https://zksync.io/ |
repository | https://github.com/matter-labs/zksync-era |
max_upload_size | |
id | 1302755 |
size | 0 |
zksync_snapshots_applier
Library responsible for recovering Postgres from a protocol-level snapshot.
(See node docs for a high-level snapshot recovery overview and snapshot creator docs for the snapshot format details)
storage_logs
and initial_writes
tables). This step has a configurable degree of concurrency to control speed – I/O load
trade-off.Recovery is resilient to stops / failures; if the recovery process is interrupted, it will restart from the same snapshot and will skip saving data that is already present in Postgres.
Recovery logic for node components (such as metadata calculator and state keeper) is intentionally isolated from Postgres recovery. A component requiring recovery must organize it on its own. This is motivated by the fact that at least some components requiring recovery may initialize after an arbitrary delay after Postgres recovery (or not run at all) and/or may be instantiated multiple times for a single node. As an example, both of these requirements hold for metadata calculator / Merkle tree.