Skip to content

Conversation

@achow101
Copy link
Member

@achow101 achow101 commented Nov 7, 2024

This PR reworks wallet_migration.py to use previous releases to produce legacy wallets for testing so that the test will continue to work once legacy wallets are removed.

Split from #28710

@DrahtBot
Copy link
Contributor

DrahtBot commented Nov 7, 2024

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

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31248.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK maflcko, rkrux

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:

  • #31403 (test: Call generate RPCs through test framework only by maflcko)

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.

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

left a question/nit

@achow101 achow101 force-pushed the migratewallet-prev-rels branch from 87e8845 to 0bbc4f6 Compare November 8, 2024 17:19
The previous error message for non-existent wallets of "Already a
descriptor wallet" is misleading. Return a more specific error when a
non-existent wallet is specified.
@achow101 achow101 force-pushed the migratewallet-prev-rels branch from 0d26167 to a76ad56 Compare November 13, 2024 02:19
Copy link
Contributor

@rkrux rkrux left a comment

Choose a reason for hiding this comment

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

tACK a76ad56a80d9c9a60352bb98b363131e359a383b

Certainly useful because it reflects how the end users would do wallet migration after the upcoming release.

Make is successful but around 15 functional tests are failing in my system that seem unrelated to this change because they are failing in master as well. All of the failures are due to timeouts, probably an issue with my setup.

Asked few questions and left suggestions. Found few really good tests in this file in the end!

Copy link
Contributor

Choose a reason for hiding this comment

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

Should this not be called create_legacy_wallet_and_get_rpc now highlighting that it returns the wallet RPC from the old node?

Copy link
Member Author

Choose a reason for hiding this comment

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

It returned RPC originally, and I don't think that adding a rename to the diff would be helpful.

Comment on lines -474 to -477
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we need to check for these in the old node?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, the master node migrates a copy of the wallet. The old node will have the original copy which remains unchanged regardless.

Comment on lines -504 to -511
Copy link
Contributor

Choose a reason for hiding this comment

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

This notloaded wallet migration testing is removed because it is effectively tested in test_unloaded_by_path below?

Copy link
Member Author

Choose a reason for hiding this comment

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

notloaded is specifically tested because legacy wallets won't be able to be loaded.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 for adding this. Is the reason for the absence of this unsetting here not causing any issue earlier when wallet.setmocktime(curr_time) was added that no subsequent test in this file below relies on mock time?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, no test relies on the time.

Comment on lines +795 to +796
Copy link
Contributor

Choose a reason for hiding this comment

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

TIL!

Comment on lines +783 to 786
Copy link
Contributor

Choose a reason for hiding this comment

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

I have noticed this pattern in most of these tests that I found a little difficult to read. Slightly more verbose naming would make it easier to parse like below. I am not suggesting this change to be done in this PR because this pattern existed earlier as well but can be updated in the future if others find this helpful as well.

- def_wallet.sendtoaddress(wallet.getnewaddress(), 10)
+ def_descriptor_wallet.sendtoaddress(legacy_wallet.getnewaddress(), 10)

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

Nothing blocking

ACK a76ad56a80d9c9a60352bb98b363131e359a383b 🌆

Show signature

Signature:

untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
trusted comment: ACK a76ad56a80d9c9a60352bb98b363131e359a383b 🌆
HCc+p5XHbLShm3UVysnAgJ/8rST3S/1pk8jnPZ3GPMEsR3fcUEEInTLmM4hfPEkuoPZDBo5hxMjqw+XscDFVDA==

@maflcko maflcko added this to the 29.0 milestone Nov 14, 2024
@achow101 achow101 force-pushed the migratewallet-prev-rels branch from a76ad56 to 55347a5 Compare November 19, 2024 16:59
@maflcko
Copy link
Member

maflcko commented Nov 20, 2024

Only trivial style-only changes

re-ACK 55347a5 🥊

Show signature

Signature:

untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
trusted comment: re-ACK 55347a5018b2c252c56548f0a6dc1e88e42f66b6 🥊
MpkIAt2IslqUp6iGZwemtEtxGbYa3VS9/DYQNG/mmqspN0jFhAArSyIr+Y9WjIHMT3dtzucXcRiti0dnGrX9AQ==

@DrahtBot DrahtBot requested a review from rkrux November 20, 2024 08:06
Copy link
Contributor

@rkrux rkrux left a comment

Choose a reason for hiding this comment

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

re-ACK 55347a5

Reviewed the range diff - only minor comment, commit message, renaming changes. Ran cmake again.

git range-diff a76ad56...55347a5

The PR title and description can be updated similar to the commit message of 55347a5.

@maflcko
Copy link
Member

maflcko commented Dec 5, 2024

@ryanofsky Do you think this is rfm?

@ryanofsky
Copy link
Contributor

@ryanofsky Do you think this is rfm?

Looks like it, only 2 acks, but this is mostly a test change, and the nontest change is pretty obvious. Will run tests and merge

@ryanofsky ryanofsky self-assigned this Dec 5, 2024
@ryanofsky ryanofsky merged commit 2eccb8b into bitcoin:master Dec 5, 2024
16 checks passed
sedited added a commit to sedited/rust-bitcoinkernel that referenced this pull request Jan 17, 2025