Clean up custom chain webseed and preverified accesses #14899
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.
#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
KnownWebseeds
map with a newGetWebseeds
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
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
erigon-snapshot
dependency to a newer version, ensuring compatibility with the latest features and fixes. (go.mod
)Code Cleanup
networkname
import inutil.go
and redundant preverified snapshot data. (erigon-lib/chain/snapcfg/util.go
) [1] [2] [3]erigon-lib/chain/networkname/network_name.go
)Test Adjustments
turbo/snapshotsync/snapshotsync_test.go
) [1] [2]