feat: decouple snapshot generation from publishing#108
Merged
Conversation
Refactors SnapshotGenerationConfig to nest a TendermintSnapshotGenerationConfig sub-struct (extensible for future snapshot modes) with an optional Publish struct whose presence toggles S3 upload. Absence of Publish means snapshots are kept on disk only. Re-wires the existing seictl TaskTypeSnapshotUpload sidecar task as a fire-and-forget plan task, inserted into the init progression immediately before mark-ready only when Publish is set. Restores controller-side plumbing that was removed in #89 with the monitor-task subsystem, now as a plan task rather than a monitor task. Cross-field validation lives in each per-mode planner's Validate(node) hook, wrapping errors with its own mode prefix (fullNode: / archive:) — no shared helper takes a mode parameter. Rules: empty snapshotGeneration is rejected; keepRecent must be >= 2 when Publish is set (upload algorithm requires the second-to-latest snapshot). Implements the design in docs/design-snapshot-publish-config.md (merged via #107). No backward-compat concerns: product has not launched. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
bdchatham
commented
Apr 21, 2026
- Inline the snapshot-upload gate into buildBasePlan and buildPostBootstrapProgression; remove the maybeInsertSnapshotUpload helper (called in only two places, "maybe" prefix was unclear). - Trim validateSnapshotGeneration doc comment to a single line — the rules are self-evident from the code; only the caller-wrap convention is worth calling out. Tracking issue for the sei-config rename suggestion: sei-protocol/sei-config#6 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 21, 2026
bdchatham
added a commit
that referenced
this pull request
Apr 21, 2026
Refactors the flat ResultExportConfig into a wrapper around use-case sub-structs, following the pattern merged in #108. First (and currently only) use case is ShadowResultConfig, which carries the CanonicalRPC endpoint for app-hash divergence detection. Removes stale "monitor mode" / "scheduled mode" godoc that described a scheduled-export behavior that was never reachable (canonicalRpc is CRD-required via MinLength=1, so "without canonicalRpc" was never a valid input). Adds cross-field validation to replayerPlanner.Validate rejecting an empty resultExport wrapper, mirroring validateSnapshotGeneration at planner.go:331. Context-free helper, caller wraps with replayer: prefix — no shared helper takes a mode parameter. No sidecar code currently consumes ResultExport (was removed with the monitor-task subsystem in #89); this is a schema-only refactor to prepare for future use-case sub-structs without needing to rename existing fields. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the merged design in
docs/design-snapshot-publish-config.md(#107). Operators can now generate local Tendermint snapshots without also uploading them to S3, and the snapshot-config surface is shaped so future snapshot flavors slot in without renaming fields.SnapshotGenerationConfigto nest aTendermintSnapshotGenerationConfigsub-struct; added optionalPublishstruct whose presence enables S3 upload. Matches the existingStateSyncSource struct{}/SnapshotSourcepresence-as-toggle pattern already used incommon_types.go.TaskTypeSnapshotUploadsidecar task as a fire-and-forget plan task. Inserted into the init progression immediately beforemark-readyonly whenpublishis set. Restores controller-side plumbing that was deleted in feat: remove monitor task system #89 with the monitor-task subsystem, now as a plan task.snapshotGeneration,publish + keepRecent < 2) lives in each planner'sValidate(node)hook with its own mode-prefixed error (fullNode:/archive:). No admission webhook introduced; no shared helper takes a mode parameter.pacific-1-snapshotter.yaml,pacific-1-state-syncer.yaml) updated to the new shape, preserving their prior publishing behavior.make manifests generate; DeepCopy regenerated. No hand edits to generated files.Shape of the new surface
Verification
make build— succeedsmake lint— 0 issuesmake test— all packages passTest plan
publish: {}and observesnapshot-uploadappearing in.status.planbetweenconfig-validateandmark-readypublishomitted and confirmsnapshot-uploadis NOT in the plan; confirm seid still writes snapshots to the data volume at the configured intervalpublish: {}andkeepRecent: 1— expect the planner'sValidate()to reject with a clear error mentioning the upload algorithmsnapshotGeneration: {}(empty) — expect the planner'sValidate()to reject as a typo-shapemark-readymanifests/sei.io_seinodes.yamlandmanifests/sei.io_seinodedeployments.yamlfor the new nested shape🤖 Generated with Claude Code