-
Notifications
You must be signed in to change notification settings - Fork 37.7k
wallet: Create named SQLite wallet files instead of wallet directories #20260
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
Removes the use of dumpprivkey so that descriptor wallets can pass on this. Also does a few descriptor wallet specific changes due to different IsMine semantics.
Import things into a separate watchonly wallet to work with descriptor wallets.
Existing import* RPCs are disabled for descriptor wallets, so only do these tests for legacy wallets.
Generate a privkey in the test framework instead of using dumpprivkey so that descriptor wallets work in this test.
If using descriptor wallets, use importdescriptors instead of importmulti.
…lance.py Imports and watchonly behavior are legacy wallet only, so make them only run when the test is in legacy wallet mode.
Create and import the multisig into a separate watchonly wallet so that feature_nulldummy.py works with descriptor wallets. blocktools.create_raw_transaction is also updated to use multiple nodes and wallets and to use PSBT so that this test passes.
Descriptor wallets output slightly different information in the wallet tool, so check that output when in descriptor wallet mode.
dumpprivkey and watchonly behavior don't work with descriptor wallets. Test for multisigs is modified to not rely on watchonly behavior for those multisigs. This has a side effect of removing listunspent, but that's not the target of this test, so that's fine.
…wallet.py sethdseed and importmulti are not available for descriptor wallets, so when doing descriptor wallet tests, use importdescriptors instead. Also changes some output to match what descriptor wallets will return.
…ypes.py addmultisigaddress is not available in descriptor wallets, so only run these when testing legacy wallets
The traditional multisig workflow doesn't work with descriptor wallets so make these tests legacy wallet only.
…ptors Although legacy wallet is still the default, for future use, add a --legacy-wallet option to the test framework. Additional tests for descriptor wallets have been enabled with the --descriptors option. Tests that must be legacy wallet only are being started with --legacy-wallet. Even though this option does not currently do anything, this will be helpful in the future when descriptor wallets become the default.
Some tests are legacy wallet only (and make legacy wallets) so they shouldn't be run when doing descriptor wallet tests.
Like with BDB, we allow users to specify the wallet file directly, rather than just a wallet dir name.
When --dsecriptors, we expect the wallets to be descriptor wallets, and the reverse when not (or --legacy-wallet). So updated wallet_multiwallet.py to do that.
It isn't necessary to have wallet directories for sqlite wallets, so we should just make single files in the wallets dir.
I think wallets should keep being directories. Few reasons:
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. 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. |
I agree with @ryanofsky's reasons, especially with "Future extensibility" and "Backup safety". As for wallet names that looks like <filename><dot><extension>, they could cause user confusion and fund loss because some OSes hide extensions from users. |
@ryanofsky I considered being able to move to non-directory wallets an advantage of sqlite, but you give good arguments for sticking with directories. |
🐙 This pull request conflicts with the target branch and needs rebase. Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft". |
@ryanofsky makes a convincing argument. Closing. |
Wallet directories were introduced because BDB has issues with shared database environments. Since SQLite does not have database environments it is not necessary to have these directories. So instead, we go back to the original multiwallet plan of having just wallet files named with the desired wallet name. Note that this configuration is technically supported with BDB wallets although new wallets would not be created like this. For SQLite, this is both supported and the way that wallets are created.
Depends on #18788 for tests.