Local State Sync
In Cronos v1.0.12, we introduced a new set of commands to do local state sync, the full command help screen is:
Local State Sync
Before we dive into local state sync, let's understand a "normal" state sync first. After you setup state-sync in config and start the node, the node will do the following procedure:
Discover snapshots on the p2p network.
Verify the snapshot metadata by verifying the block headers between the snapshot and the trusted block height.
Download snapshot chunks from the p2p network.
Restore app state from the downloaded snapshot chunks.
Bootstrap cometbft state.
Start normal sync.
With a "normal" state sync, the procedure is done automatically on startup, it works great when the state is small, but as the chain grows, the procedure becomes slow and unstable.
The new local state sync commands try to break down this procedure into smaller steps:
Discover and download snapshots from out-of-band communications, for example community shared snapshots on a http server.
User downloads shared snapshots and imports into the local snapshot database.
Restore app state from the snapshot (this step is much faster with MemIAVL than current iavl):
3a. (Optional) If you want to enable versiondb together, you need to restore the versiondb from the snapshot as well:
Verify and bootstrap cometbft state based on current app state and state sync configuration:
This step requires the
statesync.*
configurations inconfig.toml
, to be the same as you would setup for a "normal" state sync.Start the node and sync normally.
Snapshot Provider
Alternatively, a snapshot provider can dump local snapshots into a portable tarball which can be shared across the network:
Normally the snapshots are generated automatically using config state-sync.snapshot-interval
, with these new commands, one can also manually export arbitrary versions of the state.
Last updated