fix: configure state-sync to use locally-restored snapshots#26
Merged
Conversation
When a node has a local S3 snapshot, configure-state-sync now sets use-local-snapshot=true and derives trust-height from the snapshot height instead of the chain tip. This prevents Tendermint from ignoring the pre-staged snapshot and fetching all chunks over P2P. The controller passes UseLocalSnapshot to ConfigureStateSyncTask based on whether the SeiNode spec includes a snapshot config. The task scans the Tendermint snapshots directory to discover the height. Also fixes all golangci-lint errcheck violations across the codebase.
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
configure-state-synctask now setsuse-local-snapshot = trueand derivestrust-heightfrom the snapshot height (by scanningdata/snapshots/) instead of the chain tip minus 2000. This prevents Tendermint from ignoring the pre-staged snapshot and redundantly fetching all chunks over P2P.ConfigureStateSyncTask: The controller passesUseLocalSnapshot: truewhen the SeiNode spec includes a snapshot config (hasLocalSnapshot(node)). The task remains zero-config for nodes without a local snapshot.golangci-linterrcheck violations across the codebase.Root Cause
The
configure-state-synctask was writinguse-local-snapshot = false(the default) and derivingtrust-heightfrom the chain tip, causing nodes with locally-restored S3 snapshots to perform full P2P state-sync (~4800 chunks over hours) instead of applying the already-present local snapshot.Changes
sidecar/client/tasks.goUseLocalSnapshotfield toConfigureStateSyncTask, wire into paramssidecar/tasks/statesync.gouseLocalSnapshotparam: discover snapshot height fromdata/snapshots/, setuse-local-snapshotin config.tomlsidecar/tasks/statesync_test.go_ =for intentionally-discarded errors)Test plan
go test ./...)golangci-lint run ./...reports 0 issuessei-k8s-controllertask_builders.go passesUseLocalSnapshot: hasLocalSnapshot(node)(separate PR)