Owner: @Youngjoon Lee

Reviewers: 🟨@Daniel Sanchez Quiros 🟨@Giacomo Pasini 🟒@David Rusu 🟒@Thomas Lavaur 🟨@Álvaro Castro-Castilla 🟒@Daniel Kashepava

Introduction

Nomos nodes continuously receive blocks from peers and maintain their chains in compliance with the Cryptarchia v1 Protocol Specification. As long as a node receives new blocks, it can eventually synchronize with the honest chain agreed upon by other nodes.

However, when a new node joins the network or an offline node comes back online after an extended period, it cannot reconstruct the chain solely by receiving only new blocks. These nodes must first catch up by either syncing from the genesis block or from a certain checkpoint block before they can start the regular consensus protocol.

This document specifies a protocol for nodes to synchronize with the honest chain efficiently without compromising security.

Overview

This protocol is based on the following security guarantees provided by Cryptarchia:

This protocol handles all of the following cases with a unified algorithm:

  1. Syncing from the genesis block

    This is used when a node wants to reconstruct the entire history by verifying all blocks.

  2. Syncing from a block for which the current local block tree contains all of its ancestors.

    This is applicable for resuming a previously paused sync.

  3. Syncing from a trusted block for which the current local block tree does not contain its parent β€” Checkpoint Sync.

    <aside> 🚧

    Checkpoint sync can be implemented efficiently once the implementation of β€£ is in place. For more details, please see Verifying the original block of an orphan proof.

    </aside>

    This is useful for a node that wants to start syncing from a checkpoint provided by a trusted source. The node fetches a LedgerState of a block that is considered immutable on the honest chain. Using this state as a starting point, the node reconstructs the block tree. Even if the fetched checkpoint is not on the latest honest chain, the protocol ensures that the node eventually catches up to the latest honest state.

Protocol

Synchronization Algorithm

This document describes the key functions to clarify the algorithm introduced above. For more details and examples, please read the executable specification.

Forward Synchronization

This is the first step of the synchronization algorithm. A node fetches blocks from its peers, starting from the slot of the local tip to the latest slot. Blocks are fetched in slot order and added to the local block tree, from which the honest chain is chosen by applying the fork choice rule.