db/snapcfg: internalize SnapshotSource enum, drop stale TODOs#21079
Merged
Conversation
Define SnapshotSource locally in db/snapcfg/cdn.go alongside the other helpers already mirrored from erigon-snapshot/embed.go, and switch FetchChainToml + its callers to the local type. cmd/downloader no longer imports erigon-snapshot at all; db/snapcfg still does for the embedded chain TOMLs and the webseed sub-package.
The duplicated helpers (cloudflareHeaders, getURLByChain, fetchSnapshotHashes) have been removed upstream in erigontech/erigon-snapshot#1266 (merged to release/3.4); cherry-picks to main and performance are open as #1267 and #1268. The TODO markers have served their purpose.
AskAlexSharov
approved these changes
May 10, 2026
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
SnapshotSource(Github/R2) locally indb/snapcfg/cdn.goalongside the other helpers already mirrored fromerigon-snapshot/embed.go, and switchFetchChainToml+ its callers to the local type.cmd/downloader/main.gono longer importserigontech/erigon-snapshotat all;db/snapcfg/util.gostill does for the embedded chain TOMLs and thewebseedsub-package.TODO: Copied from erigon-snapshot/embed.gomarkers indb/snapcfg/cdn.goanddb/snapcfg/util.go. The duplicated upstream helpers (getURLByChain,fetchSnapshotHashes,cloudflareHeaders,insertCloudflareHeaders) were removed in Cleanup dead code erigon-snapshot#1266 (merged torelease/3.4); cherry-picks tomain(Cherry-pick #1266: Cleanup dead code (main) erigon-snapshot#1267) andperformance(Cherry-pick #1266: Cleanup dead code (performance) erigon-snapshot#1268) are open.Test plan
go build ./db/snapcfg/... ./cmd/downloader/...cleanmake lintclean