# Synchronization

Synchronization brings the local node in sync with the network and feeds ready blocks into consensus.

## Phases

Archive and full nodes follow a fixed phase pipeline:

1. CatchUpRecoverBlockHeaderFromDB
2. CatchUpSyncBlockHeader
3. CatchUpCheckpoint
4. CatchUpFillBlockBodyPhase
5. CatchUpSyncBlock
6. Normal

Each phase drives specific network requests and graph updates.

## SynchronizationGraph

The sync graph stores all received headers and blocks and tracks their status:

* Header-only, graph-ready, block-ready.
* Parent and referee connectivity.
* Frontiers for not-ready blocks and old-era blocks.

Only blocks that are graph-ready and have full bodies are delivered to consensus.

## State sync

Snapshot-based state sync uses:

* Snapshot manifest requests.
* Chunk requests/responses.
* Candidate selection and restoration helpers.

## Key source files

* `crates/mazzecore/core/src/sync/synchronization_phases.rs`
* `crates/mazzecore/core/src/sync/synchronization_graph.rs`
* `crates/mazzecore/core/src/sync/message/mod.rs`
* `crates/mazzecore/core/src/sync/state/mod.rs`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mazze.io/architecture/synchronization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
