Skip to content

fix: revert default WriteMode to cosmos_only for stable seid v6.5.1#27

Merged
bdchatham merged 1 commit into
mainfrom
fix/revert-memiavl-default
May 27, 2026
Merged

fix: revert default WriteMode to cosmos_only for stable seid v6.5.1#27
bdchatham merged 1 commit into
mainfrom
fix/revert-memiavl-default

Conversation

@bdchatham
Copy link
Copy Markdown
Collaborator

Problem

sei-config v0.0.18 defaulted to memiavl_only which is correct for nightly/main seid but breaks seid v6.5.1 — the stable released version still uses cosmos_only and rejects memiavl_only. Both are deployed simultaneously.

Fix

  • defaults.go: revert WriteMode default to WriteModeCosmosOnly in both StateCommit and StateStore. Default tracks the stable released seid; nightly callers set an explicit memiavl_only override.
  • types.go: restore cosmos_only, dual_write, split_write to IsValid() — required because Validate() calls IsValid() on the default value; removing them made a valid v6.5.1 config fail validation.
  • version.json: v0.0.18v0.0.19

The v1→v2 migration still correctly renames cosmos_onlymemiavl_only for upgrade paths. CurrentVersion stays 2.

Un-defer condition: bump default back to memiavl_only when seid v6.6.0 ships with the write mode rename as a tagged release.

🤖 Generated with Claude Code

@cursor
Copy link
Copy Markdown

cursor Bot commented May 27, 2026

PR Summary

Medium Risk
Wrong defaults would break production nodes on v6.5.1 at startup/validation; the change is narrow but affects critical storage write routing configuration.

Overview
Aligns sei-config defaults and validation with stable seid v6.5.1, which still expects deprecated cosmos_only write modes and does not accept memiavl_only as the default.

Defaults in defaults.go set StateCommit and StateStore WriteMode back to WriteModeCosmosOnly (from memiavl_only), with comments that nightly/main should override explicitly until a future seid release ships the rename.

Validation in types.go treats deprecated v1 modes (cosmos_only, dual_write, split_write) as valid again so Validate() does not fail on out-of-the-box configs that match v6.5.1. The v1→v2 migration path still renames these to v2 names on upgrade.

Package version bumps v0.0.18 → v0.0.19 in version.json; tests in config_test.go reflect the restored validity of cosmos_only.

Reviewed by Cursor Bugbot for commit 1f8f69e. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown

Suggested version: v0.0.19

Comparing to: v0.0.18 (diff)

Changes in go.mod file(s):

(empty)

gorelease says:

panic: runtime error: invalid memory address or nil pointer dereference [recovered, repanicked]
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x60b0d2]

goroutine 172 [running]:
go/types.(*Checker).handleBailout(0x3c12d91b4200, 0x3c12d8e9fc30)
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/check.go:473 +0x91
panic({0x6ea840?, 0x98eba0?})
	/opt/hostedtoolcache/go/1.26.3/x64/src/runtime/panic.go:860 +0x13a
go/types.(*StdSizes).Sizeof(0x0, {0x759c68, 0x992360})
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/sizes.go:229 +0x312
go/types.(*Config).sizeof(...)
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/sizes.go:334
go/types.representableConst.func1(...)
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/const.go:77
go/types.representableConst({0x75ba60, 0x767908}, 0x3c12d91b4200, 0x992360, 0x3c12d8e9e9f0)
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/const.go:93 +0x1e9
go/types.(*Checker).representation(0x3c12d91b4200, 0x3c12d91d7840, 0x992360)
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/const.go:257 +0x5f
go/types.(*Checker).implicitTypeAndValue(0x3c12d91b4200, 0x3c12d91d7840, {0x759c68?, 0x992360?})
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/expr.go:404 +0x3ed
go/types.(*Checker).convertUntyped(0x3c12d91b4200, 0x3c12d91d7840, {0x759c68, 0x992360})
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/const.go:290 +0x3f
go/types.(*Checker).isValidIndex(0x3c12d91b4200, 0x3c12d91d7840, 0x34, {0x73bc58, 0x5}, 0x0)
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/index.go:425 +0x7b
go/types.(*Checker).index(0x3c12d91b4200, {0x75b518, 0x3c12d91f4270}, 0xffffffffffffffff)
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/index.go:396 +0xbd
go/types.(*Checker).indexExpr(0x3c12d91b4200, 0x3c12d91d7800, 0x3c12d92292c0)
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/index.go:207 +0x60e
go/types.(*Checker).exprInternal(0x3c12d91b4200, 0x0, 0x3c12d91d7800, {0x75af78, 0x3c12d91f42a0}, {0x0?, 0x0?})
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/expr.go:1092 +0xb97
go/types.(*Checker).rawExpr(0x3c12d91b4200, 0x0, 0x3c12d91d7800, {0x75af78?, 0x3c12d91f42a0?}, {0x0?, 0x0?}, 0x0)
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/expr.go:982 +0x18c
go/types.(*Checker).expr(0x3c12d91b4200, 0x75ac18?, 0x3c12d91d7800, {0x75af78?, 0x3c12d91f42a0?})
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/expr.go:1276 +0x30
go/types.(*Checker).assignVar(0x3c12d91b4200, {0x75ac18, 0x3c12d8d99420}, {0x75af78, 0x3c12d91f42a0}, 0x0, {0x73d744, 0xa})
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/assignments.go:272 +0x1af
go/types.(*Checker).assignVars(0x3c12d91b4200, {0x3c12d8d8e440?, 0x1, 0x410f07?}, {0x3c12d8d8e450, 0x40?, 0x3c12d8d98260?})
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/assignments.go:486 +0x2ea
go/types.(*Checker).stmt(0x3c12d91b4200, 0x0, {0x75b278, 0x3c12d8df03c0})
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/stmt.go:515 +0xb5c
go/types.(*Checker).stmtList(0x3c12d91b4200, 0x0, {0x3c12d8d99520?, 0x3c12d8dd6900?, 0x3c12d9190930?})
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/stmt.go:125 +0x85
go/types.(*Checker).funcBody(0x3c12d91b4200, 0x75ac18?, {0x3c12d8d74908?, 0x5?}, 0x3c12d91d6880, 0x3c12d91f4420, {0x0?, 0x0?})
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/stmt.go:42 +0x37b
go/types.(*Checker).funcDecl.func1()
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/decl.go:838 +0x3a
go/types.(*Checker).processDelayed(0x3c12d91b4200, 0x0)
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/check.go:595 +0x1e2
go/types.(*Checker).checkFiles(0x3c12d91b4200, {0x3c12d8e02068?, 0x5c4d45?, 0x993280?})
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/check.go:537 +0x3f9
go/types.(*Checker).Files(0x3c12d922e000?, {0x3c12d8e02068?, 0x3c12d8dd6960?, 0x6?})
	/opt/hostedtoolcache/go/1.26.3/x64/src/go/types/check.go:491 +0x75
golang.org/x/tools/go/packages.(*loader).loadPackage(0x3c12d922e000, 0x3c12d8d77380)
	/home/runner/go/pkg/mod/golang.org/x/tools@v0.2.0/go/packages/packages.go:1037 +0x8f2
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
	/home/runner/go/pkg/mod/golang.org/x/tools@v0.2.0/go/packages/packages.go:847 +0x1a7
sync.(*Once).doSlow(0x0?, 0x0?)
	/opt/hostedtoolcache/go/1.26.3/x64/src/sync/once.go:78 +0xac
sync.(*Once).Do(...)
	/opt/hostedtoolcache/go/1.26.3/x64/src/sync/once.go:69
golang.org/x/tools/go/packages.(*loader).loadRecursive(0x0?, 0x0?)
	/home/runner/go/pkg/mod/golang.org/x/tools@v0.2.0/go/packages/packages.go:835 +0x3b
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1(0x0?)
	/home/runner/go/pkg/mod/golang.org/x/tools@v0.2.0/go/packages/packages.go:842 +0x26
created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 168
	/home/runner/go/pkg/mod/golang.org/x/tools@v0.2.0/go/packages/packages.go:841 +0x8c

gocompat says:

Your branch is up to date with 'origin/main'.

Cutting a Release (and modifying non-markdown files)

This PR is modifying both version.json and non-markdown files.
The Release Checker is not able to analyse files that are not checked in to main. This might cause the above analysis to be inaccurate.
Please consider performing all the code changes in a separate PR before cutting the release.

Automatically created GitHub Release

A draft GitHub Release has been created.
It is going to be published when this PR is merged.
You can modify its' body to include any release notes you wish to include with the release.

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>
@bdchatham bdchatham force-pushed the fix/revert-memiavl-default branch from a05db9e to 1f8f69e Compare May 27, 2026 21:32
@bdchatham bdchatham merged commit bca2a0c into main May 27, 2026
4 checks passed
bdchatham added a commit to sei-protocol/seictl that referenced this pull request May 27, 2026
Picks up
[sei-config#27](sei-protocol/sei-config#27) —
reverts default `WriteMode` to `cosmos_only` so stable seid v6.5.1 nodes
don't break.

Paired with sei-k8s-controller#356 which adds explicit `memiavl_only`
overrides to nightly scenario SND templates.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant