Skip to main content
Use state sync to start a new full node and join an existing network quickly.

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.
Set ss-backend = "pebbledb" before you start state sync. This is especially important if you rebuild a node that previously used RocksDB. RocksDB support for the SeiDB state store will be removed, and there is no published target release for the removal. For the full migration checklist, see Move off RocksDB.
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.
If your Sei home directory is $HOME/.sei, back up priv_validator_key.json and priv_validator_state.json:
Reset the state:
Finally, remove the existing data and wasm folders and restore priv_validator_state.json. Before you remove them, print the state-store section from app.toml:
If 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. For STATE_SYNC_RPC, use one of these endpoints:
  • Sei Mainnet (pacific-1): https://sei-rpc.polkachu.com:443 or https://rpc.sei-apis.com:443
  • Sei Testnet (atlantic-2): https://sei-testnet-rpc.polkachu.com:443 or https://rpc-testnet.sei-apis.com:443
For STATE_SYNC_PEER, use these values as persistent-peers:
  • Sei Mainnet (pacific-1):
  • Sei Testnet (atlantic-2):
The script sets 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
Confirm that the script output includes ss-backend = "pebbledb". If the key is missing, add it directly below [state-store] before you start seid. Finally, start the daemon:

Trust period

Since v6.7.3, state sync uses a trust period built into seid for each chain: 112h on Sei Mainnet, Sei Testnet, and the arctic-1 devnet, and 168h on other chains. The block that you set with trust-height and trust-hash must fall within this period. The script above picks a trust height within the last 100,000 blocks, which is well inside it. seid ignores trust-period in the [statesync] section of config.toml. If the key is present, seid logs this warning at startup: statesync.trust-period is set in config.toml, but state sync uses the trust period built into seid for this chain; the setting is ignored and can be removed. Remove the key to clear the warning.

Snapshot format

Since v6.8.0, nodes produce state-sync snapshots in format 2 and restore formats 1 and 2. Earlier releases reject format 2 snapshots, so state sync a node with the current release.

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 get AppHash 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.