-
Notifications
You must be signed in to change notification settings - Fork 38
Sync performance fixes #798
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
base: master
Are you sure you want to change the base?
Conversation
Sword-Smith
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to wallet_state.rs module are obviated by #805. But the changes to global state (neptune-core/src/state/mod.rs) look like a very fine idea to me. Do you want to resubmit PR with only the changes to neptune-core/src/state/mod.rs?
f82252c to
025b8e6
Compare
|
I had some doubts at first but after splitting the changes into incremental commits I convinced myself that it's all good. I just force-pushed essentially the same changes, spread out over more commits, and without the changes to |
|
It looks like the early returns also live in wallet_state.rs. Would you like me to remove those as well? (I read your request as pertaining to the parallelization of index derivation specifically.) |
|
Ball is in your park @Sword-Smith. The question is about the early returns in |
3816950 to
222957e
Compare
Caches grow quite large during restoration of 1000s of UTXOs, leading to out-of-memory errors. Credit to AllFather team.
…ived In other words, do not call the restoration method whenever the vector of UTXOs received in this block is empty. Credit to AllFather team.
Credit to AllFather team.
Iterate only over new UTXOs, not all UTXOs, in the course of MUTXO MSMP restoration. Makes syncing faster. But do this only when a flag is set, so that we can set it while syncing (and default to the full range in all other cases). Credit to AllFather team. Docstring modified by Alan.
Modify the optimization of function `restore_monitored_utxos_from_archival_mutator_set` whereby only the trailing end of the list of monitored UTXOs is processed if `process_all` is false and if `new_utxos` contains some non-empty vector. As a result of @Sword-Smith's new database schema, all necessary data for fetching a mutator set membership proof for a given UTXO lives on the `MonitoredUtxo` struct. Consequently, the corresponding data for monitored UTXOs that do not have a membership proof yet is already available -- and there is no need to pass this data as an argument. Indeed, the PR that applied that database schema change already dropped the argument `new_utxos`. Meanwhile, PR `sync-performance-fixes` used argument `new_utxos` for an optimization, namely to skip the updates of all monitored UTXOs that already have some MSMP, even if it is outdated. The relevant information contained by the argument `new_utxos` is its length (if `Some`), because based on the length of the tail we know where to set the starting index for the loop. This PR merges arguments `process_all` and `new_utxos` into one argument, `ignore_all_but_trailing` of type `Option<usize>`. Set it to `None` for the default behavior, in which case none of the monitored UTXOs will be ignored. During syncing, or other cases where we don't care about outdated membership proofs and only care about populating the `k` trailing new monitored UTXOs with some membership proofs, set it to `Some(k)`.
222957e to
0f19b4d
Compare
There might be something useful in these changes. Credit to AllFather team.