feat: environment-driven snapshot restore with targetHeight selection#51
Merged
feat: environment-driven snapshot restore with targetHeight selection#51
Conversation
Refactor snapshot restore to derive S3 bucket/region/chainID from
environment variables (matching the genesis convention). The only task
param is now targetHeight:
- targetHeight > 0: lists S3 objects, picks highest snapshot <= target
- targetHeight == 0: reads latest.txt for newest snapshot
Changes:
- SnapshotRestoreRequest: remove Bucket/Prefix/Region/ChainID, add TargetHeight
- NewSnapshotRestorer: takes bucket/region/chainID from env at construction
- Add resolveKeyForHeight with S3 ListObjectsV2 pagination
- Add ObjectLister/ObjectListerFactory interfaces to s3 package
- Simplify snapshot filename to {height}.tar.gz (drop chain/region suffix)
- serve.go: validate SEI_SNAPSHOT_BUCKET/SEI_SNAPSHOT_REGION at startup
- Update client SnapshotRestoreTask to match
- Full test coverage for target height selection
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 tasks
bdchatham
commented
Apr 1, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…idation, dead code - Add pagination test for resolveKeyForHeight (multi-page mock) - Add negative targetHeight validation in Restore - Remove dead parseUploadConfig function Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…structor Fail at construction time rather than at task execution time, matching the pattern requested in PR review. Co-Authored-By: Claude Opus 4.6 (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
targetHeight:> 0: lists S3 objects, picks highest snapshot <= target== 0: reads latest.txt for newest snapshot{height}.tar.gz(removed chain/region suffix)Test plan
🤖 Generated with Claude Code