Cherry-pick #1266: Cleanup dead code (main)#1267
Open
wmitsuda wants to merge 1 commit into
Open
Conversation
* Drop fetching helpers superseded by erigon's snapcfg 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. * Mark SnapshotSource and source constants as kept for erigon 3.4 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.
3 tasks
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.
Summary
df16418) fromrelease/3.4intomain.LoadSnapshots,getURLByChain,fetchSnapshotHashes, and the Cloudflare header helpers — duplicated verbatim in erigon'sdb/snapcfgpackage, so they're dead in this module.embed_test.go, which only covered the removed helpers.SnapshotSourceand source constants (with TODO comments) since erigon 3.4 still imports them viaFetchChainToml.Test plan
go build ./...passesgo test ./...passes (no remaining test files)