Page MenuHomePhabricator

Merge #12560: [wallet] Upgrade path for non-HD wallets to HD

Authored by nakihito on Sep 27 2019, 17:09.


Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project

a8da482 Bump wallet version for pre split keypool (Andrew Chow)
dfcd9f3 Use a keypool of presplit keys after upgrading to hd chain split (Andrew Chow)
5c50e93 Allow -upgradewallet to upgradewallets to HD (Andrew Chow)
2bcf2b5 Test sethdseed (Andrew Chow)
b5ba01a Add 'sethdseed' RPC to initialize or replace HD seed (Chris Moore)
dd3c07a Separate HaveKey function that checks whether a key is in a keystore (Andrew Chow)

Pull request description:

Revival/rebase of #11085

Adds a new command `sethdseed` which allows you to either set or generate a new HD seed to be used. A new keypool can be generated or the original one kept and new keys added to the keypool will come from the new HD seed.

Wallets that are not HD will be upgraded to be version FEATURE_HD_SPLIT when the `sethdseed` RPC command is used.

I have also add some tests for this.

Additionally `-upgradewallet` can now be used to upgrade a wallet from non-HD to HD. When it is used for such an upgrade, the keypool will be regenerated.

Tree-SHA512: e56c792e150590429ac4a1061e8d6f7b20cca06366e184eb9bbade4cd6ae82699a28fe84f87031eadba97ad2c1606517a105f00fb7b45779c979243020071adb

Backport of Core PR12560

Test Plan
make check

Diff Detail

rABC Bitcoin ABC
Lint OK
No Unit Test Coverage
Build Status
Buildable 7625
Build 13290: Bitcoin ABC Buildbot (legacy)
Build 13289: arc lint + arc unit

Event Timeline

nakihito created this revision.Sep 27 2019, 17:09
Owners added a reviewer: Restricted Owners Package.Sep 27 2019, 17:09
Herald added a reviewer: Restricted Project. · View Herald TranscriptSep 27 2019, 17:09
nakihito planned changes to this revision.Sep 27 2019, 17:09
nakihito updated this revision to Diff 13187.Sep 27 2019, 19:48

Restored newline.

nakihito planned changes to this revision.Sep 27 2019, 19:48
nakihito updated this revision to Diff 13257.Sep 27 2019, 23:20

Fixed formatting issues.

nakihito planned changes to this revision.Sep 27 2019, 23:20
nakihito updated this revision to Diff 13258.Sep 27 2019, 23:26

Fixed block comment end tag.

nakihito planned changes to this revision.Sep 27 2019, 23:26
nakihito requested review of this revision.Sep 27 2019, 23:28
nakihito added inline comments.
4364 ↗(On Diff #13257)

Wallet pointers were changed to shared_ptr in D4134

deadalnix requested changes to this revision.Sep 28 2019, 14:43

This patch contains at least one serious blunder. In addition, the fact that the blunder passed through shows that the test plan is inadequate.




Why not static?





This revision now requires changes to proceed.Sep 28 2019, 14:43
nakihito planned changes to this revision.Oct 1 2019, 20:40

Probably going to break this into smaller parts.

nakihito abandoned this revision.Oct 3 2019, 19:35

Split into smaller parts. See D4201, D4202, D4206, D4207.