achow101
commented at 11:46 pm on November 28, 2022:
member
#26606 introduced BerkeleyRODatabase which is an independent parser for BDB files. This PR uses this in legacy wallet migration so that migration will continue to work once the legacy wallet and BDB are removed. LegacyDataSPKM is introduced to have the minimum data and functions necessary for a legacy wallet to be loaded for migration.
DrahtBot
commented at 11:46 pm on November 28, 2022:
contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
Conflicts
Reviewers, this pull request conflicts with the following ones:
#29124 (wallet: Automatically repair corrupted metadata with doubled derivation path by achow101)
#28574 (wallet: optimize migration process, batch db transactions by furszy)
#28333 (wallet: Construct ScriptPubKeyMans with all data rather than loaded progressively by achow101)
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.
DrahtBot added the label
Wallet
on Nov 28, 2022
achow101 force-pushed
on Nov 28, 2022
achow101 force-pushed
on Nov 29, 2022
Sjors
commented at 2:41 pm on November 29, 2022:
member
I think it would be easier to review if you made a separate PR for BerkeleyRODatabase and have it work as a regular, albeit read-only, wallet database backend.
I’m pleasantly surprised at how small the implementation is.
achow101 force-pushed
on Nov 29, 2022
luke-jr
commented at 9:20 pm on November 29, 2022:
member
I don’t see how reimplementing BDB is better than just continuing to use BDB.
achow101 force-pushed
on Nov 29, 2022
achow101
commented at 9:27 pm on November 29, 2022:
member
I don’t see how reimplementing BDB is better than just continuing to use BDB.
The reimplementation is quite compact because it is for only reading BDB files, only the features that we use, and none of the actual DB system stuff. BDB itself contains a ton of code, a lot of which we don’t use. Maintaining it as a dependency will eventually be more burdensome - we already need to patch it in order to compile in the depends system. This reimplementation does not carry those issues - it implements a format that isn’t going to change, and it only depends on things that are already being used elsewhere in the codebase.
achow101
commented at 9:51 pm on November 29, 2022:
member
I think it would be easier to review if you made a separate PR for BerkeleyRODatabase and have it work as a regular, albeit read-only, wallet database backend.
I’ve opeend #26606 for just BerkeleyRODatabase and its use in wallettool’s dump.
achow101 force-pushed
on Nov 30, 2022
achow101 force-pushed
on Nov 30, 2022
achow101 force-pushed
on Nov 30, 2022
DrahtBot added the label
Needs rebase
on Dec 1, 2022
achow101 force-pushed
on Dec 1, 2022
DrahtBot removed the label
Needs rebase
on Dec 1, 2022
achow101 force-pushed
on Dec 2, 2022
achow101 force-pushed
on Dec 2, 2022
DrahtBot added the label
Needs rebase
on Feb 1, 2023
achow101 force-pushed
on Feb 1, 2023
achow101 force-pushed
on Feb 2, 2023
DrahtBot removed the label
Needs rebase
on Feb 2, 2023
DrahtBot added the label
Needs rebase
on Feb 17, 2023
achow101 force-pushed
on Feb 17, 2023
DrahtBot removed the label
Needs rebase
on Feb 17, 2023
DrahtBot added the label
Needs rebase
on Feb 22, 2023
achow101 force-pushed
on Mar 1, 2023
DrahtBot removed the label
Needs rebase
on Mar 1, 2023
DrahtBot added the label
CI failed
on May 2, 2023
achow101 force-pushed
on May 2, 2023
achow101 force-pushed
on May 2, 2023
DrahtBot removed the label
CI failed
on May 2, 2023
achow101 force-pushed
on May 27, 2023
DrahtBot added the label
CI failed
on Jun 7, 2023
achow101 force-pushed
on Jun 8, 2023
DrahtBot removed the label
CI failed
on Jun 8, 2023
DrahtBot added the label
Needs rebase
on Jun 28, 2023
achow101 force-pushed
on Jun 28, 2023
DrahtBot removed the label
Needs rebase
on Jun 28, 2023
DrahtBot added the label
CI failed
on Jun 29, 2023
achow101 force-pushed
on Jun 29, 2023
DrahtBot removed the label
CI failed
on Jul 6, 2023
DrahtBot added the label
CI failed
on Jul 23, 2023
DrahtBot added the label
Needs rebase
on Aug 1, 2023
achow101 force-pushed
on Aug 1, 2023
DrahtBot removed the label
Needs rebase
on Aug 1, 2023
achow101 force-pushed
on Sep 15, 2023
DrahtBot added the label
Needs rebase
on Sep 19, 2023
achow101 force-pushed
on Sep 27, 2023
DrahtBot removed the label
Needs rebase
on Sep 27, 2023
achow101 force-pushed
on Sep 27, 2023
DrahtBot removed the label
CI failed
on Sep 28, 2023
DrahtBot added the label
Needs rebase
on Oct 23, 2023
achow101 force-pushed
on Oct 23, 2023
DrahtBot removed the label
Needs rebase
on Oct 24, 2023
DrahtBot added the label
CI failed
on Oct 24, 2023
achow101 force-pushed
on Oct 24, 2023
achow101 force-pushed
on Nov 28, 2023
DrahtBot removed the label
CI failed
on Nov 28, 2023
DrahtBot added the label
Needs rebase
on Dec 14, 2023
achow101 force-pushed
on Dec 19, 2023
DrahtBot removed the label
Needs rebase
on Dec 19, 2023
DrahtBot added the label
Needs rebase
on Jan 5, 2024
achow101 force-pushed
on Jan 5, 2024
DrahtBot removed the label
Needs rebase
on Jan 6, 2024
DrahtBot added the label
CI failed
on Jan 13, 2024
DrahtBot added the label
Needs rebase
on Jan 31, 2024
achow101 force-pushed
on Feb 1, 2024
achow101 force-pushed
on Feb 1, 2024
DrahtBot removed the label
Needs rebase
on Feb 1, 2024
achow101 force-pushed
on Feb 1, 2024
achow101 force-pushed
on Feb 1, 2024
DrahtBot removed the label
CI failed
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
CI failed
on Feb 18, 2024
achow101 force-pushed
on Feb 20, 2024
DrahtBot removed the label
CI failed
on Feb 20, 2024
DrahtBot added the label
CI failed
on Feb 28, 2024
DrahtBot
commented at 6:51 am on February 28, 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.
achow101 marked this as ready for review
on May 21, 2024
DrahtBot removed the label
Needs rebase
on May 21, 2024
in
src/wallet/wallet.cpp:4484
in
37df50fffaoutdated
4464@@ -4438,6 +4465,7 @@ util::Result<MigrationResult> MigrateLegacyToDescriptor(const std::string& walle
4465 // both before and after reloading. This ensures the set is complete even if one of the wallets
4466 // fails to reload.
4467 std::set<fs::path> wallet_dirs;
4468+ options.require_format = std::nullopt;
Why reset require_format here? Seems options is not going to be read by anything after this line and none of the database types is holding a reference to it.
Avoiding that would mean that you could introduce more immutability around line 4386:
Thanks, sorry for missing that. Worth an explaining comment like "Reset require_format since reload_wallet will only be called on non-Berkeley DB sub-wallets from here on." or something more correct?
Loading the entire wallet just to obtain the descriptors flag shouldn’t be needed. Could just check the file type instead. We want a bdb file here. So, something like https://github.com/furszy/bitcoin-core/commit/7a03a039ae99e69504fe9df95b04f5e326c45a70 would work well. Yet, the code isn’t the best but it includes a test that verifies the behavior.
Good point, I think the original intention was to be able to handle the legacy-sqlite case, but that’s moot since we require BDB_RO later. I’ve changed this to check for just look for BDB files, and also added your test.
achow101 force-pushed
on Jun 4, 2024
in
src/wallet/scriptpubkeyman.h:281
in
e11fa45247outdated
275@@ -276,31 +276,106 @@ static const std::unordered_set<OutputType> LEGACY_OUTPUT_TYPES {
276277 class DescriptorScriptPubKeyMan;
278279-class LegacyScriptPubKeyMan : public ScriptPubKeyMan, public FillableSigningProvider
280+class LegacyDataSPKM : public ScriptPubKeyMan, public FillableSigningProvider
This class and possibly LegacyScriptPubKeyMan below could do with comments summarizing their responsibilities since breaking them apart and naming one LegacyDataSPKM makes things less clear.
This comment goes on to say AddWatchOnly(const CScript&) is an inherited virtual method which appears untrue. Maybe add an extra commit ahead of the others that tidies up that comment?
960@@ -961,6 +961,8 @@ class CWallet final : public WalletStorage, public interfaces::Chain::Notificati
961 //! Get the LegacyScriptPubKeyMan which is used for all types, internal, and external.
962 LegacyScriptPubKeyMan* GetLegacyScriptPubKeyMan() const;
963 LegacyScriptPubKeyMan* GetOrCreateLegacyScriptPubKeyMan();
964+ LegacyDataSPKM* GetLegacyDataSPKM() const;
965+ LegacyDataSPKM* GetOrCreateLegacyDataSPKM();
966967 //! Make a LegacyScriptPubKeyMan and set it for all types, internal, and external.
LegacyScriptPubKeyMan is a LegacyDataSPKM, so the comment would be more correct, but it could be corrected later when removing LegacyScriptPubKeyMan - unless you plan to rename LegacyDataSPKM back into LegacyScriptPubKeyMan once the deletion of the latter is complete.
In commit 46520aacc43dd42a7968587ab9ece488bbe9503d: Should this line have been removed in the following commit (31e918afc3920a2f8aa367ad323f590b4856aa26)?
No. LegacyDataSPKM does not have an IsMine() function, so this call needs to be removed otherwise it will not compile.
I think the outcome would be worst. It would compile using the base ScriptPubKeyMan::IsMine function. Returning ISMINE_NO for all IsMine calls.
Still, I think we should state why this assertion removal is ok in the commit description too.
in
src/wallet/scriptpubkeyman.h:455
in
e11fa45247outdated
499@@ -500,7 +500,6 @@ class LegacyScriptPubKeyMan : public LegacyDataSPKM
500501 /* Set the HD chain model (chain child index counters) and writes it to the database */
502 void AddHDChain(const CHDChain& chain);
503- const CHDChain& GetHDChain() const { return m_hd_chain; }
This was removed in e11fa4524723aebc0d879ee083c2d6d46849d89a but probably shouldn’t have been included in 84a5fb96382960300ebbd2cf2fe8756142bea572 (verified through compiling on that commit + with it removed).
Worth adding a comment about the consequences of setting keypool_size=0? I’m guessing there are still cases where we generate some pubkeys despite having a zero pool size, otherwise you would have removed some of the code and the for-loop below?
I don’t think this needs to have any additional explanation. keypool_size only matters for ranged descriptors. Non-HD keys do not make ranged descriptors, so the value here is ignored. The loop below is for an entirely different set of descriptors and is unrelated to this.
Haven’t fully grokked the code yet, so I understand if you’d rather not answer my questions, but if you want:
I don’t think this needs to have any additional explanation. keypool_size only matters for ranged descriptors. Non-HD keys do not make ranged descriptors, so the value here is ignored.
We’re in an HD chain for-loop, how is this not involving HD keys?
Surely legacy wallets could be HD wallets.
The loop below is for an entirely different set of descriptors and is unrelated to this.
I’m referring to the loop over desc_spks which is using the pubkeys from the DescriptorScriptPubKeyMan that’s just been created and comes from DescriptorScriptPubKeyMan::m_map_script_pub_keys which is filled out in DescriptorScriptPubKeyMan::TopUpWithDB() which is affected by m_keypool_size.
Would m_keypool_size already always be 0 before this change?
The line this comment is on is in the one that goes over the non-HD keys. However, I see that you’re confused about the similar line in the loop below that iterates the hd chains.
The keypool_size here is a runtime value that depends on the startup options. It’s is set when the DescriptorScriptPubKeyman is instantiated on loading, and the value is never directly persisted to disk. It ends up written as part of range_end when range_end is updated during TopUp(), but range_end can also be set directly.
The value that does matter is the range_end stored in WalletDescriptor. When we are going over the hd chains, we set range_end to match the chain counter stored in the CHDChain that is being migrated. This results in a descriptor that will produce exactly the same scriptPubKeys as the original hd chain, including it’s keypool. We are enforcing that the migrated descriptors produce exactly the same scriptPubKeys (no more, no less). Setting keypool_size could mean that TopUp() would generate more scriptPubKeys than we need/expect, which would cause migration to assert and crash.
Overall concept: Not fully convinced about the benefit of breaking out LegacyDataSPKM, seems to add complexity. Is the goal to delete LegacyScriptPubKeyMan in the future when ripping out BDB and only keep LegacyDataSPKM?
Why perform the inlining of IsMine() in 31e918afc3920a2f8aa367ad323f590b4856aa26 before the function is removed? Seems risky in case of other PRs modifying it prior to removal etc.
LegacyScriptPubKeyMan::NewKeyPool() only touches data from LegacyDataSPKM, should it be moved to that class as public (or protected and then exposed in the subclass?). (If LegacyScriptPubKeyMan is slated for removal I can understand you want to signal that method will no longer be needed). (Have not checked if there are other methods along the same lines).
Assuming LegacyDataSPKM name is kept, comment in src/script/signingprovider.h could be updated to refer to LegacyDataSPKM::setWatchOnly instead.
achow101
commented at 0:36 am on June 6, 2024:
member
Is the goal to delete LegacyScriptPubKeyMan in the future when ripping out BDB and only keep LegacyDataSPKM?
Yes.
We are trying to remove the legacy wallet in its entirety, leaving only behind the absolute minimum necessary to perform migration.
Why perform the inlining of IsMine() in 31e918a before the function is removed? Seems risky in case of other PRs modifying it prior to removal etc.
IsMine() is unlikely to change. Besides the fact that any changes to the legacy wallet are likely to be closed instead of seriously considered, IsMine() has not had any material changes in the last several years. It could be included in #28710 but that PR is big enough as it is.
LegacyScriptPubKeyMan::NewKeyPool() only touches data from LegacyDataSPKM, should it be moved to that class as public (or protected and then exposed in the subclass?)
No. The separation exists now to indicate which things can be removed at the end. LegacyDataSPKM is the bare minimum that must stick around for migration, everything else remains in LegacyScriptPubKeyMan and will be removed at the same time.
achow101 force-pushed
on Jun 6, 2024
in
src/wallet/scriptpubkeyman.h:372
in
31632d18eaoutdated
373+ /** Delete all the records ofthis LegacyScriptPubKeyMan from disk*/
374+ bool DeleteRecords();
375+};
376+
377+// Implements the full legacy wallet behavior
378+class LegacyScriptPubKeyMan : public LegacyDataSPKM
0// Implements the full legacy wallet behavior
1// Slated for deletion once Berkeley DB library dependency is removed.
2class LegacyScriptPubKeyMan : public LegacyDataSPKM
If the code is unable to communicate why it is like it is, it’s good to explain the otherwise surprising state of it. It would hopefully limit the amount of questions like my prior one from #26596#pullrequestreview-2089208116:
LegacyScriptPubKeyMan::NewKeyPool() only touches data from LegacyDataSPKM, should it be moved to that class as public (or protected and then exposed in the subclass?).
But I guess you’re fairly confident it will be deleted in time for the next release anyway.
achow101 force-pushed
on Jun 6, 2024
cbergqvist approved
cbergqvist
commented at 7:24 pm on June 6, 2024:
contributor
ACKa8f8a2d5d0e2328cbe2e569c7e12f653d18f456d
(Ran tests on 31632d18ea122def82820770f14d9aa009726114 but only comments changed since then).
Functional tests including --extended passed (a few automatically skipped).
make check passed.
in
src/wallet/wallet.cpp:4394
in
f732495191outdated
4370+ if (!wallet_path) {
4371+ return util::Error{util::ErrorString(wallet_path)};
4372+ }
4373+ if (!IsBDBFile(BDBDataFile(*wallet_path))) {
4374+ return util::Error{_("Error: This wallet is already a descriptor wallet")};
4375+ }
in commit f732495191d346b877ffe8402ec68761713eaaf7: now that the legacy-wallet-check is done without loading the wallet, is the check for the descriptor flag below still needed? (can a BDB wallet ever have this flag set?)
0// Before anything else, check if there is something to migrate.1if (local_wallet->IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) {
2if (was_loaded) {
3 reload_wallet(local_wallet);
4 }
5return util::Error{_("Error: This wallet is already a descriptor wallet")};
6 }
It is theoretically possible to have a descriptor wallet using BDB under 2 scenarios, however this is still an unsupported configuration:
The descriptor wallet was created on an unreleased version after #16528 but before #19077 (there was a period of about 6 months where this could have happened)
The user manipulated the database using external tooling where they created a BDB file and manually inserted descriptor wallet records
theStack
commented at 12:35 pm on June 7, 2024:
contributor
Concept ACK
in
src/wallet/scriptpubkeyman.cpp:1833
in
c653f4fdbfoutdated
1832@@ -1833,7 +1833,7 @@ std::optional<MigrationData> LegacyScriptPubKeyMan::MigrateToDescriptor()
1833 WalletDescriptor w_desc(std::move(desc), creation_time, 0, 0, 0);
18341835 // Make the DescriptorScriptPubKeyMan and get the scriptPubKeys
1836- auto desc_spk_man = std::unique_ptr<DescriptorScriptPubKeyMan>(new DescriptorScriptPubKeyMan(m_storage, w_desc, m_keypool_size));
1837+ auto desc_spk_man = std::make_unique<DescriptorScriptPubKeyMan>(m_storage, w_desc, /*keypool_size=*/0);
Not really an issue but this works because TopUp sets the descriptor range_end to 1 on the first run when the descriptor is not ranged.
As this would fail if we ever change that, what if we set the range properly in WalletDescriptor constructor?
E.g.
Also, this change doesn’t seem to be related to c653f4fdbfe06 description? –> nvm about this last point, theStack just made me notice that this is because m_keypool_size is not accesible from LegacyDataSPKM.
furszy
commented at 10:26 pm on June 18, 2024:
member
Just a small comment; you don’t have to take it.
I believe this PR could get merged quite fast if you leave 89503710386f52d9162f67fcd707eceffa954faa for a follow-up and make IsMine compatible with LegacyDataSPKM in this PR.
I’m suggesting this because this PR starts testing the newly introduced BDB reader class and allows people to use it, which is great since we want it polished for the next release. The IsMine removal is also nice but I wouldn’t miss a deadline for it.
theStack
commented at 3:38 pm on June 21, 2024:
contributor
Still trying to fully grasp the IsMine inlining commit 89503710386f52d9162f67fcd707eceffa954faa, meanwhile a few comments:
The PR description is outdated, as it still mentions adding BerkeleyRODatabase which was already merged in #26606
in c653f4fdbfe0607ad9be27e80ad22c9aee314bb7: typo in commit subject (s/MigrateToLegacy/MigrateToDescriptor/)
It isn’t really an issue because CheckDecryptionKey does not verify the outcome of the write call (which would be “successful” because the read-only bdb class return true for all write operations). But.. for the sake of correctness I see two possible paths to follow:
As this write is done exclusively on wallets with no checksum on crypted keys, we could move the upgrade code to the loading code in walletdb.cpp; removing fDecryptionThoroughlyChecked entirely and requiring such ancient wallets to provide the passphrase during load to perform the upgrade (adding a “passphrase” arg to the loadwallet RPC command).
Introduce a new WalletBatch::IsReadOnly() method to avoid calling the write inside CheckDecryptionKey.
The first approach will make the legacy wallet code simpler while the second one is a minimal change.
achow101 force-pushed
on Jun 24, 2024
achow101 force-pushed
on Jun 24, 2024
achow101
commented at 4:47 pm on June 24, 2024:
member
I believe this PR could get merged quite fast if you leave 8950371 for a follow-up and make IsMine compatible with LegacyDataSPKM in this PR.
The IsMine removal is also nice but I wouldn’t miss a deadline for it.
I think it needs to be in the next release as it is a critical part of migration. I would prefer to have it in a release that people can use before deleting the legacy wallet.
No, we should not be migrating a wallet if we cannot decrypt the keys. BerkeleyRODatabase always returns true for all write operations so it doesn’t matter. Also, I don’t think it is useful to invert that and have to have specific bypasses for BerkeleyRODatabase in all functions that attempts to write to it.
furszy
commented at 1:35 pm on June 26, 2024:
member
in
src/wallet/wallet.cpp:4465
in
f732495191outdated
4460@@ -4438,6 +4461,8 @@ util::Result<MigrationResult> MigrateLegacyToDescriptor(const std::string& walle
4461 // both before and after reloading. This ensures the set is complete even if one of the wallets
4462 // fails to reload.
4463 std::set<fs::path> wallet_dirs;
4464+ // Reset options.require_format as options are used by reload_wallet which may reload wallets of any format.
4465+ options.require_format = std::nullopt;
The reset call needs to be moved above the reload_wallet function declaration. Otherwise, the wallet will be reloaded in read-only mode for any failure occurring in-between the reload_wallet declaration and this line, such as failures during backup creation or the decryption procedure.
I have written a test to trigger this misbehavior: furszy@c24b673 (feel free to pull it here). The test passes when the fix is cherry-picked on top: furszy@2d5d9a4.
This made me cringe when first looking at the code too, but I guess retaining the inconsistency makes it easier to search for AddKeyPubKeyInner(const CKey& key, const CPubKey &pubkey) and find all 4 places it exists. Changing it in this PR would arguably add noise (on the other hand - if not now, then when?).
(Agreed, but then I would skip doing the suggested change in the .CPP file).
in
src/wallet/scriptpubkeyman.cpp:818
in
5fee29f541outdated
815+bool LegacyDataSPKM::AddKeyPubKeyInner(const CKey& key, const CPubKey &pubkey)
816+{
817+ // This function should only be called during loading of a legacy to be migrated.
818+ // As such, the wallet should not be encrypted if this is called.
819+ LOCK(cs_KeyStore);
820+ assert(!m_storage.HasEncryptionKeys());
I’m not sure this is asserting what you expect. In the loading process, we load the encryption keys after the key records. So the encryption keys map should always be empty and HasEncryptionKeys should always return false but not for the reasons stated here.
Yes, that’s what the comment is saying. It is because this function is only called during loading, and because legacy wallet records are loaded first, that this assertion makes sense. After all, to be migrated legacy wallets can still be encrypted.
I think calling IsLocked() would be more precise and make more sense then. It seems confusing to say that the wallet can still be encrypted but expect no encryption keys (we understand it because we know the loading procedure but others might not understand it).
Other than that, what if instead of creating this new LegacyDataSPKM::AddKeyPubKeyInner method you place this three lines inside the LegacyDataSPKM::LoadKey which is only called during load?
Other than that, what if instead of creating this new LegacyDataSPKM::AddKeyPubKeyInner method you place this three lines inside the LegacyDataSPKM::LoadKey which is only called during load?
We can’t do that because LoadKey needs to call LegacyScriptPubKeyMan::AddKeyPubKeyInner for legacy wallets that are being loaded normally. Since migration cannot do all of the things in LegacyScriptPubKeyMan::AddKeyPubKeyInner, we need to have LegacyDataSPKM::AddKeyPubKeyInner.
I think calling IsLocked() would be more precise and make more sense then. It seems confusing to say that the wallet can still be encrypted but expect no encryption keys (we understand it because we know the loading procedure but others might not understand it).
Actually, looking at this more closely, your original comment was correct. This function is only reached during legacy migration wallet migration loading for unencrypted keys only. Since the encryption keys are loaded later, this check doesn’t actually do anything useful.
DrahtBot added the label
CI failed
on Jun 27, 2024
furszy
commented at 8:33 pm on June 27, 2024:
member
Now that the IsMine changes were moved to another PR, could reorder the commits just so 0cce574 is introduced before c3373a39a1acc94dbf644103fab2e477d49da671. This will let us keep the IsMine assertions inside MigrateToDescriptor for now.
Other than that, code review ACK9700c21.
DrahtBot requested review from theStack
on Jun 27, 2024
DrahtBot requested review from cbergqvist
on Jun 27, 2024
cbergqvist
commented at 10:27 pm on June 27, 2024:
contributor
git range-diff master a8f8a2d 9700c217
Agree with @furszy on reordering the commits to make it possible to retain the 3 asserts in MigrateToDescriptor().
DrahtBot requested review from cbergqvist
on Jun 27, 2024
wallet: Move LegacySPKM data storage and handling to LegacyDataSPKM
In order to load the necessary data for migrating a legacy wallet
without the full LegacyScriptPubKeyMan, move the data storage and
loading components to LegacyDataSPKM. LegacyScriptPubKeyMan now
subclasses that.
7461d0c006
wallet: Move LegacyScriptPubKeyMan::IsMine to LegacyDataSPKM
IsMine is necessary for migration. It should be inlined with migration
when the legacy wallet is removed.
b231f4d556
wallet: Move MigrateToDescriptor and DeleteRecords to LegacyDataSPKM61d872f1b3
wallet: Use LegacyDataSPKM when loading
In SetupLegacyScriptPubKeyMan, a base LegacyDataSPKM will be created if
the database has the format "bdb_ro" (i.e. the wallet was opened only
for migration purposes).
All of the loading functions are now called with a LegacyDataSPKM object
instead of LegacyScriptPubKeyMan.
771bc60f13
test: verify wallet is still active post-migration failure
The migration process reloads the wallet after all failures.
This commit tests the behavior by trying to obtain a new address
after a decryption failure during migration.
8ce3739edb
achow101 force-pushed
on Jul 1, 2024
achow101
commented at 6:26 pm on July 1, 2024:
member
Reordered the commits and preserved the IsMine asserts.
cbergqvist approved
cbergqvist
commented at 10:03 pm on July 1, 2024:
contributor
ACK8ce3739edbcf6437bf2695087e0ebe8c633df19b
git range-diff 9700c217~5..9700c217 8ce3739~5..8ce3739 - not the easiest read, also used GH compare.
Passed make check & test/functional/test_runner.py including p2p_handshake.py which failed on CI.
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: 2024-12-18 21:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me