Detect spec drift on Running nodes for mid-life SigningKey patch (and future validator mode switch)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- go, kubernetes
- Domain
- documentation, infrastructure
Research direction
Read internal/planner/planner.go at buildRunningPlan and buildNodeUpdatePlan, then trace SeiNodeStatus and the rollout-watch task. Verify the existing validate-signing-key and apply-statefulset flow before adding the integration coverage described in the issue. Done means SigningKey drift triggers a guarded rollout, status is stamped, the pod mounts the Secret, and the LLD and migration guide are updated.
Written by the indexing model from the issue text.
Description
Background
PR #136 shipped validator.signingKey.secret.secretName for the single-shot validator deployment use case — deploy a SeiNode with SigningKey set from creation and the controller mounts the Secret on the production StatefulSet pod.
What it explicitly does not support: patching SigningKey onto an already-Running validator. buildRunningPlan (internal/planner/planner.go:621-628) only detects image drift today, so a kubectl patch seinode --patch '{"spec":{"validator":{"signingKey":...}}}' against a Running node is a silent no-op — the pod doesn't restart, the Secret never mounts, the validator never starts signing. Documented in LLD §11.
Why this matters
Primary use case — zero-downtime migration cutover
The single-shot deployment in PR #136 trades cutover downtime (bootstrap-Job sync + StatefulSet catch-up) for implementation simplicity. For arctic-1 testnet this is fine; for pacific-1 the downtime envelope may not be acceptable. The original LLD §8 design was a two-phase cutover:
- Deploy
SeiNodewithoutsigningKey→ bootstrap + sync as a non-signing observer (zero risk, no downtime on the old EC2 validator) - Stop EC2 → wait M blocks → patch
signingKeyin → pod re-rolls with Secret mounted → seid signs
Phase 2 requires drift detection. Without it, the operator's choices are (a) accept the single-shot downtime, or (b) delete-and-recreate the SeiNode (which deletes the data PVC unless dataVolume.import is wired, costing the bootstrap+sync work).
Future use case — validator mode switch
A separate, larger ask: convert a Running fullNode SeiNode into a validator SeiNode by patching the spec (e.g., spec.fullNode → spec.validator with a signingKey). Same drift-detection mechanic, larger pod-spec surface (mode string in seid config, port configuration, probes). Out of scope for v1 of this issue, but the underlying machinery is identical — listing here so the design accommodates it additively.
Proposed mechanic
Reuse the existing NodeUpdate plan shape (buildNodeUpdatePlan at internal/planner/planner.go:656):
- Track applied state in
SeiNodeStatus. New field — likelyStatus.SigningKeyMountedSecret string— stamped byobserve-image(or a sibling task) when the StatefulSet rollout completes. For mode-switch, an analogousStatus.ObservedModewould track the currently-running mode. - Extend
buildRunningPlanto detect drift beyond image:if signingKeyDrift(node) { return buildSigningKeyUpdatePlan(node) } - Build a re-apply plan that runs
validate-signing-key(already present, gates on Secret correctness) →apply-statefulset(server-side apply triggers the rolling update) →observe-image-equivalent rollout watcher →mark-ready. Stamp the new applied state on completion.
The pod restart is the standard StatefulSet rolling update mechanic — no special "kill seid" step is needed. seid restarts naturally when the pod is replaced and reads the newly-mounted key file at startup.
Acceptance criteria (v1 — SigningKey drift only)
-
Status.SigningKeyMountedSecretfield added toSeiNodeStatusand stamped by the rollout-watch task on success -
buildRunningPlandetectsspec.validator.signingKey.secret.secretName != status.SigningKeyMountedSecretand triggers a re-apply plan - Re-apply plan includes
validate-signing-keyso Secret defects are caught before the pod rolls - Integration test: deploy SeiNode without SigningKey → reaches Running as observer → patch SigningKey in → pod restarts with Secret mounted → SigningKeyReady=True → StatefulSet has the volume + subPath mount
- LLD §8 updated to re-document the zero-downtime cutover flow as supported
-
.tide/validator-migration.mdupdated with both single-shot (existing, downtime) and zero-downtime cutover variants
Out of scope (for v1 of this issue)
- Mode switch (full-node → validator). Same drift-detection mechanic, larger surface; file as a follow-up once SigningKey drift is shipped and we have a concrete customer ask.
- Demoting a validator to non-signing (clearing
SigningKeyon a Running validator). Currently no field-level immutability blocks unset, but the workflow is unsupported per LLD §11. - Rotating
secretNameon a Running validator.secretNameis immutable byXValidation: self == oldSelf; rotating consensus key requiresMsgEditValidatorand is a coordinated on-chain operation, not a controller feature.
References
- PR #135 — merged LLD
- PR #136 — single-shot deployment shipped
- LLD §11 — Mid-life SigningKey patch deferred entry with implementation sketch
- .tide/validator-migration.md — Deferred → Zero-downtime cutover
- Dominant language
- Go
- Stars
- 1
- Forks
- 2
- Avg merge
- 2h 29m
- Merged PRs (30d)
- 56
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sei-protocol/sei-k8s-controller
-
Difficulty 5/5 Over a week Newbie friendliness 32/100
-
Difficulty 5/5 Over a week Newbie friendliness 32/100
sei-protocol/sei-k8s-controller#457 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
All issues in sei-protocol/sei-k8s-controller
Similar issues
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
blinklabs-io/bursa#904 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yanet-platform/ipfw-go#129 ·
-
bug confmap/provider/googlesecretmanagerprovider needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-collector-contrib#51273 · 2 comments ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100