This migration changes only the SS layer. It does not change the SC layer or
the app hash, so the change is invisible to the network.
Prerequisites
- A
seidbuild that supports theevm-ss-splitflag (Sei v6.5 or later). Older releases used the per-keyevm-ss-write-modeandevm-ss-read-modetoggles. If yourapp.tomlstill has those keys, upgradeseidbefore you continue. sc-enable = trueandss-enable = trueinapp.toml. Both must stay enabled.- A trusted RPC endpoint for state sync (the chain ID and trust-height source).
- Disk headroom for two SS databases. The EVM split does not duplicate data, but the old and new layouts may briefly coexist on disk during the migration.
evm-ss-split = true (see Step 2).
There is no in-place migration path and no live “dual-write then split”
workflow. The state sync wipes the local data directory and imports a fresh
snapshot into the new layout.
Benefits
- The node serves EVM reads only from a dedicated EVM SS database.
- Non-EVM modules no longer pay write amplification for EVM state.
What’s different about EVM SS
EVM SS is point-query only by design (Get and Has). For performance,
iteration is explicitly disabled on the EVM backend. The hot EVM read path is
tuned for direct key lookups, and cross-bucket scans would defeat the per-type
sub-DB layout. Any EVM read that needs iteration must stay on the Cosmos SS side.
Migration steps
Step 1: Update app.toml
Apply these settings in ~/.sei/config/app.toml:
copy
Step 2: State sync into the new layout
Giga SS Store is fully compatible with the existing P2P state-sync snapshot format. On import, the composite state store routes each snapshot node based on the importing node’sevm-ss-split:
- With
evm-ss-split = true, EVM snapshot nodes go only into EVM SS, and non-EVM nodes go only into Cosmos SS. - The import path normalizes legacy
evm_flatkvsnapshot nodes toevm, so it accepts snapshots from either the old or the new FlatKV module.
copy
Alternative: restore a data-directory snapshot from a Giga SS node
Unlike a state-sync snapshot, a data-directory snapshot (a tarball of~/.sei/data) depends on the SS layout. A tarball from a node that runs with
evm-ss-split = true holds a separate EVM SS directory:
data/state_store/evm/{backend}, or data/evm_ss on a node created before the
layout change. You can restore such a tarball and set evm-ss-split = true
instead of running state sync.
Set ss-backend, evm-ss-separate-dbs, ss-db-directory, and
evm-ss-db-directory to the values of the node that the snapshot came from.
Confirm these values with the provider before you restore. The SS paths include
the backend name. If ss-backend differs, the node opens empty SS directories.
It then starts with the restored SC data and an empty SS instead of refusing to
start. A tarball from a node without the EVM SS split does not work this way.
Use the state sync flow above instead.
Step 3: Verify the new layout
After the state sync completes and the node starts producing blocks, confirm that Giga SS Store is active in two places. Startup logs. All three lines should appear:debug_traceBlockByNumber is the cleanest end-to-end check.
It forces the node to read EVM state from the new EVM SS backend:
copy
"result" field, not an RPC error.
Safety checks
seid runs three DB-state checks at startup and refuses to start if the EVM SS
and Cosmos SS DBs are inconsistent. They specifically catch the mistake of
flipping evm-ss-split from false to true without a state sync.
- EVM SS directory missing or empty (before the EVM SS is opened). This
check applies when
evm-ss-split = true. If Cosmos SS already has committed history but the configured EVM SS directory is missing or empty, the composite state store refuses to proceed. The check fails before the sub-DBs are opened, so a rejected config does not leave a confusing empty directory behind. - EVM SS DB empty post-open, pre-recovery. This second safeguard for check 1
covers the case where the directory exists but its DBs are empty. The WAL
covers only the last
KeepRecentblocks, so replay cannot rebuild a fresh EVM SS from scratch. - Mismatched earliest versions, post-recovery. If the two DBs were populated from different snapshots (or pruned independently), historical reads would be inconsistent. A non-zero earliest-version divergence aborts startup.
evm-ss-split = false and restart. If the configured
EVM SS directory is stale from a failed attempt, remove it before the state sync.
Rollback
To roll back:- Set
evm-ss-split = falseinapp.toml. - Restart the node. The EVM SS DB is no longer opened but stays on disk until you remove it.
FlatKV EVM SC migration flow
Everything above concerns the SS (State Store) layer. The SC (State Commit) layer has a separate migration path. It moves the hotevm/ data out
of memiavl and into FlatKV in place, without a state sync.
Unlike the SS split, the SC migration changes how evm/ data contributes to
the app hash. The contribution moves from the memiavl IAVL root to the FlatKV
lattice hash. Every validator must therefore switch at the same block, or
consensus halts.
How the migration starts
Since v6.7.0, governance controls the migration, and nodes follow it without config changes:- By default, every node runs in the
autowrite mode. The node derives its mode from the migration state on disk. It checks thatsc-write-modehas a valid value, but it does not use the value. - The
NumKeysToMigratePerBlockparameter in themigrationparams subspace sets how many keys move per block. The default,0, keeps the migration paused. AParameterChangeProposalcan raise it to at most 1,000,000. - When the parameter becomes greater than
0, everyautonode switches frommemiavl_onlytomigrate_evmat the same height and starts to move keys. The node does not restart.
migrate_cosmos moves every other module, including bank/, from
memiavl to FlatKV. The same NumKeysToMigratePerBlock parameter paces both
phases. A node starts migrate_cosmos only while the MigrateCosmosEnabled
parameter in the migration subspace is true. The v6.8 upgrade sets it to
true. Setting it to false keeps nodes from starting migrate_cosmos, but it
does not stop a running one. To pause a running phase, set
NumKeysToMigratePerBlock to 0.
During the migration, the node reads and iterates over both backends. The
migration deletes a key from memiavl when it copies the key to FlatKV. If both
backends report a key, the node uses the memiavl value. The migration boundary
advances at most once per block. FlatKV has no proof builder, so the node stops
serving state proofs for the evm store when the EVM migration starts. When
migrate_cosmos starts, the same applies to every other store. Since v6.8.0,
the node also rejects every ABCI state-proof query unless you set
sc-enable-state-proof = true under [state-commit]. The default is false.
Pinning a write mode
To pin a write mode, set both keys in the[state-commit] section of
app.toml. The generated app.toml does not include
sc-write-mode-enable-auto, so add it yourself:
copy
memiavl_only does not take part in the migration. When
governance starts the migration, the pinned node diverges from the network.
Since v6.7.1, a node also refuses to start if a pinned mode disagrees with the
migration state on disk. The check covers migrate_evm, evm_migrated,
migrate_cosmos, and flatkv_only. The error starts with
write mode is pinned to. Since v6.8.0, sc-write-mode does not accept
migrate_all_but_bank, all_migrated_but_bank, or migrate_bank. A node with
one of these values refuses to start, even in auto mode. The cosmos_only
value from v6.4 and v6.5 app.toml files is still accepted as an alias for
memiavl_only.
Write modes
For the local Docker devnet,
GIGA_MIGRATE_FROM_MEMIAVL=true pins every node to
memiavl_only (with sc-write-mode-enable-auto = false), the starting point of
the devnet migration test. Do not set it together with
GIGA_STORAGE. If you set both, GIGA_MIGRATE_FROM_MEMIAVL takes precedence.
copy
Checking migration status
Theseidb migrate-evm-status subcommand reports the on-disk FlatKV EVM
migrate state of a FlatKV directory as JSON. It clones the latest snapshot and
WAL into a temporary directory before it reads. You can therefore run it against
a live node’s data directory without contending for the FlatKV writer lock.
copy
--db-dir (short -d) points at the FlatKV data directory. --height selects
a target version. The default, 0, selects the latest available version. The
JSON includes migrate_evm_complete (true after the migration finishes),
migration_version, version_at, and whether an in-flight boundary is still
present.
When the migration finishes, each node also emits a migration complete summary
log line and seidb_migration_* OpenTelemetry counters for the migrated keys
and bytes.
Importing EVM state from memIAVL into FlatKV
Theseidb import-flatkv-from-memiavl command populates a FlatKV store from an existing memIAVL tree. It is for nodes that move to the FlatKV EVM commit store without a state sync. Two safety properties matter:
- The import height must equal the latest memIAVL version. The command refuses a lower height, because the composite store’s version reconciliation would silently roll memIAVL back and truncate blocks. It also refuses a higher height. First, check the current version with
seidb memiavl-latest-version. If needed, roll memIAVL back to the target height before you import. - Overwriting existing committed FlatKV data requires the explicit
--forceflag.
auto write mode, the node does not use a FlatKV store that this
command creates. The store has no migration metadata, so the node starts in
memiavl_only. Once memIAVL is more than one block past the store, the node
deletes the store the next time it loads. For details, see
Automatic cleanup of a stale idle FlatKV directory.
Versions below the FlatKV history floor
FlatKV keeps a bounded window of history: its retained snapshots, plus the WAL from the oldest of them. That oldest snapshot is the history floor. FlatKV can rebuild any version from the floor through the latest committed version. Right after the migration kickoff, the floor is the seed snapshot that the kickoff creates. FlatKV cannot rebuild a version outside that range, so operations that need one fail:- Rollback. Since v6.7.1,
seid rollbackto a version below the floor fails before it rolls back any store. The error ends inuse state sync instead. Both memIAVL and FlatKV stay at their current version, so you can restart the node at its current height. To recover, resync the node with state sync instead of rolling back. For the full error, see Rollback target below the FlatKV history floor. - Historical proofs and state-sync snapshots. ABCI queries with
prove=trueand state-sync snapshots, such asseid snapshot --height, fail at a version below the floor. If FlatKV is the store that cannot rebuild the version, the error includesversion unreachable.
Automatic cleanup of a stale idle FlatKV directory
Since v6.7.1, inauto write mode, the node deletes a stale idle FlatKV
directory when it loads its commit store, for example at startup. A directory is
idle when it has no migration state. Examples are the seed that a migration
kickoff creates and a store that seidb import-flatkv-from-memiavl creates. An
idle directory is stale when its version is above memIAVL’s version, or more
than one block behind it. The next migration kickoff creates a fresh seed, so
deleting the directory is safe. When the node deletes a directory, it logs a
discarding stale idle flatkv directory warning with the memIAVL and FlatKV
versions and the directory path.
The node keeps an idle directory that is exactly one block behind memIAVL. A
torn kickoff commit leaves a store in that state: the node crashed between the
memIAVL and FlatKV commits of the kickoff block. The node rolls memIAVL back to
the directory’s version and replays the next block.
FAQ
Where do the data files live after migrating?
- Cosmos SS data uses
data/pebbledb/in the legacy layout anddata/state_store/cosmos/pebbledb/in the current layout. - EVM SS data uses
data/evm_ss/in the legacy layout anddata/state_store/evm/pebbledb/in the current layout. - Nodes created before the layout change keep their legacy paths automatically. A legacy directory takes precedence when it is present. New nodes use the current layout.
- A non-empty
ss-db-directoryorevm-ss-db-directoryoverrides the corresponding default path. - This migration does not change SC data (
memiavland FlatKV).
Does Giga SS Store change the app hash or consensus?
No. Giga SS Store changes only the SS layer, which does not affect the app hash. It is a per-node change that is invisible to the network.Can I migrate a validator node with this guide?
Not yet. This migration guide is for RPC nodes only.Can I migrate an archive node with this guide?
Not yet. Archive-node migration is out of scope for this guide.Can I toggle back to evm-ss-split = false after enabling it?
Yes, but a clean rollback requires another state sync. See the
Rollback section above.
Why can’t I just flip evm-ss-split = true on a running node?
The evm-ss-split = true setting requires the EVM SS DB to already contain the
full history that Cosmos SS has. A live flip would leave the EVM SS DB empty,
and the composite store refuses to fall back to Cosmos SS. The result would be
missing EVM state at query time. The safety checks above block this scenario at
startup.
Does Giga SS Store support historical proofs?
No, and neither does SeiDB. SS stores raw KVs and does not reconstruct IAVL-style proofs.Does enabling Giga Storage change the receipt backend?
In thelocalnode and rpcnode configuration scripts, setting
GIGA_STORAGE=true defaults RECEIPT_BACKEND to pebble unless you set
RECEIPT_BACKEND explicitly.
Since v6.8.0, rs-backend accepts only pebbledb (also called pebble). The
same applies to RECEIPT_BACKEND, which the scripts copy into rs-backend. The
node refuses to start with rs-backend = "littidx" and logs
receipt-store backend "littidx" cannot be selected from app.toml; it is opened by Giga through its own storage config.
If a v6.7 app.toml sets littidx, change it to pebbledb before you start
v6.8.0. Any other value, such as parquet, fails with
unsupported receipt-store backend "parquet"; supported: pebbledb.