Skip to content

Conversation

achow101
Copy link
Member

@achow101 achow101 commented Oct 6, 2023

Not all of the data in an address book entry was being copied to the watchonly and solvables wallets. This includes information such as whether the address was previously spent, and any receive requests that may exist. A test has been added to check that the previously spent information is copied, although it passes without the changes in this PR since this information is also regenerated when a transaction is loaded/added into a wallet.

@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 6, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK ryanofsky, furszy

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:

  • #28976 (wallet: Fix migration of blank wallets by achow101)
  • #28574 (wallet: optimize migration process, batch db transactions by furszy)
  • #22341 (rpc: add path to gethdkey by Sjors)

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.

@achow101 achow101 force-pushed the migrate-avoidreuse branch 2 times, most recently from 067e09e to 0266501 Compare November 14, 2023 00:16
Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ACK 0266501. Nice cleanup and test!

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ACK 406b71a. Just suggested change since last review

@achow101 achow101 requested review from furszy and Sjors January 2, 2024 16:37
Copy link
Member

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ACK 406b71a

With two non-blocking points:

Firstly, made a test to verify that the transaction's extra information is preserved during migration: c1aabd1. This includes the preservation of bump fee info ('replaces_txid' and 'replaced_by_txid') and the user's custom comments ('comment' and 'comment_to'). Feel free to cherry-pick it, or I can push it in a follow-up. Either way is fine for me.

Secondly, shilling mode; with #26836, which now is part of #28574, this could have been implemented with even less code.

Comment on lines +884 to +885
wallet = self.create_legacy_wallet("avoidreuse")
wallet.setwalletflag("avoid_reuse", True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tiny nit: could provide the avoid_reuse flag to createwallet() instead of calling setwalletflag separately.

@@ -896,6 +951,7 @@ def run_test(self):
self.test_conflict_txs()
self.test_hybrid_pubkey()
self.test_failed_migration_cleanup()
self.test_avoidreuse()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to unload the wallets at the end of the test case.

@fanquake fanquake merged commit c2d04f1 into bitcoin:master Jan 8, 2024
achow101 added a commit that referenced this pull request Jan 10, 2024
016cc80 test: wallet migration, add coverage for tx extra data (furszy)

Pull request description:

  Quick follow-up to #28610, coming from #28610 (review).

  Verifying that the 'replaced_by_txid' and 'replaces_txid' tx data is preserved after migration,
  as well as the extra tx comments.

ACKs for top commit:
  jamesob:
    Nice, ACK 016cc80
  achow101:
    ACK 016cc80
  pablomartin4btc:
    ACK 016cc80
  BrandonOdiwuor:
    lgtm ACK 016cc80

Tree-SHA512: 697cabece730cbe5c5947bf98455e80a8877c0352fbe2a66362ce5ea530b67882b0bec561a67d48fee200cdad717cd62c57fd809e2a94ff83c3fad30021e1d9e
luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request Apr 24, 2024
luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request May 6, 2024
@bitcoin bitcoin locked and limited conversation to collaborators Jan 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants