-
Notifications
You must be signed in to change notification settings - Fork 36.5k
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
Remove the legacy wallet and BDB dependency #28710
base: master
Are you sure you want to change the base?
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/28710. 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. |
d642e26
to
ad3080c
Compare
ad3080c
to
fcc606a
Compare
Salvage is bdb only which is about to be removed.
We can't load legacy wallet anymore, so if migration fails, don't try to load the failed wallet.
Require sqlite is available in order to compile the wallet. Removes instances of USE_SQLITE since it is no longer possible to not have sqlite available.
Legacy wallets do not have the descriptors flag set. Don't load wallets without the descriptors flag. At the same time, we will no longer load BDB databases since they are only used for legacy wallets.
This function will be needed in migration
Instead of (partially) trying to reverse IsMine() to get the output scripts that a LegacySPKM would track, we can preserve it in migration only code and utilize it to get an accurate set of output scripts. This is accomplished by computing a set of output script candidates from map(Crypted)Keys, mapScripts, and setWatchOnly. This candidate set is an upper bound on the scripts tracked by the wallet. Then IsMine() is used to filter to the exact output scripts that LegacySPKM would track. By changing GetScriptPubKeys() this way, we can avoid complexities in reversing IsMine() and get a more complete set of output scripts.
InferDescriptors can sometimes make descriptors which are actually invalid and cannot be parsed. Detect and skip such descriptors by doing a Parse() check before adding the descriptor to the wallet.
LegacySPKM would determine whether it could provide any script data to a transaction through the use of the CanProvide function. Instead of partially reversing signing logic to figure out the output scripts of solvable things, we use the same candidate set approach in GetScriptPubKeys() and instead filter the candidate set first for things that are ISMINE_NO, and second with CanProvide(). This should give a more accurate solvables wallet.
77604d6
to
449353a
Compare
The legacy wallet will be able to solve output scripts where the redeemScript or witnessScript is known, but does not know any of the private keys involved in that script. These should be migrated to the solvables wallet.
449353a
to
3351001
Compare
Deletes LegacyScriptPubKeyMan and related tests
SOme db functions were for BDB, these are no longer needed.
3351001
to
e6ccd17
Compare
The final step of #20160.
A bare minimum of legacy wallet code is kept in order to perform wallet migration. Migration of legacy wallets uses the independent BDB parser and a minimal
LegacyDataSPKM
that allows the legacy data to be loaded so that the migration can be completed.All tests which tested legacy wallet behavior have been removed. The
--descriptors
and--legacy-wallet
options are removed from the functional tests.BDB has been removed as a dependency and documentation have been updated to reflect that.
Depends on #26596, bitcoin-core/gui#824, #30265, #30328, and #31250