Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Synchronization

Node synchronization is the process by which a node that has never connected to the Algorand Network, or has fallen behind the current blockchain state, synchronizes itself with the latest state of the Ledger.

Depending on the trade-off between node’s trust model and synchronization time, the synchronization process can be performed either:

  • From the Genesis Block: this synchronization process minimizes the trust model, reducing it just to the Genesis Block, but it is slower and requires a longer sync time.

  • From a Ledger Catchpoint: this light synchronization process, also known as Fast Catchup is based on a recent snapshot of the Algorand Ledger, so it has a shorter sync time, but it requires trust in the Catchpoint file provider.

Regular Synchronization

Node Synchronization

The degree of trust in the block validation process can be tuned with the CatchupBlockValidateMode configuration parameter.

Fast Catchup

The Fast Catchup synchronization is done by downloading a Catchpoint, consisting of a Catchpoint Label and Catchpoint File, from a trusted source that maintains an up-to-date snapshot of the Algorand Ledger and applying a batch of catchup data.

This snapshot corresponds to a specific Ledger instance, defined by its Genesis (i.e., the initial block — see the Algorand Ledger specification).

Catchpoints default generation interval is \( 10{,}000 \) blocks:

  • Catchpoint Labels can be generated even by Non-Archival Nodes by setting CatchpointTracking: 1: in the node configuration,

  • Catchpoint Files can be generated by Archival Nodes by setting CatchpointTracking: 2 in the node configuration.

Instead of replaying the entire transaction history from the Genesis Block, the Fast Catchup allows the node to skip ahead efficiently, becoming operational with minimal delay.

📎 EXAMPLE

To generate Catchpoints “in-house”, users need an Archival Node, and override the gossip lookup to force it to download the Catchpoint File from their local server on the gossip port (usually 4160). Using the algod CLI:

goal node catchup <catchpoint label> -d data -p ip_of_user_server:gossip_port

⚙️ IMPLEMENTATION

Catchup reference implementation.

Catchpoint Labels reference implementation.

Catchpoint Tracking Modes configuration.

Node Fast Catchup

The diagram below illustrates the Fast Catchup process and how it interacts with other node components, including the HTTP API and the internal Catchup Service.

sequenceDiagram
    participant Goal CLI
    participant HTTP API
    participant Node
    participant Catchup Service

    Goal CLI ->> HTTP API: POST <br/> /v2/catchup/
    HTTP API ->> Node: Start Catchup
    Note over Node: Lock node
    activate Node
    Node ->> Catchup Service: Start Catchup
    activate Catchup Service
    loop Until finish, error or abort
        Catchup Service ->> Catchup Service: Handle next stage
    end
    Catchup Service ->> Node: returns
    deactivate Catchup Service
    Note over Node: Unlock node
    deactivate Node

This process ensures consistency and prevents interference from other operations while the node updates its internal state. Once catchup completes, the node can resume normal operations such as block processing and serving API requests.