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.
BDB has been removed as a dependency and documentation have been updated to reflect that.
DrahtBot
commented at 11:36 pm on October 23, 2023:
contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
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.
LLM Linter (✨ experimental)
Possible typos and grammar issues:
by an rescanblockchain -> by a rescanblockchain [Incorrect article “an” used before a word starting with a consonant sound]
achow101 force-pushed
on Oct 23, 2023
DrahtBot added the label
CI failed
on Oct 23, 2023
achow101 force-pushed
on Oct 24, 2023
achow101 force-pushed
on Oct 24, 2023
DrahtBot added the label
Needs rebase
on Oct 25, 2023
achow101 force-pushed
on Oct 25, 2023
achow101 force-pushed
on Oct 25, 2023
DrahtBot removed the label
Needs rebase
on Oct 25, 2023
DrahtBot added the label
Needs rebase
on Nov 6, 2023
achow101 force-pushed
on Nov 13, 2023
DrahtBot removed the label
Needs rebase
on Nov 13, 2023
DrahtBot added the label
Needs rebase
on Nov 16, 2023
achow101 force-pushed
on Nov 16, 2023
DrahtBot removed the label
Needs rebase
on Nov 16, 2023
DrahtBot added the label
Needs rebase
on Nov 22, 2023
achow101 force-pushed
on Nov 28, 2023
DrahtBot removed the label
Needs rebase
on Nov 28, 2023
DrahtBot added the label
Needs rebase
on Nov 28, 2023
achow101 force-pushed
on Nov 28, 2023
DrahtBot removed the label
Needs rebase
on Nov 28, 2023
DrahtBot added the label
Needs rebase
on Nov 30, 2023
achow101 force-pushed
on Dec 11, 2023
achow101 force-pushed
on Dec 11, 2023
DrahtBot removed the label
Needs rebase
on Dec 11, 2023
achow101 force-pushed
on Dec 11, 2023
DrahtBot added the label
Needs rebase
on Dec 13, 2023
achow101 force-pushed
on Dec 19, 2023
DrahtBot removed the label
Needs rebase
on Dec 19, 2023
achow101 force-pushed
on Dec 19, 2023
DrahtBot added the label
Needs rebase
on Jan 2, 2024
fanquake referenced this in commit
04978c2e18
on Jan 5, 2024
achow101 force-pushed
on Jan 6, 2024
DrahtBot removed the label
Needs rebase
on Jan 6, 2024
DrahtBot added the label
Needs rebase
on Jan 11, 2024
achow101 force-pushed
on Jan 11, 2024
DrahtBot removed the label
Needs rebase
on Jan 11, 2024
DrahtBot added the label
Needs rebase
on Jan 16, 2024
achow101 force-pushed
on Jan 16, 2024
DrahtBot removed the label
Needs rebase
on Jan 16, 2024
DrahtBot added the label
Needs rebase
on Jan 17, 2024
achow101 force-pushed
on Jan 25, 2024
achow101 force-pushed
on Feb 1, 2024
DrahtBot removed the label
Needs rebase
on Feb 1, 2024
ryanofsky referenced this in commit
93e10cab5d
on Feb 2, 2024
DrahtBot added the label
Needs rebase
on Feb 3, 2024
achow101 force-pushed
on Feb 3, 2024
DrahtBot removed the label
Needs rebase
on Feb 3, 2024
DrahtBot added the label
Needs rebase
on Feb 6, 2024
achow101 force-pushed
on Feb 8, 2024
DrahtBot removed the label
Needs rebase
on Feb 8, 2024
DrahtBot added the label
Needs rebase
on Feb 10, 2024
achow101 force-pushed
on Feb 20, 2024
DrahtBot removed the label
Needs rebase
on Feb 20, 2024
DrahtBot added the label
Needs rebase
on Feb 26, 2024
achow101 force-pushed
on Feb 29, 2024
DrahtBot removed the label
Needs rebase
on Feb 29, 2024
jess2505 approved
DrahtBot added the label
Needs rebase
on Mar 11, 2024
achow101 force-pushed
on Mar 11, 2024
DrahtBot removed the label
Needs rebase
on Mar 11, 2024
DrahtBot added the label
Needs rebase
on Mar 12, 2024
achow101 force-pushed
on Mar 12, 2024
DrahtBot removed the label
Needs rebase
on Mar 12, 2024
DrahtBot added the label
Needs rebase
on Mar 18, 2024
achow101 force-pushed
on Mar 29, 2024
DrahtBot removed the label
Needs rebase
on Mar 29, 2024
DrahtBot added the label
Needs rebase
on Apr 1, 2024
achow101 force-pushed
on Apr 1, 2024
DrahtBot removed the label
Needs rebase
on Apr 1, 2024
achow101 force-pushed
on Apr 3, 2024
DrahtBot added the label
Needs rebase
on Apr 8, 2024
laanwj requested review from laanwj
on Apr 9, 2024
in
src/wallet/migrate.cpp:46
in
7707db3ad5outdated
41+enum class RecordType : uint8_t
42+{
43+ KEYDATA = 1,
44+ DUPLICATE = 2,
45+ OVERFLOW_DATA = 3,
46+ DELETE = 0x80, // Indicate this record is deleted. This is AND'd with the real type.
DrahtBot removed the label
Needs rebase
on May 21, 2024
DrahtBot added the label
Needs rebase
on May 22, 2024
achow101 force-pushed
on May 22, 2024
DrahtBot removed the label
Needs rebase
on May 22, 2024
DrahtBot added the label
Needs rebase
on May 23, 2024
achow101 force-pushed
on May 29, 2024
achow101 force-pushed
on Jun 4, 2024
DrahtBot removed the label
Needs rebase
on Jun 5, 2024
DrahtBot added the label
Needs rebase
on Jun 5, 2024
achow101 force-pushed
on Jun 6, 2024
DrahtBot removed the label
Needs rebase
on Jun 7, 2024
achow101 force-pushed
on Jun 7, 2024
achow101 force-pushed
on Jun 7, 2024
achow101 force-pushed
on Jun 7, 2024
achow101 force-pushed
on Jun 10, 2024
achow101 force-pushed
on Jun 10, 2024
achow101 force-pushed
on Jun 10, 2024
DrahtBot removed the label
CI failed
on Jun 11, 2024
DrahtBot added the label
Needs rebase
on Jun 11, 2024
achow101 force-pushed
on Jun 11, 2024
DrahtBot removed the label
Needs rebase
on Jun 11, 2024
DrahtBot added the label
Needs rebase
on Jun 12, 2024
achow101 force-pushed
on Jun 13, 2024
DrahtBot removed the label
Needs rebase
on Jun 13, 2024
DrahtBot added the label
CI failed
on Jun 14, 2024
DrahtBot
commented at 0:09 am on June 14, 2024:
contributor
🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the
documentation.
Possibly this is due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
Leave a comment here, if you need help tracking down a confusing failure.
DrahtBot removed the label
CI failed
on Jun 14, 2024
DrahtBot added the label
Needs rebase
on Jun 17, 2024
Sjors
commented at 4:10 pm on June 27, 2024:
member
You can also drop the BerkeleyDatabaseSanityCheck related suppression in contrib/devtools/check-devs.sh
achow101 force-pushed
on Jun 27, 2024
DrahtBot removed the label
Needs rebase
on Jun 27, 2024
DrahtBot added the label
CI failed
on Jun 27, 2024
DrahtBot
commented at 8:59 pm on June 27, 2024:
contributor
🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the
documentation.
Possibly this is due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
Leave a comment here, if you need help tracking down a confusing failure.
Make sure to run all tests locally, according to the documentation.
The failure may happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
DrahtBot added the label
Needs rebase
on Aug 31, 2024
achow101 force-pushed
on Sep 3, 2024
DrahtBot removed the label
Needs rebase
on Sep 3, 2024
DrahtBot added the label
Needs rebase
on Sep 4, 2024
achow101 force-pushed
on Sep 10, 2024
DrahtBot removed the label
Needs rebase
on Sep 10, 2024
DrahtBot added the label
Needs rebase
on Sep 12, 2024
achow101 force-pushed
on Sep 17, 2024
DrahtBot removed the label
Needs rebase
on Sep 17, 2024
DrahtBot added the label
Needs rebase
on Sep 20, 2024
achow101 force-pushed
on Oct 4, 2024
DrahtBot removed the label
Needs rebase
on Oct 4, 2024
achow101 force-pushed
on Oct 4, 2024
DrahtBot added the label
Needs rebase
on Oct 5, 2024
achow101 force-pushed
on Oct 11, 2024
DrahtBot removed the label
Needs rebase
on Oct 11, 2024
DrahtBot added the label
Needs rebase
on Oct 24, 2024
achow101 force-pushed
on Oct 24, 2024
DrahtBot removed the label
Needs rebase
on Oct 24, 2024
DrahtBot removed the label
CI failed
on Oct 24, 2024
DrahtBot added the label
Needs rebase
on Oct 25, 2024
achow101 force-pushed
on Oct 25, 2024
DrahtBot removed the label
Needs rebase
on Oct 25, 2024
DrahtBot added the label
Needs rebase
on Oct 28, 2024
achow101 force-pushed
on Oct 28, 2024
DrahtBot removed the label
Needs rebase
on Oct 28, 2024
DrahtBot added the label
Needs rebase
on Oct 29, 2024
achow101 force-pushed
on Oct 29, 2024
DrahtBot removed the label
Needs rebase
on Oct 29, 2024
DrahtBot added the label
Needs rebase
on Nov 1, 2024
achow101 force-pushed
on Nov 1, 2024
DrahtBot removed the label
Needs rebase
on Nov 1, 2024
murchandamus
commented at 9:43 pm on November 5, 2024:
contributor
It looks like all three dependencies got merged, is this ready for review?
achow101
commented at 10:48 pm on November 5, 2024:
member
It looks like all three dependencies got merged, is this ready for review?
Currently it is still dependent on #30328 but I suppose it doesn’t have to be.
DrahtBot added the label
Needs rebase
on Nov 6, 2024
achow101 force-pushed
on Nov 6, 2024
DrahtBot added the label
CI failed
on Nov 6, 2024
DrahtBot removed the label
Needs rebase
on Nov 6, 2024
achow101 force-pushed
on Nov 7, 2024
achow101 force-pushed
on Nov 7, 2024
achow101 force-pushed
on Nov 7, 2024
DrahtBot added the label
Needs rebase
on Nov 11, 2024
fanquake referenced this in commit
2b33322169
on Nov 12, 2024
achow101 force-pushed
on Nov 13, 2024
DrahtBot removed the label
Needs rebase
on Nov 13, 2024
DrahtBot added the label
Needs rebase
on Nov 15, 2024
in
src/wallet/wallet.cpp:3489
in
323bc8982aoutdated
Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
DrahtBot removed the label
Needs rebase
on Feb 4, 2025
bitcoin deleted a comment
on Feb 9, 2025
achow101 force-pushed
on Feb 10, 2025
DrahtBot removed the label
CI failed
on Feb 10, 2025
glozow referenced this in commit
96d30ed4f9
on Feb 13, 2025
DrahtBot added the label
Needs rebase
on Feb 13, 2025
achow101 force-pushed
on Feb 13, 2025
DrahtBot removed the label
Needs rebase
on Feb 13, 2025
DrahtBot added the label
Needs rebase
on Feb 14, 2025
achow101 force-pushed
on Feb 14, 2025
DrahtBot removed the label
Needs rebase
on Feb 14, 2025
achow101 force-pushed
on Feb 14, 2025
achow101 force-pushed
on Feb 19, 2025
achow101 force-pushed
on Feb 19, 2025
DrahtBot added the label
Needs rebase
on Feb 20, 2025
achow101 force-pushed
on Mar 5, 2025
achow101 force-pushed
on Mar 5, 2025
DrahtBot
commented at 8:28 pm on March 5, 2025:
contributor
Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
DrahtBot added the label
CI failed
on Mar 5, 2025
DrahtBot removed the label
Needs rebase
on Mar 5, 2025
DrahtBot removed the label
CI failed
on Mar 5, 2025
DrahtBot added the label
Needs rebase
on Mar 7, 2025
achow101 force-pushed
on Mar 7, 2025
DrahtBot removed the label
Needs rebase
on Mar 7, 2025
DrahtBot added the label
Needs rebase
on Mar 14, 2025
achow101 force-pushed
on Mar 14, 2025
DrahtBot removed the label
Needs rebase
on Mar 14, 2025
DrahtBot added the label
Needs rebase
on Mar 16, 2025
achow101 force-pushed
on Apr 10, 2025
achow101 force-pushed
on Apr 10, 2025
achow101 force-pushed
on Apr 10, 2025
DrahtBot added the label
CI failed
on Apr 10, 2025
DrahtBot
commented at 4:21 am on April 10, 2025:
contributor
Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
achow101 force-pushed
on Apr 10, 2025
DrahtBot removed the label
Needs rebase
on Apr 10, 2025
achow101 force-pushed
on Apr 10, 2025
DrahtBot removed the label
CI failed
on Apr 10, 2025
achow101 force-pushed
on Apr 10, 2025
achow101 force-pushed
on Apr 10, 2025
DrahtBot added the label
Needs rebase
on Apr 11, 2025
achow101 force-pushed
on Apr 11, 2025
achow101
commented at 7:00 pm on April 11, 2025:
member
The test each commit task fails because the HEAD of this PR has bdb removed from that task’s install list, but the earlier commits in this PR still needs BDB. I guess we can leave it there for now and remove it later?
DrahtBot removed the label
Needs rebase
on Apr 11, 2025
achow101 force-pushed
on Apr 12, 2025
DrahtBot added the label
Needs rebase
on Apr 14, 2025
achow101 force-pushed
on Apr 14, 2025
DrahtBot removed the label
Needs rebase
on Apr 15, 2025
DrahtBot added the label
Needs rebase
on Apr 17, 2025
achow101 force-pushed
on Apr 17, 2025
DrahtBot removed the label
Needs rebase
on Apr 17, 2025
DrahtBot added the label
Needs rebase
on Apr 21, 2025
achow101 force-pushed
on Apr 21, 2025
DrahtBot removed the label
Needs rebase
on Apr 21, 2025
DrahtBot added the label
Needs rebase
on Apr 23, 2025
achow101 force-pushed
on Apr 23, 2025
DrahtBot removed the label
Needs rebase
on Apr 23, 2025
achow101 force-pushed
on Apr 23, 2025
DrahtBot added the label
CI failed
on Apr 23, 2025
DrahtBot
commented at 7:12 pm on April 23, 2025:
contributor
Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
achow101 force-pushed
on Apr 23, 2025
DrahtBot removed the label
CI failed
on Apr 24, 2025
113@@ -123,6 +114,15 @@ Path | Description | Repository notes
114 `addr.dat` | Peer IP address BDB database; replaced by `peers.dat` in [0.7.0](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.7.0.md) | [PR #1198](https://github.com/bitcoin/bitcoin/pull/1198), [`928d3a01`](https://github.com/bitcoin/bitcoin/commit/928d3a011cc66c7f907c4d053f674ea77dc611cc)
115 `onion_private_key` | Cached Tor onion service private key for `-listenonion` option. Was used for Tor v2 services; replaced by `onion_v3_private_key` in [0.21.0](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.21.0.md) | [PR #19954](https://github.com/bitcoin/bitcoin/pull/19954)
116117+### Berkeley DB database based wallets
118+
I think it’s fine to leave as is, it’s under the “Legacy subdirectories and Files” heading. This document discusses the files that Bitcoin Core creates and uses, and legacy wallets are neither created nor really used after this PR.
achow101 force-pushed
on Apr 24, 2025
fanquake referenced this in commit
80e6ad9e30
on Apr 25, 2025
DrahtBot added the label
Needs rebase
on Apr 25, 2025
achow101 force-pushed
on Apr 25, 2025
achow101
commented at 4:10 pm on April 25, 2025:
member
Rebased and added a couple commits for followups from #31250
This is now ready for review.
achow101 marked this as ready for review
on Apr 25, 2025
in
depends/packages/bdb.mk:19
in
ec1b63648foutdated
fanquake
commented at 4:17 pm on April 25, 2025:
member
There’s also a libdb++-dev instance in workflows/ci.yml & deadlock:libdb / BerkeleyBatch etc in tsan suppressions. Berkeley* in walletdb.h. BerkeleyEnvironment::Salvage in utils_tests.cpp.
DrahtBot removed the label
Needs rebase
on Apr 25, 2025
achow101 force-pushed
on Apr 25, 2025
achow101
commented at 7:31 pm on April 25, 2025:
member
There’s also a libdb++-dev instance in workflows/ci.yml & deadlock:libdb / BerkeleyBatch etc in tsan suppressions. Berkeley* in walletdb.h. BerkeleyEnvironment::Salvage in utils_tests.cpp.
Removed
achow101 added this to the milestone 30.0
on Apr 25, 2025
achow101 force-pushed
on Apr 25, 2025
maflcko
commented at 6:36 am on April 28, 2025:
member
All tests which tested legacy wallet behavior have been removed. The --descriptors and --legacy-wallet options are removed from the functional tests.
in
src/test/util_tests.cpp:184
in
8e2d14de5coutdated
181@@ -182,7 +182,7 @@ BOOST_AUTO_TEST_CASE(parse_hex)
182 result = TryParseHex<uint8_t>("12 34 56 78").value();
183 BOOST_CHECK_EQUAL_COLLECTIONS(result.begin(), result.end(), expected.begin(), expected.end());
184185- // Leading space must be supported (used in BerkeleyEnvironment::Salvage)
186+ // Leading space must be supported
Probably, but I’m going to leave that for a followup, this diff is large enough already, and it’s a bit confusing to be removing this stuff from the GUI as it will probably require some logic changes.
Also, the comment Legacy wallets are being deprecated, warn if the loaded wallet is legacy in the code should be removed?
0$ git grep 'Legacy wallets are being deprecated, warn if the loaded wallet is legacy'bc3f07e384c2e145d6d14cfa3ad65b976233b5381bc3f07e384c2e145d6d14cfa3ad65b976233b538:src/wallet/wallet.cpp: // Legacy wallets are being deprecated, warn if the loaded wallet is legacy
In dc7bf5fd6a320c4528a28cef2a565366bbab3877 “wallet: Delete LegacySPKM”: why doesn’t this just return false like before? And if so, can’t the entire helper be dropped?
0$gitgrep-i'legacy wallets'src/script/src/walletdoc/*.md
1doc/build-netbsd.md:`db4` is required to enable support for legacy wallets.
2doc/managing-wallets.md:## Migrating Legacy Wallets to Descriptor Wallets
3doc/managing-wallets.md:Legacy wallets (traditional non-descriptor wallets) can be migrated to become Descriptor wallets
4doc/managing-wallets.md:Legacy wallets can know about, be watching for, and be able to sign for, `migratewallet` only
5doc/psbt.md:If you are using legacy wallets feel free to continue with the example provided here.
6src/script/descriptor.h: * TODO: Remove this method once legacy wallets are removed as it is only necessary for importmulti.
7src/wallet/rpc/addresses.cpp: // In legacy wallets hdkeypath has always used an apostrophe for
8src/wallet/rpc/wallet.cpp: {RPCResult::Type::NUM_TIME, "keypoololdest", /*optional=*/true, "the " + UNIX_EPOCH_TIME + " of the oldest pre-generated key in the key pool. Legacy wallets only."},
9src/wallet/scriptpubkeyman.cpp: // Legacy wallets can also contain scripts whose P2SH, P2WSH, or P2SH-P2WSH it is not watching for
10src/wallet/scriptpubkeyman.h:/** struct containing information needed for migrating legacy wallets to descriptor wallets */
11src/wallet/wallet.cpp: // Legacy wallets are being deprecated, warn if the loaded wallet is legacy
12src/wallet/wallet.cpp: warnings.emplace_back(_("Wallet loaded successfully. The legacy wallet type is being deprecated and support for creating and opening legacy wallets will be removed in the future. Legacy wallets can be migrated to a descriptor wallet with migratewallet."));
13src/wallet/wallet.cpp: error = Untranslated("Legacy wallets can no longer be created");
14src/wallet/wallet.cpp: // Legacy wallets are being deprecated, warn if a newly created wallet is legacy
15src/wallet/wallet.cpp: warnings.emplace_back(_("Wallet created successfully. The legacy wallet type is being deprecated and support for creating and opening legacy wallets will be removed in the future."));
16src/wallet/wallet.cpp: // Legacy wallets need SetupGeneration here.
17src/wallet/wallet.cpp: // Activating ScriptPubKeyManager for a given output and change type is incompatible with legacy wallets.
18src/wallet/wallet.cpp: // Legacy wallets have only one ScriptPubKeyManager and it's active for all output and change types.
I’ve cleaned up some of the legacy wallet mentions that are no longer relevant. Some are still relevant, and others are less obviously legacy wallet only things so I will leave those for a followup.
in
src/wallet/test/CMakeLists.txt:16
in
dc7bf5fd6aoutdated
Apparently since this PR was opened, descriptor specific tests were added to those files. I’ve removed the legacy ones from them and added back to the CMakeLists.txt.
Sjors changes_requested
Sjors
commented at 9:35 am on April 28, 2025:
member
The GUI now shows a watch-only balance for descriptor wallets. See inline for the culprit.
In that same commit, the churn in wallet/scriptpubkeyman.cpp is hard to follow, both here on Github as well as a git show --color-moved=dimmed-zebra. I’m guessing you’re moving stuff around, deleting and modifying? Update: use --histogram, it’s just deletes.
And a few details:
there’s one more -DWITH_BDB=ON in test-each-commit-exec.sh
test_framework/bdb.py seems unused now
fuzz/wallet_dbd_parser checks for the presence of USE_BDB which is dropped.
DEFAULT_FLUSHWALLET is unused
wallet_createwallet.py has a comment referring to sethdseed
importprivkey and friends are still in bitcoin-cli.bash
Also it might be good to rename the importprivkey test helper to e.g. importkey, so it’s not confused with the disappeared RPC method.
(same commit): I wonder if this is fine to remove, given that someone could have a non-hd backup where some keys in the keypool have been used. For migration, it could make sense to take those as well, or document that they will not be taken?
DrahtBot requested review from Sjors
on Apr 28, 2025
maflcko
commented at 9:57 am on April 28, 2025:
member
2. In that same commit, the churn in wallet/scriptpubkeyman.cpp is hard to follow, both here on Github as well as a git show --color-moved=dimmed-zebra. I’m guessing you’re moving stuff around, deleting and modifying?
You can use --patience. Maybe add this to the commit message?
Sjors
commented at 10:22 am on April 28, 2025:
member
@maflcko--patience did the trick. So does the newer histogram. It can be made default too if your computer is fast enough: git config --global diff.algorithm histogram
achow101 force-pushed
on Apr 28, 2025
achow101
commented at 8:29 pm on April 28, 2025:
member
And a few details:
Removed these
Also it might be good to rename the importprivkey test helper to e.g. importkey, so it’s not confused with the disappeared RPC method.
I’m going to leave that for a followup.
You can use --patience. Maybe add this to the commit message?
Done, also mentioned --histogram.
Sjors
commented at 10:00 am on April 29, 2025:
member
The updateWatchOnlyLabels stuff is still wrong. I think the entire second column for watch-only needs to be stripped from the GUI. But at least not rendered.
achow101
commented at 6:58 pm on April 29, 2025:
member
The updateWatchOnlyLabels stuff is still wrong. I think the entire second column for watch-only needs to be stripped from the GUI. But at least not rendered.
Fixed it so it doesn’t render. The full removal can be done in a followup.
achow101 force-pushed
on Apr 29, 2025
DrahtBot added the label
Needs rebase
on Apr 30, 2025
achow101 force-pushed
on Apr 30, 2025
DrahtBot removed the label
Needs rebase
on Apr 30, 2025
laanwj
commented at 2:14 pm on April 30, 2025:
member
Some small berkeleydb (AFAIK, non-migration) related cruft after this:
0src/wallet/load.cpp: // The canonical path cleans the path, preventing >1 Berkeley environment instances for the same directory
1test/sanitizer_suppressions/tsan:race:BerkeleyBatch
2vcpkg.json: "berkeleydb",
3vcpkg.json: "berkeleydb": {
4vcpkg.json: "berkeleydb"
DrahtBot added the label
Needs rebase
on Apr 30, 2025
achow101 force-pushed
on Apr 30, 2025
DrahtBot removed the label
Needs rebase
on Apr 30, 2025
DrahtBot requested review from maflcko
on May 1, 2025
furszy
commented at 3:14 pm on May 1, 2025:
member
In 425c39c6f520a1b0d18c6e782141f711509b2947:
Could probably also remove the proxy functions we have in the test framework for those RPC commands. Look at this line for example (same for importpubkey, importprivkey and addmultisigaddress).
Also, on an orthogonal topic — I’m wondering if, instead of completely removing importaddress(), we might want to quickly make it compatible with descriptor wallets (e.g., by reviving #27034). This is also connected to #30175.
I’m bringing this topic up because removing something in one release and reintroducing it in another one could be annoying for users.
maflcko
commented at 7:06 am on May 6, 2025:
member
Could probably also remove the proxy functions we have in the test framework for those RPC commands. Look at this line for example (same for importpubkey, importprivkey and addmultisigaddress).
nit in b6bb744a881d465d15b40413a2753ca4865e851a: Seems fine to fully remove this, given that it isn’t needed anyway after commit 1111aecbb58d6e37d430d477ac43f52811fd97d9
nit in a29101b56541d4bf72fcf69460e8eb2a8cc33979: I guess you wanted to leave some of those for follow-ups, but the doc/descriptors.md one seems in-scope?
0$ git grep -i 'legacy wallet'1c0d89358e12fc871e99c8304d5cb50965cf7b9d doc/descriptors.md doc/managing-wallets.md src/bitcoin-wallet.cpp src/wallet src/script/ test/ 11c0d89358e12fc871e99c8304d5cb50965cf7b9d:doc/descriptors.md:-`importmulti` takes as input descriptors to import into a legacy wallet
21c0d89358e12fc871e99c8304d5cb50965cf7b9d:doc/managing-wallets.md:In the RPC, the destination parameter must include the name of the file. Otherwise, the command will return an error message like "Error: Wallet backup failed!"for descriptor wallets. If it is a legacy wallet, it will be copied and a file will be created with the default file name `wallet.dat`. 31c0d89358e12fc871e99c8304d5cb50965cf7b9d:doc/managing-wallets.md:## Migrating Legacy Wallets to Descriptor Wallets 41c0d89358e12fc871e99c8304d5cb50965cf7b9d:doc/managing-wallets.md:Legacy wallets (traditional non-descriptor wallets) can be migrated to become Descriptor wallets
51c0d89358e12fc871e99c8304d5cb50965cf7b9d:doc/managing-wallets.md:Legacy wallets can know about, be watching for, and be able to sign for, `migratewallet` only
61c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/bitcoin-wallet.cpp: argsman.AddArg("-legacy", "Create legacy wallet. Only for 'create'", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
71c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/script/descriptor.h: * TODO: Remove this method once legacy wallets are removed as it is only necessary for importmulti. 81c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/rpc/addresses.cpp: // In legacy wallets hdkeypath has always used an apostrophe for 91c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/rpc/wallet.cpp: {RPCResult::Type::NUM_TIME, "keypoololdest", /*optional=*/true, "the "+ UNIX_EPOCH_TIME +" of the oldest pre-generated key in the key pool. Legacy wallets only."},
101c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/rpc/wallet.cpp: throw JSONRPCError(RPC_WALLET_ERROR, "descriptors argument must be set to \"true\"; it is no longer possible to create a legacy wallet.");
111c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/scriptpubkeyman.cpp:// Legacy wallet IsMine(). Used only in migration
121c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/scriptpubkeyman.cpp: // Legacy wallets can also contain scripts whose P2SH, P2WSH, or P2SH-P2WSH it is not watching for131c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/scriptpubkeyman.h:// This is the minimum necessary to load a legacy wallet so that it can be migrated.141c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/scriptpubkeyman.h:/** struct containing information needed for migrating legacy wallets to descriptor wallets */151c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/wallet.cpp: // Legacy wallets are being deprecated, warn if the loaded wallet is legacy
161c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/wallet.cpp: warnings.emplace_back(_("Wallet loaded successfully. The legacy wallet type is being deprecated and support for creating and opening legacy wallets will be removed in the future. Legacy wallets can be migrated to a descriptor wallet with migratewallet."));
171c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/wallet.cpp: error = Untranslated("Legacy wallets can no longer be created");
181c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/wallet.cpp: // Legacy wallets are being deprecated, warn if a newly created wallet is legacy
191c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/wallet.cpp: warnings.emplace_back(_("Wallet created successfully. The legacy wallet type is being deprecated and support for creating and opening legacy wallets will be removed in the future."));
201c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/wallet.cpp: error = strprintf(_("Error loading %s: Wallet is a legacy wallet. Please migrate to a descriptor wallet using the migration tool (migratewallet RPC)."), walletFile);
211c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/wallet.cpp: // Legacy wallets need SetupGeneration here.221c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/wallet.cpp: // Activating ScriptPubKeyManager for a given output and change type is incompatible with legacy wallets.231c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/wallet.cpp: // Legacy wallets have only one ScriptPubKeyManager and it's active for all output and change types.241c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/wallet.cpp: error = Untranslated(STR_INTERNAL_BUG("Error: Legacy wallet data missing"));
251c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/wallet.cpp: error = _("Error: Unable to produce descriptors for this legacy wallet. Make sure to provide the wallet's passphrase if it is encrypted.");
261c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/wallet.cpp: return util::Error{Untranslated(STR_INTERNAL_BUG("Error: Legacy wallet data missing"))};
271c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/wallet.cpp: // When the legacy wallet has no spendable scripts, the main wallet will be empty, leaving its script cache empty as well.281c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/wallet.cpp: return util::Error{_("Error: cannot remove legacy wallet records")};
291c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/wallet.cpp: // Get all of the descriptors from the legacy wallet
301c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/wallet.h: //! Get all of the descriptors from a legacy wallet
311c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/wallet.h://! Do all steps to migrate a legacy wallet to a descriptor wallet
321c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/walletdb.cpp: pwallet->WalletLogPrintf("Legacy Wallet Keys: %u plaintext, %u encrypted, %u w/ metadata, %u total.\n",
331c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/walletdb.cpp: // Load legacy wallet keys
341c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/walletdb.cpp: error = Untranslated(strprintf("Failed to open database path '%s'. The wallet appears to be a Legacy wallet, please use the wallet migration tool (migratewallet RPC).", fs::PathToString(path)));
351c0d89358e12fc871e99c8304d5cb50965cf7b9d:src/wallet/walletdb.h:// Keys in this set pertain only to the legacy wallet (LegacyScriptPubKeyMan) and are removed during migration from legacy to descriptors.361c0d89358e12fc871e99c8304d5cb50965cf7b9d:test/functional/tool_wallet.py: self.log.info("Test that legacy wallets cannot be created")
371c0d89358e12fc871e99c8304d5cb50965cf7b9d:test/functional/wallet_backwards_compatibility.py: legacy_nodes = self.nodes[2:] # Nodes that support legacy wallets381c0d89358e12fc871e99c8304d5cb50965cf7b9d:test/functional/wallet_backwards_compatibility.py: # since we can no longer create legacy wallets.391c0d89358e12fc871e99c8304d5cb50965cf7b9d:test/functional/wallet_backwards_compatibility.py: # Legacy wallets are no longer supported. Trying to load these should result in an error401c0d89358e12fc871e99c8304d5cb50965cf7b9d:test/functional/wallet_backwards_compatibility.py: assert_raises_rpc_error(-18, "The wallet appears to be a Legacy wallet, please use the wallet migration tool (migratewallet RPC)", node_master.restorewallet, wallet_name, backup_path)
411c0d89358e12fc871e99c8304d5cb50965cf7b9d:test/functional/wallet_createwallet.py: self.log.info("Test that legacy wallets cannot be created")
421c0d89358e12fc871e99c8304d5cb50965cf7b9d:test/functional/wallet_createwallet.py: assert_raises_rpc_error(-4, 'descriptors argument must be set to "true"; it is no longer possible to create a legacy wallet.', self.nodes[0].createwallet, wallet_name="legacy", descriptors=False)
431c0d89358e12fc871e99c8304d5cb50965cf7b9d:test/functional/wallet_migration.py: # For a P2WSH output script stored in the legacy wallet's mapScripts, both the native P2WSH441c0d89358e12fc871e99c8304d5cb50965cf7b9d:test/functional/wallet_migration.py: # The invalid addresses are invalid, so the legacy wallet should not detect them as ismine,451c0d89358e12fc871e99c8304d5cb50965cf7b9d:test/functional/wallet_migration.py: # nor consider them watchonly. However, because the legacy wallet has the witnessScripts/redeemScripts,461c0d89358e12fc871e99c8304d5cb50965cf7b9d:test/functional/wallet_migration.py: # It turns out that due to how signing logic works, legacy wallets that have valid miniscript witnessScripts471c0d89358e12fc871e99c8304d5cb50965cf7b9d:test/functional/wallet_migration.py: self.log.info("Test migration of a legacy wallet containing miniscript")
481c0d89358e12fc871e99c8304d5cb50965cf7b9d:test/functional/wallet_migration.py: # Check that the miniscript can be spent by the legacy wallet491c0d89358e12fc871e99c8304d5cb50965cf7b9d:test/functional/wallet_migration.py: # It turns out that due to how signing logic works, legacy wallets that have the private key for a Taproot501c0d89358e12fc871e99c8304d5cb50965cf7b9d:test/functional/wallet_migration.py: # Check that the rawtr can be spent by the legacy wallet511c0d89358e12fc871e99c8304d5cb50965cf7b9d:test/functional/wallet_migration.py: # Check that the tr() cannot be spent by the legacy wallet521c0d89358e12fc871e99c8304d5cb50965cf7b9d:test/functional/wallet_reindex.py: # For legacy wallet: There is no way of importing a script/address with a custom time. The wallet always imports it with birthtime=1.
I would prefer to leave further cleanups for follow up RPs as I am sure there are plenty of things that were missed and trying to catch them all in this one PR is going to be very annoying and just delay this even more.
maflcko approved
maflcko
commented at 8:13 am on May 6, 2025:
member
Regarding the removed RPC functions, I think less is better in this case, and unless I’m missing something, the cases mentioned in #30175 can be performed by importdescriptors.
DrahtBot requested review from Sjors
on May 6, 2025
DrahtBot requested review from maflcko
on May 6, 2025
achow101 force-pushed
on May 6, 2025
wallet: Delete LegacySPKM
Deletes LegacyScriptPubKeyMan and related tests
Best reviewed with `git diff --patience` or `git diff --histogram`
83af1a3cca
wallet: Remove unused db functions
SOme db functions were for BDB, these are no longer needed.
c0f3f3264f
legacy spkm: Make IsMine() and CanProvide() private and migration only5dff04a1bb
contrib: Remove legacy wallet RPCs from bash completions
These RPCs no longer exist.
de054df6dc
w0xlt
commented at 1:21 am on May 7, 2025:
contributor
Besides the typo s/an/a above, the comment “Import a private key” doesn’t go well with rescanblockchain.
in
src/wallet/rpc/backup.cpp:1095
in
8ede6dea0coutdated
806- }
807- std::tie(range_start, range_end) = ParseDescriptorRange(data["range"]);
808- }
809-
810- // Only single key descriptors are allowed to be imported to a legacy wallet's keypool
811- bool can_keypool = parsed_descs.at(0)->IsSingleKey();
In #31243, IsSingleKey was added with a TODO to remove it after removing legacy wallets.
I checked that no other usage of IsSingleKey is left, it can be removed.
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2025-05-19 00:13 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me