Sync Stages
The Solayer Chain synchronization process consists of two main phases: initial sync and incremental sync. During initial sync, a node retrieves snapshots from upstream peers (e.g., current leader node or verifier nodes) and downloads the most recent one to initialize its local Bank. After this bootstrap, the node transitions to incremental sync mode. In normal real-time mode, the node continuously receives slot-change notifications and their accompanying shreds via a stream, stores the shreds in an overlay database, and commits the data at each slot boundary while verifying correctness by recalculating the Bank’s root hash. When the stream fails to deliver consecutive slots, the node automatically enters repairing mode, fetching missing slots from upstream peers (or restarting from an initial snapshot if unavailable), replaying the recovered slots, re-validating the root hash, and then returning to real-time streaming. Failure handling follows a consistent pattern: dropped streams trigger repair and fresh stream creation; non-consecutive data from upstream initiates targeted repair before resuming real-time sync; and upstream data expiry that leaves queries empty is treated as fatal, prompting operators to clear local state and restart. Integrity is guaranteed by Solana-style state validation—each block hash is the SHA-256 of its parent hash concatenated with the Merkle-rooted account-state delta, signature count, and parent blockhash, while every account hash is derived from its serialized fields.Initial Sync
The initial synchronization phase bootstraps a new node:- Query for available snapshots from upstream peers.
- Download the latest snapshot to provision the Bank.
Incremental Sync
After initial sync, nodes enter incremental sync with two operational modes:Real-Time Mode
Normal operation mode for continuous synchronization:- Receive latest slot changes and shreds through real-time streaming from upstream peers.
- Save shreds to a database overlay.
- Store slot changes.
- Calculate root hash and validate.
- Merge the database overlay into the Bank.
Repairing Mode
Activated when the real-time stream doesn’t deliver consecutive slot changes or the root hash is inconsistent:- Fetch missing slots from upstream nodes.
- If missing slots are not found upstream, restart from initial sync.
- Replay slot changes.
- Calculate root hash and validate.
- Switch back to real-time mode.