State sync
State sync lets a new node join a network without fetching and replaying all historical blocks. Instead, the node fetches a snapshot of the application state at a recent height. This can reduce the time to sync with the network from days to minutes.Do not use state sync to migrate an archive node. State sync starts from a recent height and does not preserve the earlier state-store versions. Follow the archive-node guidance in Move off RocksDB.
Clean up
If the node is not new, back up and clean up the existing node first.Skip this step on a new node.
$HOME/.sei, back up priv_validator_key.json and priv_validator_state.json:
priv_validator_state.json. Before you remove them, print the state-store section from app.toml:
ss-db-directory or evm-ss-db-directory points outside
$HOME/.sei/data, back up what you need from that directory. Then clear the
old state-store data there too. The commands below do not remove custom
directories. A PebbleDB state sync must not reuse RocksDB data.
Statesync script
Set up the RPC servers for the primary and secondary endpoints. You can use one of these RPC endpoints for state sync. ForSTATE_SYNC_RPC, use one of these endpoints:
- Sei Mainnet (pacific-1):
https://sei-rpc.polkachu.com:443orhttps://rpc.sei-apis.com:443 - Sei Testnet (atlantic-2):
https://sei-testnet-rpc.polkachu.com:443orhttps://rpc-testnet.sei-apis.com:443
STATE_SYNC_PEER, use these values as persistent-peers:
- Sei Mainnet (pacific-1):
- Sei Testnet (atlantic-2):
trust_height and trust_hash automatically. Each state sync snapshot is taken at a specific block height. The script follows best practice and sets the trust height earlier than the latest snapshot block height. This avoids backward verification.
Use this script:
state_sync.sh
ss-backend = "pebbledb". If the key
is missing, add it directly below [state-store] before you start seid.
Finally, start the daemon:
Troubleshooting statesync
Q: I cannot connect to the state sync URL. A: Try a different state sync URL, and report the problem in the Sei Tech Chat. Q: State sync finishes, but I getAppHash errors as soon as regular block sync starts.
A: Make sure that you use the latest version of the chain node when you run state sync.
Q: State sync stops at random.
A: State sync is sometimes unreliable. If it stops, start it again. It can take approximately 4 to 5 attempts. If you still have problems, ask for help in the Sei Tech Chat.