Skip to content

Check availability of preverified.toml contents#12415

Merged
AskAlexSharov merged 8 commits into
mainfrom
failfast-preverified
Oct 23, 2024
Merged

Check availability of preverified.toml contents#12415
AskAlexSharov merged 8 commits into
mainfrom
failfast-preverified

Conversation

@awskii

@awskii awskii commented Oct 22, 2024

Copy link
Copy Markdown
Member

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?

@AskAlexSharov AskAlexSharov enabled auto-merge (squash) October 23, 2024 04:21
@AskAlexSharov AskAlexSharov merged commit 09d9ea8 into main Oct 23, 2024
@AskAlexSharov AskAlexSharov deleted the failfast-preverified branch October 23, 2024 04:49
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
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