Light Macro Sync
The light macro sync method, designed for efficient synchronization with the macro chain, is employed by both light and full nodes. This method facilitates easy synchronization with the macro chain while conserving storage space. Using the zero-knowledge proof generated by prover nodes, these nodes can skip a substantial part of the chain without compromising the validity of the data.
A zero-knowledge proof (ZKP) is a small and easy-to-verify proof that enables the peer to verify the correctness of all election macro blocks since the genesis block.
The light macro sync consists of three processes:
- Request the latest ZKP from a prover node. This proof covers the validity of the chain from genesis up to the latest election block.
- Request epoch IDs, along with the latest election block (if not already obtained via the proof) and any available checkpoint blocks.
- Monitor for new macro blocks, repeating the above steps as needed to stay updated with the latest election and checkpoint blocks.
Note that if, during step 1, a proof hasn’t yet been generated from the most recent election block, the node receives a proof on the prior election block and requests the epoch ID for the most recent one. This might happen as ZKPs takes a considerable amount of time to be generated by the prover node.