Cleanup dead code#1266
Merged
Merged
Conversation
LoadSnapshots, getURLByChain, fetchSnapshotHashes, and the Cloudflare header helpers were duplicated verbatim in erigon's db/snapcfg package (cdn.go, util.go FetchChainToml). Erigon now drives all toml fetching itself, so these helpers are dead in this module — only the embedded toml byte slices and the SnapshotSource type are still consumed. embed_test.go covered only the removed helpers, so it is dropped too.
Document why these symbols stayed behind: erigon 3.4 still imports them via FetchChainToml. They should be removed only after erigon/main defines its own copies and stops referencing this module's versions.
AskAlexSharov
approved these changes
May 8, 2026
This was referenced May 8, 2026
pull Bot
pushed a commit
to Dustin4444/erigon
that referenced
this pull request
May 10, 2026
…tech#21079) ## Summary - Define `SnapshotSource` (`Github` / `R2`) 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/main.go` no longer imports `erigontech/erigon-snapshot` at all; `db/snapcfg/util.go` still does for the embedded chain TOMLs and the `webseed` sub-package. - Drop the two `TODO: Copied from erigon-snapshot/embed.go` markers in `db/snapcfg/cdn.go` and `db/snapcfg/util.go`. The duplicated upstream helpers (`getURLByChain`, `fetchSnapshotHashes`, `cloudflareHeaders`, `insertCloudflareHeaders`) were removed in erigontech/erigon-snapshot#1266 (merged to `release/3.4`); cherry-picks to `main` (erigontech/erigon-snapshot#1267) and `performance` (erigontech/erigon-snapshot#1268) are open. ## Test plan - [x] `go build ./db/snapcfg/... ./cmd/downloader/...` clean - [x] `make lint` clean - [ ] CI green
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.
All those functions were already internalized into erigontech/erigon during the 3.4 cycle and are safe to be already deleted.
I'm doing this in the release/3.4 branch (and backporting to main afterwards) because the 3.5 release cycle is planned to use the 3.4 snapshots, so making sure this change compiles against 3.4 and 3.5.
Also added TODO markers to the remaining software pieces which were not internalized yet to erigon (will do it on erigon/main).