-
Notifications
You must be signed in to change notification settings - Fork 155
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
Improve SPV Syncer startup loop #2289
Comments
This was referenced Nov 13, 2023
This was referenced Dec 4, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
During IBD of a new SPV wallet, the same set of headers and GC filters are fetched from every connected peer. This is less than ideal from a performance standpoint, because it causes wasted bandwidth, memory and cpu processing and triggers a large number of concurrent goroutines (2000+ for each node).
Here's a sample profile from a mainnet wallet, one using SPV connect to restrict the wallet to a single peer and one where no such restriction is done (and between 6-8 peers are being used to perform IBD):
Going by the total
Duration
, reducing the duplication for the initial sync can (potentially) halve the time IBD takes.My strategy for improving this is to:
1- Refactor the FetchMissingCfilters logic to make it syncer based instead of peer based #2291
2- Dedupe header logic
sendHeaders
support, so we can drop block inv announcements and rely only on the headers logic (as we should never receive block announcements via inv messages)3- Decouple header and cfilter fetching
FetchMissingCfilters
already gives the wallet the ability to have headers and cfilters at different sync heights.4- Add an async GetCFilterV2 version
5- Abstract syncing from peer to syncer #2291
6- Add perf tracking and peer rotation
The above is the rough plan, but might be subject to change, depending on how easy it is to keep the each step's refactoring reasonably small.
The text was updated successfully, but these errors were encountered: