Check availability of preverified.toml contents#12415
Merged
Merged
Conversation
AskAlexSharov
approved these changes
Oct 23, 2024
This was referenced May 12, 2026
Sahil-4555
pushed a commit
to Sahil-4555/erigon
that referenced
this pull request
May 29, 2026
… dep (erigontech#21197) Fixes erigontech#21154. Fixes erigontech#19732. Sub-task of erigontech#21047. ## Summary - Drop the `github.com/erigontech/erigon-snapshot` Go-module import. The embedded TOMLs it ships were loaded at startup, immediately overwritten by a runtime fetch, and discarded — they have been unused on every daemon path since erigontech#12415 made remote-fetch failure fatal. - Drop the `--preverified=embedded` flag value (a dev convenience from erigontech#18273); `remote` and `local` remain. - Clean up the now-vestigial registry pieces: remove the unused `preverifiedRegistry.Reset` method (dead since erigontech#19641 switched to per-chain loading), promote the immutable supported-chain set to a package-level `knownChains` var, and inline its only membership-check consumer in `SetToml`. Runtime fetch source (`raw.githubusercontent.com/erigontech/erigon-snapshot` + R2 mirror) and fail-fast behaviour are unchanged. Binary size: −2,973,120 bytes uncompressed (−2.0%) / −1,015,102 bytes gzipped (−1.6%) on `darwin/arm64`, measured by building before/after a stubbed-empty `erigon-snapshot`. ## Test plan - [x] `make lint && make erigon integration` clean - [x] `go test ./db/snapcfg/... ./db/downloader/downloadercfg/...` pass - [x] Manual: `--chain=hoodi` with both CDN hosts unreachable (`HTTPS_PROXY` pointed at a dead local port) exits non-zero with the same fail-fast `[CRIT] Snapshot hashes for supported networks was not loaded …` startup trace - [x] Manual: `--chain=hoodi` with normal network logs `Loading remote snapshot hashes chain=hoodi`, no `Failed to load` warning, no `[CRIT]`, and progresses into the downloader (segments begin downloading) - [x] Manual: `--chain=hoodi` against a fresh datadir prepopulated with a real `<datadir>/snapshots/preverified.toml` (fetched out-of-band) starts cleanly with HTTPS_PROXY pointed at a dead local port — no `Loading remote snapshot hashes` log line, no `[CRIT]`, downloader brings up — confirming the local-file path bypasses remote fetch - [x] Manual: `erigon snapshots reset --datadir=<dd> --preverified=embedded --dry-run` exits 1 with `Error: invalid preverified flag value "embedded"`; the `--help` output shows `(remote, local)`; `--preverified=remote` and `--preverified=local` continue to work
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.
covers #12409
requires erigontech/erigon-snapshot#321
For actions for user i came up with checking network and giving a link to github status page.
Can you guys give any other advice like to have some flag etc?