mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:50:37 +00:00
wallet: Delete removeprunedfunds RPC #36333
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!36333
Loading…
Reference in a new issue
No description provided.
Delete branch "2026-09-24-removetxremoval"
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?
Deprecated in v32 (https://github.com/bitcoin/bitcoin/pull/35605), this deletes the useless and harmful
removeprunedfundsRPC.It also removes deleting of watchonly transactions from the not-watchonly migrated wallet, which in theory we should clean up, but in practice this does nothing for the user, the only observable change is that if the user knows the txid they can dogettransactionand the migrated wallet will return the transaction information even though it does not have keys for the transaction, AFAICT for both GUI and RPC having irrelevant transactions inside of wallet is harmless and does not affect the output of anything, since most stuff is gated behindIsMine()anyways.Removing both the RPC and the deletion of watchonly tx'es allows deleting the logic for transaction removal and the associated tests.Edit: This will be done in a follow-up, all this PR does is delete the
removeprunedfundsRPC.LLM Disclosure: Not used to write this PR or PR description, but I recently replaced clang on my machine with gemma-4-26B directly generating machine code.
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)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.
Task
lint: https://github.com/bitcoin/bitcoin/actions/runs/36079638513/job/107898503317LLM reason (✨ experimental): CI failed due to
ruffPython lint errors (F401 unused imports) intest/functional/rpc_deprecated.pyandtest/functional/wallet_importprunedfunds.py.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.
Gettransaction
🐙 This pull request conflicts with the target branch and needs rebase.
Concept ACK
🔵 Suggestion · The replacement #21647 test no longer proves spend insertion
The descriptor import rescans the recent funding and spending blocks, so the final presence assertion can pass even if the subsequent spend import returns success without storing the transaction.
Location:
test/functional/wallet_importprunedfunds.py:130(head).🔵 Suggestion · The test retains an unused removeprunedfunds opt-in
Both test nodes still receive -deprecatedrpc=removeprunedfunds even though this PR removes the RPC and every test call that needed it.
Location:
test/functional/wallet_importprunedfunds.py:134(base).Review coverage was incomplete.
Reviewed:
ec7f64d02e37· Full review report · Previous reportspermalink
Rebased to fix merge conflicts.
🚧 At least one of the CI tasks failed.
Task
lint: https://github.com/bitcoin/bitcoin/actions/runs/37868051410/job/113619418552LLM reason (✨ experimental): CI failed because Ruff’s Python lint check found an unused
find_vout_for_addressimport intest/functional/wallet_importprunedfunds.py.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.
cr ACK
360625ff4eChecked that nothing in the tree still refers to
removeprunedfunds,RemoveTxsorEraseTx.Left some inline nits, no blockers. Needs rebase.
nit: according to the release notes guidance this filename should be
release-notes-36333.md. Also since we have "New RPCs" section, perhaps a "Removed RPCs" section would make this more noticeable than listing it as an update (feel free to ignore, as previous removals have gone under "Updated RPCs" or "Wallet"). Last thing, not sure if it's worth mentioning, but this also changes migration: watch-only txs are now kept in the migrated wallet (e.g. they're counted ingetwalletinfo'stxcount).Since these txs are no longer deleted, they stay in the migrated wallet. Besides
gettransaction, they now count ingetwalletinfo'stxcountand get rebroadcast by the spendable wallet if unconfirmed. Not a blocker, but maybe worth mentioning in the PR description/release note, and testing the new behavior inwallet_migration.pyinstead of only dropping the old assertions.nit: this is not outdated... perhaps it can be something like:
nit: before the deprecation commit there were log lines here; restoring them would be cleaner.
nit: this block tests
importprunedfundsfor a spending tx with no wallet outputs (#21647, added inc2da52d366); it only usedremoveprunedfundsto take the tx out of the wallet first. Could it be kept by importing into a fresh wallet that has the key, instead of dropping the coverage?Concept ACK
I think this is fine as-is, the point of the release-notes guidance is to avoid conflicts between branches, and using the PR number is one way to accomplish that, I dislike using the PR number because it means having to open a PR before adding the release note.
In
b43647960e"wallet: migration: don't prune unnecessary tx'es from DB"I don't think that we should drop this. Having extra transactions in the wallet could have unexpected side effects, as noted in https://github.com/bitcoin/bitcoin/pull/36333/changes/b43647960e7e98c40f3c671209d9041ffddda811#r4341195658
We could still drop
RemoveTxsandEraseTxif instead of deleting from the database, we never add unnecessary txs in the first place. This could be achieved by using the generic all record prefix delete withinLegacyDataSPKM::DeleteRecordsWithDB. We already do a full tx record rewrite in migration, so there would not need to be any changes for ensuring the records are written.Yeah, np, I think it's easier to find a release note for a particular PR or to check if a release note was missed and we need to add one. Not a big deal anyways, just a small nit.
I do that :)
I've removed the deletion of deletion stuff from this branch so I'll mark this as resolved, let's discuss in a follow-up PR.
Good catch, I've kept this test and changed it to avoid removeprunedfunds.
Thank you, taken.
I've avoided the deletion of deletion stuff for now, that can be handled in another PR since I think it will require some invasive changes to migration code, so I'll mark this as resolved.
Good point, I've avoided modifying this for now so marking as resolved.
Pushed to rebase, address feedback, and reduce scope of this PR to only removing the
removeprunedfundsRPC. Deleting the deletion calls cleanly without maybe having leftover stuff in the migrated wallet may require some somewhat invasive changes to migration, so I want to do that in a separate focused PR.re-ACK
ec7f64d02eThanks for taking the suggestions.
Removed
RemoveTxsandEraseTxdeletion, will be done in a separate PR/ follow-up.ACK
ec7f64d02eACK
ec7f64d02euntested ACK
ec7f64d02eCode lgtm.
nit: leftover, see the ralph review: #36333