wallet: Disable creating and loading legacy wallets - #31250
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/31250. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. 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. |
4fcb431 to
47ac41b
Compare
47ac41b to
4f0e11b
Compare
Remove the option to set descriptors=False when creating a wallet, and enforce this in RPC and in CreateWallet
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.
|
re-ACK 17bb63f |
pablomartin4btc
left a comment
There was a problem hiding this comment.
re-ACK 17bb63f
Since my last review:
-
Added a commit to disable legacy wallet creation from the wallet tool.
- Addresed @davidgumberg's feedback.
laanwj
left a comment
There was a problem hiding this comment.
re-ACK 17bb63f
git range-diff b2bb27f..e39118ab0bf08fdaf68b16c86ad304b9133b43c7 9a4c92e..17bb63f
test: wallet_transactiontime_rescan importdescriptors always rescans: commit removed (test change not necessary here)test: Remove legacy wallet tests from wallet_backwards_compatibility.py: comment change typo revertedwallet: Disallow legacy wallet creation from the wallet tool,wallet: Disallow creating legacy wallets: add newlines totfm::formats- (ideally these would both be in the first commit as that's where they're introduced, maybe if you need to re-touch anyway)
|
If a user tries to restore a legacy wallet (using RPC or QT) setting "load_on_startup" (can't be done on QT but it's being set in the wallet interface code), next time the node or QT starts it will be closed with the error "... Failed to open database path ... The wallet appears to be a Legacy wallet, please use the wallet migration tool... ". That case shouldn't be handled here? We shouldn't allow (Currently this situation is not happening as a side effect of #31451). |
I don't quite follow what you're saying. I tried to restore a legacy wallet with this PR and it doesn't do it, nor are there any issues with startup the next time. Do you mean there is a possibility here if the interface is used incorrectly internally? In that case, I think it can be handled in a followup/if it becomes a reachable problem. |
Ok, I thought the restore would allow to do it and then the load_on_startup would fail but the restore fail on the wallet file verification, so all good. Tested |
I've tested it with this branch's QT and same failure on wallet file verifitcation while trying to restore a legacy backup using the GUI. All good. |
|
(fresh CI) |
|
|
||
| class RPCOverloadWrapper(): | ||
| def __init__(self, rpc, cli=False, descriptors=False): | ||
| def __init__(self, rpc, cli=False): |
There was a problem hiding this comment.
unrelated in c847dee: However, while touching, it could make sense to force named args for literal args, especially integral (boolean) ones:
def __init__(self, rpc, *, cli=False):There was a problem hiding this comment.
I'll let the next person to touch it to change this.
There was a problem hiding this comment.
Actually, the cli field can be removed. Done in #32360
|
|
||
| def importprivkey(self, privkey, label=None, rescan=None): | ||
| wallet_info = self.getwalletinfo() | ||
| if 'descriptors' not in wallet_info or ('descriptors' in wallet_info and not wallet_info['descriptors']): |
There was a problem hiding this comment.
The importprivkey overload was kept because several tests still use it.
There was a problem hiding this comment.
I was referring to if 'descriptors' not in wallet_info or ('descriptors' in wallet_info and not wallet_info['descriptors']):. However, I see that it may be used by tests using previous releases.
|
Looks like |
That's done in #28710 (commit: "build, wallet, doc: Remove BDB"). |
This comment was marked as abuse.
This comment was marked as abuse.
Bitcoin Core will still be able to migrate wallets that are in the legacy format to the new format. See the |
To prepare for the deletion of legacy wallet code, disable creating or loading new legacy wallets.
Tests for the legacy wallet specifically are deleted.
Split from #28710