You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
2.0 KiB

  1. ---
  2. order: 10
  3. ---
  4. # Fast Sync
  5. In a proof of work blockchain, syncing with the chain is the same
  6. process as staying up-to-date with the consensus: download blocks, and
  7. look for the one with the most total work. In proof-of-stake, the
  8. consensus process is more complex, as it involves rounds of
  9. communication between the nodes to determine what block should be
  10. committed next. Using this process to sync up with the blockchain from
  11. scratch can take a very long time. It's much faster to just download
  12. blocks and check the merkle tree of validators than to run the real-time
  13. consensus gossip protocol.
  14. ## Using Fast Sync
  15. To support faster syncing, Tendermint offers a `fast-sync` mode, which
  16. is enabled by default, and can be toggled in the `config.toml` or via
  17. `--fast_sync=false`.
  18. In this mode, the Tendermint daemon will sync hundreds of times faster
  19. than if it used the real-time consensus process. Once caught up, the
  20. daemon will switch out of fast sync and into the normal consensus mode.
  21. After running for some time, the node is considered `caught up` if it
  22. has at least one peer and it's height is at least as high as the max
  23. reported peer height. See [the IsCaughtUp
  24. method](https://github.com/tendermint/tendermint/blob/b467515719e686e4678e6da4e102f32a491b85a0/blockchain/pool.go#L128).
  25. Note: There are three versions of fast sync. We recommend using v0 as v2 is still in beta.
  26. If you would like to use a different version you can do so by changing the version in the `config.toml`:
  27. ```toml
  28. #######################################################
  29. ### Fast Sync Configuration Connections ###
  30. #######################################################
  31. [fastsync]
  32. # Fast Sync version to use:
  33. # 1) "v0" (default) - the legacy fast sync implementation
  34. # 2) "v2" - complete redesign of v0, optimized for testability & readability
  35. version = "v0"
  36. ```
  37. If we're lagging sufficiently, we should go back to fast syncing, but
  38. this is an [open issue](https://github.com/tendermint/tendermint/issues/129).