wallet, refactor: modularise wallet by extracting out legacy wallet migration#34909
wallet, refactor: modularise wallet by extracting out legacy wallet migration#34909rkrux wants to merge 5 commits into
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/34909. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please copy-paste 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. LLM Linter (✨ experimental)Possible places where named args for integral literals may be used (e.g.
2026-06-25 09:31:53 |
|
Fixed two things:
|
|
Pushed an update where three more migration specific |
|
Rebased over master to incorporate changes from #28333. |
pablomartin4btc
left a comment
There was a problem hiding this comment.
Concept ACK
I see you opened also #34910, wouldn't it make sense to add that commit here?
As a future consideration, have you thought about whether this structure could accommodate future migration types beyond legacy-to-descriptor, perhaps with a dedicated migration class? Curious if that's something worth exploring as a follow-up.
I had raised it separately because that change in itself seemed fine as well and I didn't want the changes of this PR to hold merging that PR. But given that #34910 has not been merged yet, I have cherry-picked that commit here and closed that PR now in favour of this one. |
I believe the migration is more of a one-off event and the likelihood of adding other migration flows beyond legacy-to-descriptor is very low, so I don't think it's worth introducing a dedicated migration class at this stage. |
|
Rebased over master to incorporate changes from #35414. |
|
🚧 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. |
|
The CI / iwyu (pull_request) failure is unrelated and should have been fixed post #35535. |
|
Rebased over master to incorporate changes from PR #35266. |
From wallet/wallet.cpp to wallet/migration.cpp. This patch should be reviewed with --color-moved=dimmed-zebra option.
To wallet/walletutil.h Couple of functions had to be made non-static for them to be used by wallet/wallet. This patch should be reviewed with --color-moved=dimmed-zebra option.
To wallet/migration. Also, update the includes in the call sites. This patch should be reviewed with --color-moved=dimmed-zebra.
To wallet/migration. This patch should be reviewed with --color-moved=dimmed-zebra.
The wallet/migrate.h|cpp file contain all the code related to the Berkeley DB that was used in the legacy wallets. Although it's true that this code is used only within the context of wallet migration but the name of the file is not exact. This patch renames the file to legacybdb so that the intent is clearer in the call sites. I felt this rename might be necessary so that the name doesn't conflict with the new migration.cpp introduced in the preceding commits.
|
Force-pushed to emphasise in the commit messages that most of the commits should be reviewed with the --color-moved=dimmed-zebra git option. |
I've been meaning to scratch this itch for quite some time. It has been noted
by many developers that the
wallet/wallet.cppfile is quite hard to reasonabout.
It is more than 4500 lines long currently and this patch is an attempt to
shortern it by around 800 lines by extracting out the wallet migration code into
a dedicated
wallet/migration.cppfile.The other benefits of this PR I see are that it moves the legacy wallet stuff
from the main wallet file that paves the way for it being descriptor specific
(as much as possible), and makes legacy wallet migration code a first-class
citizen in its own file.
I hope it makes it easier for everyone to go through the main wallet file.
This patchset should be reviewed with --color-moved=dimmed-zebra option.