Secret: State Sync
State-sync is a module built into the Cosmos SDK to allow validators to rapidly join the network by syncing your node with a snapshot enabled RPC from a trusted block height.
Official Docs:
State-Sync
State-sync is a module built into the Cosmos SDK to allow validators to rapidly join the network by syncing your node with a snapshot enabled RPC from a trusted block height.
This greatly reduces the time required for a validator or sentry to sync with the network from days to minutes. The limitations of this are that there is not a full transaction history, just the most recent state that the state-sync RPC has stored. An advantage of state-sync is that the database is very small in comparison to a fully synced node, therefore using state-sync to re-sync your node to the network can help keep running costs lower by minimizing storage usage.
By syncing to the network with state-sync, a node can avoid having to go through all the upgrade procedures and can sync with the most recent binary only.
NOTE: For nodes that are intended to serve data for dapps, explorers, or any other RPC requiring full history, state-syncing to the network would not be appropriate.
Mainnet State Sync
Lavender.Five Nodes and SecretNFT are operating and maintaining the snapshot RPCs.
This documentation assumes you have followed the instructions for Running a Full Node.
The state-sync configuration is as follows:
Assign And Verify Variables
Set the state-sync BLOCK_HEIGHT
and fetch the TRUST_HASH
from the snapshot RPC. The BLOCK_HEIGHT
to sync is determined by finding the latest block that's a multiple of snapshot-interval.
Set Variables In ~/.secretd/config/config.toml
Reset Database And Stop Node
⚠️ This will erase your node database. If you are already running validator, be sure you backed up your `config/priv_validator_key.json` and `config/node_key.json` prior to running `unsafe-reset-all`.
It is recommended to copy data/priv_validator_state.json
to a backup and restore it after unsafe-reset-all
to avoid potential double signing.
Set IAVL-disable-fastnode
IAVL fast node must be disabled, otherwise the daemon will attempt to upgrade the database while state sync is occuring.
Increase Swap Space
Restart Node And Check Logs
This generally takes several minutes to complete, but has been known to take up to 24 hours. To better help the process along, add seeds.
Last updated