-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Use a single wallet batch for UpgradeKeyMetadata #15433
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
Use a single wallet batch for UpgradeKeyMetadata #15433
Conversation
204ad5c to
0bedcba
Compare
|
Tagged for 0.18 because I'd consider this a bugfix |
|
Concept ACK. We should also consider doing that for |
|
utACK and concept ACK 0bedcba |
promag
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.
Concept ACK.
On line 387, before throwing, shouldn't it commit the batch?
|
@promag Wouldn't it doe that, as the unique ptr gets destroyed (and flush on exit was set to |
|
@MarcoFalke yap, it wasn't clear. Maybe worth a comment. @jonasschnelli is there a rationale for 1000? |
|
utACK 0bedcba |
As @MarcoFalke said, if the unique pointer gets out of the scope, it "commits" (flushes) to the database.
Not really. I thought 1000 is a good compromise between cache memory requirements and performance. A new constant looked after an overkill. Initially I wanted to tie it to the keypool size constant but somehow I thought then that this has nothing to do with memory consumption. |
Summary: This is a backport of [[bitcoin/bitcoin#15433 | PR15433]] Test Plan: ninja all check-all Reviewers: #bitcoin_abc, majcosta Reviewed By: #bitcoin_abc, majcosta Differential Revision: https://reviews.bitcoinabc.org/D6383

Opening wallets (the first time) after #14021 took on my end around 30 seconds due to the keymetadata migration (tested on regtest).
Using a single wallet batch reduces the required time for the migration down to <1s on my system for a default 2k keypool wallet.