-
Notifications
You must be signed in to change notification settings - Fork 37.7k
wallet, refactor: Remove Legacy check and error #33082
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
base: master
Are you sure you want to change the base?
wallet, refactor: Remove Legacy check and error #33082
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/33082. 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. |
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
https://github.com/bitcoin/bitcoin/actions/runs/16577317093/job/46884696846?pr=33082#step:7:2967: 131/145 Test #7: bench_sanity_check ...................Subprocess aborted***Exception: 30.55 sec
Running with -sanity-check option, output is being suppressed as benchmark results will be useless.
wallet/wallet.cpp:521 UpgradeDescriptorCache: Assertion `IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)' failed. |
Yeah, I'm on it, that's why I put it on draft yesterday. Thanks! |
d6fec28
to
ffbddde
Compare
ffbddde
to
3d8a189
Compare
Updates
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code review ACK 3d8a189
- Checked that the unecessary calls to
LoadWallet
were removed from the tests - I didn't find any other occurance apart ofTestLoadWallet
.
Remove dead code due to legacy wallet removal.
3d8a189
to
d3c5e47
Compare
Now that wallet loading doesn't call PopulateWalletFromDB, UpgradeDescriptorCache is not reachable for legacy wallets, since they are only loaded, never created. Suggested here: bitcoin#33082 (comment) Co-authored-by: pablomartin4btc <pablomartin4btc@gmail.com>
crACK d3c5e47 Removes unuseful legacy wallet code, also suggested here: #32636 (comment) The suggestion in the PR description won't work without 30c6f64, if this gets merged first I'll add it to #32636. |
Remove dead code due to legacy wallet removal.
Leftovers from previous #32481.
Note:
While attempting to remove the legacy check in
CWallet::UpgradeDescriptorCache()
(which is called fromDBErrors WalletBatch::LoadWallet(CWallet* pwallet))
, I once again ran into the fact thatLoadWallet()
is used in two distinct scenarios — something I was already aware of:WALLET_FLAG_LAST_HARDENED_XPUB_CACHED
at the end of the upgrade function, if the legacy check is removed) would produce a failure (DBErrors CWallet::LoadWallet()
->Assert(m_wallet_flags == 0)
).WALLET_FLAG_LAST_HARDENED_XPUB_CACHED
is set.While revisiting this, I also noticed that some
LoadWallet()
calls in the wallet tests are unnecessary and I've removed them in the first commit.The following change in
UpgradeDescriptorCache()
could be done in PR #32636 as part of the separation between wallet loading and creation responsibilities.