mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:50:37 +00:00
wallet, migration: Skip legacy wallet records rather than erasing them, and drop unused record erase functions #36823
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!36823
Loading…
Reference in a new issue
No description provided.
Delete branch "rm-erase-txs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When migrating a legacy wallet, we can skip the records in
MigrateToSQLitethat we would delete later on during migration. These records are specifically all of the legacy wallet records, and transaction records. The legacy wallet records are replaced with descriptor records produced during migration, and transaction records are already being rewritten by migration, so not writing them in the first place is also fine. This allows us to remove several database record erase functions, specifically EraseTx and EraseRecords.The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Conflicts
Reviewers, this pull request conflicts with the following ones:
-Wunusedby fanquake)WalletBatchwrite failures 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.
LLM Linter (✨ experimental)
Possible typos and grammar issues:
src/wallet/migration.cpp:entires→entries[misspelling]2026-11-30 20:41:52
Earlier concerns neither republished nor resolved: 1 minor finding · 1 suggestion. See the Run archive linked from the Review report for their assessments.
🔴 Major · Migration drops address-book entries from otherwise blank legacy wallets
A blank legacy wallet containing saved sending addresses migrates successfully but loses those entries after reload, although the
.legacy.bakbackup retains them.Location:
src/wallet/migration.cpp:82(head).🟠 Minor ·
WTX_VARIANTrecords are not rebuilt for retained transactionsMigration drops non-canonical witness variants if present in a legacy wallet's retained transactions; no released legacy-wallet writer producing these records was identified.
Location:
src/wallet/migration.cpp:80(head).🟠 Minor · Malformed record keys bypass temporary migration database cleanup
CopyMigrationRecordscan leave a temporary database behind when a malformed key throws; no current Bitcoin Core writer producing such keys was identified.Location:
src/wallet/migration.cpp:89(head).🔵 Suggestion ·
ApplyMigrationDataignores its only record-write resultsWriteTxMetadataandfunc_store_addrnow provide the main wallet's only transaction and address-book writes, but their failures do not necessarily prevent migration from committing.Location:
src/wallet/migration.cpp:367(head).🔵 Suggestion ·
CopyMigrationRecordsduplicates the serialized walletPassing
recordsby value deep-copies every serialized key and value, increasing migration's memory use without changing its behavior.Location:
src/wallet/migration.cpp:68(head).🔵 Suggestion ·
RECEIVElabel distribution changes alongside the storage refactorFor a receiving address retained by the main wallet, auxiliary wallets no longer receive its label unless they also own the address, changing behavior beyond storage-copy removal.
Location:
src/wallet/migration.cpp:391(head).Review coverage was incomplete.
Reviewed:
7e5389d97c87· Review report · Previous reportspermalink
🐙 This pull request conflicts with the target branch and needs rebase.
Concept ACK - good find, helps in code clean up.
🐙 This pull request conflicts with the target branch and needs rebase.
🚧 At least one of the CI tasks failed.
Task
lint: https://github.com/bitcoin/bitcoin/actions/runs/45491569567/job/138790995980LLM reason (✨ experimental): CI failed because the lint check
assert_falsyfoundassert(false)insrc/wallet/migration.cpp:117; replace it withAssertUnreachable().Hints
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.
🐙 This pull request conflicts with the target branch and needs rebase.