Skip to content

Cherry-pick #1266: Cleanup dead code (main)#1267

Open
wmitsuda wants to merge 1 commit into
mainfrom
wmitsuda/cherry-pick-1266-main
Open

Cherry-pick #1266: Cleanup dead code (main)#1267
wmitsuda wants to merge 1 commit into
mainfrom
wmitsuda/cherry-pick-1266-main

Conversation

@wmitsuda
Copy link
Copy Markdown
Member

@wmitsuda wmitsuda commented May 8, 2026

Summary

  • Cherry-picks Cleanup dead code #1266 (df16418) from release/3.4 into main.
  • Drops LoadSnapshots, getURLByChain, fetchSnapshotHashes, and the Cloudflare header helpers — duplicated verbatim in erigon's db/snapcfg package, so they're dead in this module.
  • Removes embed_test.go, which only covered the removed helpers.
  • Keeps SnapshotSource and source constants (with TODO comments) since erigon 3.4 still imports them via FetchChainToml.

Test plan

  • go build ./... passes
  • go test ./... passes (no remaining test files)
  • No references to the removed symbols anywhere in the repo

* 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.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant