Skip to content

Cleanup dead code#1266

Merged
AskAlexSharov merged 2 commits into
release/3.4from
wmitsuda/cleanup-dead-code
May 8, 2026
Merged

Cleanup dead code#1266
AskAlexSharov merged 2 commits into
release/3.4from
wmitsuda/cleanup-dead-code

Conversation

@wmitsuda
Copy link
Copy Markdown
Member

@wmitsuda wmitsuda commented May 8, 2026

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).

wmitsuda added 2 commits May 7, 2026 21:09
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 AskAlexSharov merged commit df16418 into release/3.4 May 8, 2026
1 check passed
@AskAlexSharov AskAlexSharov deleted the wmitsuda/cleanup-dead-code branch May 8, 2026 01:08
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.

2 participants