Skip to content

Commit a05db9e

Browse files
bdchathamclaude
andcommitted
fix: default write mode to cosmos_only for stable seid v6.5.1
v0.0.18 defaulted WriteMode to memiavl_only, which the stable released seid (v6.5.1) rejects with "invalid write mode: memiavl_only". Both v6.5.1 and nightly run simultaneously, so new nodes without explicit overrides broke on v6.5.1. The sei-config default tracks the stable released binary: v6.5.1 accepts cosmos_only. Nightly/main callers (SND templates) override to memiavl_only explicitly. Bump the default when 6.6.0 ships memiavl_only. This also corrects WriteMode.IsValid to accept the deprecated v1 modes (cosmos_only, dual_write, split_write): they are real values the stable binary consumes, not invalid input. The v1->v2 migration still renames them, so migrated configs converge on the v2 names. No DefaultForVersion abstraction is added — the binary-version axis is a single default value plus a caller override, which the existing override pipeline handles. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent fce3db8 commit a05db9e

5 files changed

Lines changed: 14 additions & 7 deletions

File tree

config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,8 @@ func TestWriteMode_Validity(t *testing.T) {
742742
if !WriteModeMemiavlOnly.IsValid() {
743743
t.Error("memiavl_only should be valid")
744744
}
745-
if WriteModeCosmosOnly.IsValid() {
746-
t.Error("cosmos_only should not be valid in v2 (deprecated — use migration)")
745+
if !WriteModeCosmosOnly.IsValid() {
746+
t.Error("cosmos_only should be valid (deprecated, but accepted by stable seid v6.5.1)")
747747
}
748748
if WriteMode("invalid").IsValid() {
749749
t.Error("'invalid' should not be valid")

defaults.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,12 @@ func baseDefaults() *SeiConfig {
115115
PruningInterval: "0",
116116
SnapshotKeepRecent: 2,
117117
IAVLDisableFastNode: true,
118+
// WriteMode tracks the stable released seid (v6.5.1), which accepts
119+
// cosmos_only and rejects memiavl_only. Nightly/main callers override
120+
// to memiavl_only. Bump this default when 6.6.0 ships memiavl_only.
118121
StateCommit: StateCommitConfig{
119122
Enable: true,
120-
WriteMode: WriteModeMemiavlOnly,
123+
WriteMode: WriteModeCosmosOnly,
121124
ReadMode: ReadModeCosmosOnly,
122125
},
123126
StateStore: StateStoreConfig{
@@ -128,7 +131,7 @@ func baseDefaults() *SeiConfig {
128131
PruneIntervalSeconds: 600,
129132
ImportNumWorkers: 1,
130133
KeepLastVersion: true,
131-
WriteMode: WriteModeMemiavlOnly,
134+
WriteMode: WriteModeCosmosOnly,
132135
ReadMode: ReadModeCosmosOnly,
133136
},
134137
ReceiptStore: ReceiptStoreConfig{

migrate_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ func TestDefaultMigrations_Valid(t *testing.T) {
380380

381381
// v1ToV2Migration returns the v1→v2 migration from DefaultMigrations for tests
382382
// that exercise the rename transform directly (bypassing post-migration
383-
// validation, which rejects unknown/deprecated WriteMode values).
383+
// validation, which rejects unknown WriteMode values).
384384
func v1ToV2Migration(t *testing.T) Migration {
385385
t.Helper()
386386
for _, m := range DefaultMigrations() {

types.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@ func (m WriteMode) IsValid() bool {
8989
switch m {
9090
case WriteModeMemiavlOnly, WriteModeMigrateEVM, WriteModeEVMMigrated,
9191
WriteModeMigrateAllButBank, WriteModeAllMigratedButBank,
92-
WriteModeMigrateBank, WriteModeFlatKVOnly, WriteModeTestOnlyDualWrite:
92+
WriteModeMigrateBank, WriteModeFlatKVOnly, WriteModeTestOnlyDualWrite,
93+
// Deprecated v1 modes remain valid: the stable released seid (v6.5.1)
94+
// still accepts them and rejects the v2 names. The v1→v2 migration
95+
// renames them; validation must not reject configs targeting v6.5.1.
96+
WriteModeCosmosOnly, WriteModeDualWrite, WriteModeSplitWrite:
9397
return true
9498
default:
9599
return false

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "v0.0.18"
2+
"version": "v0.0.19"
33
}

0 commit comments

Comments
 (0)