-
Notifications
You must be signed in to change notification settings - Fork 37.7k
fuzz: wallet: add target for spkm migration #29694
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
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/29694. ReviewsSee the guideline for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
114066e
to
d0c3ca9
Compare
cc: @achow101 |
d0c3ca9
to
2e7ac47
Compare
Inputs for this are available at: brunoerg/qa-assets#2 |
2e7ac47
to
77c31c8
Compare
Force-pushed addressing (multisig and hd chain cover): |
77c31c8
to
ed1a16b
Compare
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.
Would be good to ensure that #31374 can be replicated here.
ed1a16b
to
cdc9458
Compare
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
Force-pushed addressing #29694 (comment) |
1421097
to
9750b3f
Compare
Force-pushed adding |
5e2e916
to
457f1d4
Compare
Rebased |
a7749a9
to
cbffd66
Compare
https://cirrus-ci.com/task/5046981191532544?logs=ci#L1799
|
cbffd66
to
0c0e79d
Compare
Just fixed CI, ready for review! |
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.
You are skipping the backup restore in commit: "wallet: skip backup restoration when using in-memory dbs"; shouldn't the backup itself be skipped too when in_memory
?
@@ -4551,11 +4552,14 @@ util::Result<MigrationResult> MigrateLegacyToDescriptor(std::shared_ptr<CWallet> | |||
success = reload_wallet(res.solvables_wallet); | |||
} | |||
} | |||
if (!success) { | |||
if (!success && !in_memory) { |
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.
I think if you add the condition there, there are other stuff that's missing and I think they need to be done which are:
- the for after
// Unload the wallets
; - the lines after
// Verify that there is no dangling wallet
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.
Why? the for after // Unload the wallets
are basically playing with created_wallets
which is used only if the db is not in memory. Same for the lines after // Verify that there is no dangling wallet
which needs ptr_wallet
.
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 for after
// Unload the wallets
...
There's the removal of the wallet from the context (if (!RemoveWallet(context, w, /*load_on_start=*/false)) {
) using created_wallets
- that was done when the wallet was loaded (in LoadWalletInternal
-> AddWallet(context, wallet);
).
the lines after
// Verify that there is no dangling wallet
which needsptr_wallet
.
At the end of the condition is returning an error (return util::Error{error};
)
Be aware that if you remove the commit wallet: skip backup restoration when using in-memory dbs altogether you need to add a conditional to avoid the restore section.
At some point I think we need to refactor the wallet and extract the wallet migration behaviour into a new/ few object/ s.
For in-memory SQLite databases, exclusive locking is generally not necessary because in-memory dbs are private to the connection that created them.
By using in-memory databases, we do not have dbs file to delete and restore.
0c0e79d
to
c2bbe12
Compare
🐙 This pull request conflicts with the target branch and needs rebase. |
I'm reworking this target, will draft it. |
Closing in favor of #32624. |
This PR adds a fuzz target for
ScriptPubKeyMan
migration. It creates aLegacyDataSPKM
which can have some keys/scripts/etc, and then migrate it to descriptor. I tried to keep it as compatible as possible with future legacy wallet removal.