4

In the Polkadot node --help I see the following:

--sync <SYNC_MODE>
    Blockchain syncing mode.
    
    - `full`: Download and validate full blockchain history.
    - `fast`: Download blocks and the latest state only.
    - `fast-unsafe`: Same as `fast`, but skip downloading state proofs.
    - `warp`: Download the latest state and proof.
    
    [default: full]

    Possible values:
    - full:
    Full sync. Download end verify all blocks
    - fast:
    Download blocks without executing them. Download latest state with proofs
    - fast-unsafe:
    Download blocks without executing them. Download latest state without proofs
    - warp:
    Prove finality and download the latest state

Two questions:

  1. Is warp faster than fast sync?

  2. Is there ever a use case where I should use fast (or even full) instead of warp sync or is warp sync the better and recommended method for syncing a node?

If I understand correctly, warp sync does not check for transaction validity and does not need to because it uses justifications/finalization proofs.

1 Answer 1

6

Is warp faster than fast sync?

Yes, it is faster. Warp sync only verifies the Era changes from genesis to the tip of the chain. When reaching the tip of the chain, it will download the state for this block and after that the node will sync normally. In the background the node will then download all previous blocks to store them. Fast sync downloads all blocks from genesis to the tip of the chain without executing them. When reaching the tip of the chain the node will download the state for this block.

Both are doing similar things, but warp sync will get you faster a working node and it is also more secure as you verify the era changes.

Is there ever a use case where I should use fast (or even full) instead of warp sync or is warp sync the better and recommended method for syncing a node?

Currently warp sync in Substrate doesn't work for nodes with a db that already contains some blocks. However, in general you should always use warp sync. There are also some issues in the Substrate issue tracker to make warp sync the default syncing mode. You will need to use full sync mode if you want to sync an archive node.

If I understand correctly, warp sync does not check for transaction validity and does not need to because it uses justifications/finalization proofs.

Yes, warp sync only verifies the headers of the era changes.

1
  • Does Warp sync work with Aura consensus or is it only for Grandpa? Aug 2, 2023 at 17:27

Your Answer

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

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