Reconcile sei-config render with current seid binary; harden config writer (PLT-775 PR-A)#38
Conversation
…riter Bring the state-commit/state-store write/read modes to parity with the current seid binary and make the two-file write crash-consistent. - Leave StateCommit/StateStore WriteMode and ReadMode unset by default and add ,omitempty to their four legacy render tags, so a default render omits sc-write-mode/sc-read-mode/ss-write-mode/ss-read-mode and each seid binary applies its own native default. The valid values for these keys differ across binary versions, so no single rendered value boots every target; a caller that needs a specific mode still sets it explicitly. This also stops emitting three keys the current binary never reads. - Rewrite WriteConfigToDir as a staged commit: stage both files (encode + write + fsync to temps), commit both renames, then fsync the config dir and surface that error rather than swallowing it. - De-version the WriteMode.IsValid comments. - Add plain-Go tests: default-omission round-trip, explicit-set escape hatch, no-temp-residue, rs-backend guard. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PR SummaryMedium Risk Overview
Adds write-path tests (default omission round-trip, explicit write mode, no staging temp residue, Reviewed by Cursor Bugbot for commit 454cfa4. Bugbot is set up for automated code reviews on this repo. Configure here. |
Ships #38: default render omits the state-commit/state-store write/read modes so each seid binary applies its own native default, and the config writer stages both files before committing either. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Bumps sei-config v0.0.20 → v0.0.22 and cuts seictl v0.0.63. **Why:** every seictl release to date renders config-apply with sei-config ≤ v0.0.20, whose default emits `sc-write-mode = "cosmos_only"` — rejected at boot by current mainline seid builds (the PLT-775 crashloop shape; latest hit: harbor-engineering-workspace#91's replay node). sei-config v0.0.22 (sei-protocol/sei-config#38) leaves the write/read modes **unset** so the render omits the four mode keys entirely and each seid binary applies its own native default; explicitly-set modes still render. Full `go test ./...` green including `sidecar/tasks` (config-apply path). Downstream: platform controller-config sidecar digest bump to the v0.0.63 image (harbor/dev first; prod SeiNetwork pins staged separately). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Summary
Brings sei-config's rendered config to parity with the current seid binary and hardens the two-file writer. Foundation for the ConfigManager v2 generate path (PLT-775); no behavior change for existing consumers.
What changed
,omitemptyon the four legacy render tags. A default render now omitssc-write-mode,sc-read-mode,ss-write-mode,ss-read-mode, so each seid binary applies its own native default. Their valid values are disjoint across binary versions (v6.5.1 accepts{cosmos_only, dual_write, split_write}and rejectsmemiavl_only; nightly accepts{memiavl_only, migrate_*, flatkv_only, …}and rejectscosmos_only), so no single rendered literal boots every target — a shared opinionated default is what caused the PLT-775 boot-panic. Unset dissolves that: a v6.5.1 node still lands oncosmos_only, a nightly node onmemiavl_only, neither panics. A caller that needs a specific mode still sets it explicitly and it renders.sc-read-mode/ss-write-mode/ss-read-modehave no corresponding flag).WriteConfigToDirrewritten as a staged commit: stage both files (encode + write + fsync to temps), commit both renames, then fsync the config dir and surface that error rather than swallowing it (repo CLAUDE.md: every failure path returns an error).WriteMode.IsValidcomments; added plain-Go tests (default-omission round-trip, explicit-set escape hatch, no-temp-residue,rs-backendguard).Review
Independent multi-specialist xreview (cross-component, T3) — RESOLVED-WITH-ACCEPTED-RISK. Round-1 caught a first-pass default-flip as an incident mirror; pivoted to the unset structural cure and the dissenter (sei-network) re-verified → RATIFY. Consumer-grep across
sei-k8s-controller+seictlis clean (no consumer depends on these keys). Ledger:bdchatham-designs/designs/config-manager/xreview/seiconfig-pr-a.md.Accepted risk (documented, deferred): the two-rename commit has a narrow crash window that can leave config.toml-new / app.toml-old — each file individually valid, cross-file inconsistent. Self-healing (failed rename is always app.toml; run-mode lives in
SeiMeta.Mode; controller re-applies both files). Full close (backup + boot-time recovery) deferred until Phase 3's unified sei.toml slips and fleet-scale/incident, because Phase 3 removes the two-file root cause.Test plan
go test -race ./...greengolangci-lint run --new-from-rev=origin/main— 0 new issues (repo has a pre-existing lint baseline unrelated to this diff)