Snap Sync is an optimized “non-full sync” mode that allows a node to synchronize much faster by downloading state snapshots directly from peers.
- How it works: Instead of executing every historical transaction, the node identifies the current state and downloads the necessary data to fill its database. Features like snapshot maintenance and journaling are typically disabled during this initial phase to prevent conflicts and prioritize synchronization.
- Why it’s useful: It significantly reduces the time and computational resources required for a new node to become operational. It is ideal for operators who need to spin up a node quickly without waiting for years of transaction history to be processed.
Interaction with the Engine API
The chosen Sync Mode directly affects how the Consensus Layer (CL) interacts with the EL via the Engine API:
- Import Delays: If a node is in Snap Sync mode, the
engine_newPayloadendpoint will delay or reject block imports until the sync terminates. This is because Snap Sync assumes it is working with an empty database that it must fill itself, and concurrent out-of-band modifications from new blocks could cause corruption. - State Availability: In Full Sync, if an import fails, it usually indicates a missing parent state, which may trigger a BeaconSync to fetch missing headers and bodies from peers.