24

A follow-up of one of the classic questions on this site:

One of the answers to this question suggested using Geth's --fast flag to help quickly synchronise the block data.

Now, parity comes with a --warp flag to enable synchronization in 10 minutes.

--warp        Enable syncing from the snapshot over the network. (default: false)

How does the --warp flag work, and how does using it speed up the synchronisation? Are we syncing less data, or are we in some way performing fewer checks on its integrity or source?

1
  • Why now parity warp on Syncing snapshot 3306/3306 and make sync from block #8030000 its very slow sync to last block - highestBlock: 8719236 with my speed 0.20 blk/s need 40 days :( How to warp to last block ? I delete database and restart parity, but it always warp to 8030000 :(
    – Uranik
    Sep 4, 2019 at 10:08

1 Answer 1

20

It's difficult to give an answer without just re-hashing the explanation on the Parity wiki...

The pertinent part is as follows:

These snapshots can be used to quickly get a full copy of the state at a given block. Every 30,000 blocks, nodes will take a consensus-critical snapshot of that block's state. Any node can fetch these snapshots over the network, enabling a fast sync.

The snapshot itself is comprised of 3 parts:

  1. A manifest, which is basically metadata about the snapshot;
  2. Block chunks, which contain raw block data about blocks and their transaction receipts;
  3. State chunks, which contain data about the state at a given block.

Chunks are currently set to 4MB in size.

So how does this actually speed up the sync? What that wiki page doesn't say is that we only sync the snapshots initially. So for each block at intervals of 30,000, we obtain a set of 4MB chunks. Then in the background we continue to sync the remaining block data.

This is equivalent to Geth's --fast sync, which first syncs the block headers, and then in the background syncs the rest of the data. It's just that --warp is syncing even less data on the first pass, and filling in the bigger gaps later on.

Edit:

See also the relevant official Ethcore blog post, specifically the section entitled Core Strength.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.