Skip to content

Clean up custom chain webseed and preverified accesses #14899

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

anacrolix
Copy link
Contributor

@anacrolix anacrolix commented May 6, 2025

#14253. There's also a change in erigon-snapshot.

This pull request introduces a refactor to streamline the handling of webseeds and preverified snapshot data, alongside minor dependency updates and cleanup. The most significant changes involve replacing hardcoded maps with dynamic functions, improving maintainability and flexibility. Below are the key changes:

Refactoring Webseed Handling

  • Replaced the KnownWebseeds map with a new GetWebseeds function, which dynamically retrieves webseeds for a given chain. This change simplifies the code and avoids maintaining static lists. (cmd/downloader/main.go, cmd/snapshots/sync/sync.go, cmd/utils/flags.go, diagnostics/setup.go, erigon-lib/chain/snapcfg/util.go) [1] [2] [3] [4] [5] [6]

Refactoring Preverified Snapshot Handling

  • Removed static preverified snapshot data and replaced it with dynamic loading through LoadRemotePreverified, allowing for per-chain fetching and better error handling. (erigon-lib/chain/snapcfg/util.go, erigon-lib/downloader/downloadercfg/downloadercfg.go) [1] [2]

Dependency Updates

  • Updated the erigon-snapshot dependency to a newer version, ensuring compatibility with the latest features and fixes. (go.mod)

Code Cleanup

  • Removed unused imports and variables, such as the networkname import in util.go and redundant preverified snapshot data. (erigon-lib/chain/snapcfg/util.go) [1] [2] [3]
  • Added TODO comments for future improvements, such as strong typing for network names. (erigon-lib/chain/networkname/network_name.go)

Test Adjustments

  • Updated tests to use the new dynamic API for preverified snapshots, ensuring they align with the refactored implementation. (turbo/snapshotsync/snapshotsync_test.go) [1] [2]

@anacrolix
Copy link
Contributor Author

This still has value, I'll clean this up when the downloader speed improvements are done.

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