Skip to content

snapcfg: load preverified hashes for single chain only#19785

Merged
wmitsuda merged 2 commits into
mainfrom
wmitsuda/remove-load-all-preverified
Mar 11, 2026
Merged

snapcfg: load preverified hashes for single chain only#19785
wmitsuda merged 2 commits into
mainfrom
wmitsuda/remove-load-all-preverified

Conversation

@wmitsuda

@wmitsuda wmitsuda commented Mar 10, 2026

Copy link
Copy Markdown
Member

Summary

Part 3 of optimizing remote preverified hash loading (after #19641, #19722).

  • LoadPreverified now takes a chainName parameter and calls LoadRemotePreverified instead of the old bulk variant that fetched all 10 chains
  • Refactored webseeds.Verify to load preverified per-chain inside the iteration loop instead of bulk-loading all chains upfront
  • Removed unused functions: old bulk LoadRemotePreverified, registry.All, registry.ResetRaw, GetAllCurrentPreverified
  • Renamed LoadRemotePreverifiedForChainLoadRemotePreverified since it's now the only variant

Test plan

  • Built erigon and downloader binaries
  • Tested erigon seg reset --dry-run with mainnet and hoodi ephemeral datadirs
  • Tested downloader verify_webseeds --chain=chiado --preverified=embedded to completion
  • Verified only the requested chain is fetched (confirmed via log output)

Tasks

LoadPreverified now takes a chainName parameter and calls
LoadRemotePreverifiedForChain instead of LoadRemotePreverified,
avoiding unnecessary HTTP fetches for all 10 chains when only one
is needed.

Remove LoadRemotePreverified, registry.All, registry.ResetRaw,
and GetAllCurrentPreverified which are no longer used.

Refactor webseeds.Verify to load preverified per-chain inside
the iteration loop instead of bulk-loading all chains upfront.
@wmitsuda wmitsuda merged commit 582f1fb into main Mar 11, 2026
34 of 35 checks passed
@wmitsuda wmitsuda deleted the wmitsuda/remove-load-all-preverified branch March 11, 2026 00:49
wmitsuda added a commit that referenced this pull request Mar 11, 2026
## Summary
Part 3 of optimizing remote preverified hash loading (after #19641,
#19722).

- `LoadPreverified` now takes a `chainName` parameter and calls
`LoadRemotePreverified` instead of the old bulk variant that fetched all
10 chains
- Refactored `webseeds.Verify` to load preverified per-chain inside the
iteration loop instead of bulk-loading all chains upfront
- Removed unused functions: old bulk `LoadRemotePreverified`,
`registry.All`, `registry.ResetRaw`, `GetAllCurrentPreverified`
- Renamed `LoadRemotePreverifiedForChain` → `LoadRemotePreverified`
since it's now the only variant

## Test plan
- [x] Built `erigon` and `downloader` binaries
- [x] Tested `erigon seg reset --dry-run` with mainnet and hoodi
ephemeral datadirs
- [x] Tested `downloader verify_webseeds --chain=chiado
--preverified=embedded` to completion
- [x] Verified only the requested chain is fetched (confirmed via log
output)

## Tasks
- [ ] Cherry-pick merge commit to `release/3.4`
wmitsuda added a commit that referenced this pull request Mar 11, 2026
## Summary
- Add skill that cleans up local worktrees and branches for merged
GitHub PRs
- Automatically handles cherry-pick instructions found in PR body (e.g.,
`- [ ] Cherry-pick merge commit to release/3.4`)
- Creates cherry-pick PR, updates original PR to mark the task done

## Test plan
- [x] Tested end-to-end against PR #19785 — worktree removed, branch
deleted, cherry-pick PR #19786 created, original PR updated
wmitsuda added a commit that referenced this pull request Mar 11, 2026
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