feat: v1→v2 config schema migration for seid v6.5 write mode rename#25
Conversation
seid v6.5 (sei-chain commit 0412e4e84) replaced the WriteMode enum to model the FlatKV migration lifecycle. cosmos_only → memiavl_only is now the breaking change that crashes any node provisioned with the old default. Changes: - types.go: add v2 WriteMode constants (memiavl_only, migrate_evm, evm_migrated, migrate_all_but_bank, all_migrated_but_bank, migrate_bank, flatkv_only, test_only_dual_write); update IsValid() to v2 values; keep v1 constants as Deprecated for migration reference - defaults.go: change StateCommit and StateStore WriteMode defaults from WriteModeCosmosOnly → WriteModeMemiavlOnly - config.go: bump CurrentVersion 1 → 2 - migrate.go: register v1→v2 migration (renames cosmos_only, dual_write, split_write in both StateCommit and StateStore WriteMode); add SeidVersionForSchema map so each schema version is traceable to its seid version boundary - config_test.go: update TestWriteMode_Validity for v2 semantics Fixes: #24 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
PR SummaryMedium Risk Overview Write modes are redefined: new v2 constants ( A v1→v2 migration renames legacy values in both storage write fields ( Reviewed by Cursor Bugbot for commit 8dc28b5. Bugbot is set up for automated code reviews on this repo. Configure here. |
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- types.go: remove WriteModeEVMOnly — never a real deployed value, had no migration target (would fail IsValid() after migration) - migrate.go: delete SeidVersionForSchema exported var (YAGNI — no programmatic consumer); fold version mapping into doc comment - validate.go: add SeverityWarning for test_only_dual_write — valid per IsValid() to match seid's own parser, but explicitly flagged since sei-chain marks it "CRITICAL: never deploy to production" Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8dc28b5. Configure here.
Picks up [sei-config#25](sei-protocol/sei-config#25) — v1→v2 write mode migration for seid v6.5. **What changes:** - Default `WriteMode` is now `memiavl_only` (was `cosmos_only`) - Nodes with v1 configs (`cosmos_only`, `dual_write`, `split_write`) are automatically migrated on startup via `DefaultMigrations()` **Why:** The nightly seid image rejects `cosmos_only` with `invalid state-commit.sc-write-mode "cosmos_only"`, crash-looping all 13 chaos scenario validators. This fix makes the sidecar emit `memiavl_only` for all new and migrated nodes. All tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

Summary
Fixes #24. Unblocks all nightly chaos experiment validators currently crash-looping with
invalid state-commit.sc-write-mode "cosmos_only".What changed
types.go— v2 WriteMode constants matching sei-chain v6.5:WriteModeMemiavlOnly = "memiavl_only"(new default)migrate_evm,evm_migrated,migrate_all_but_bank,all_migrated_but_bank,migrate_bank,flatkv_only,test_only_dual_write// Deprecated:for migration use; removed fromIsValid()defaults.go—WriteMode: WriteModeCosmosOnly → WriteModeMemiavlOnlyin bothStateCommitandStateStoreconfig.go—CurrentVersion: 1 → 2migrate.go— v1→v2 migration: mapscosmos_only→memiavl_only,dual_write→migrate_evm,split_write→evm_migratedin both WriteMode fields. AddsSeidVersionForSchemamap so each schema version is traceable to its seid version boundary:Note on ReadMode
ReadMode(sc-read-mode) was removed from sei-chain'sStateCommitConfigin v6.5. The field is kept in sei-config for backward compat and will be silently ignored by seid. A follow-on migration can remove it when sei-config drops pre-v6.5 support.🤖 Generated with Claude Code