Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reimplement address pools. #636

Merged
merged 2 commits into from Apr 6, 2017
Merged

Reimplement address pools. #636

merged 2 commits into from Apr 6, 2017

Conversation

jrick
Copy link
Member

@jrick jrick commented Apr 4, 2017

This PR is for a series of two commits and should not be squashed. The first commit adds a test artifact using the old version of the udb package. Code to generate the test database was included in this commit as well, and can be run again if necessary by checking out this commit. The second commit implements the upgrade and updates the wallet for the new APIs. The old test db code generation will not run on anything but the first commit and should not be updated.

The new implementation is much simpler and safer, and provides more
useful features as well. Addresses are now derived based on the last
used address, rather than incrementing and keeping track of a child
index to next use. Address activity lookahead has been implemented so
that other wallets sharing the same seed will stay in sync so long as
all wallets respect the BIP0044 gap limit.

Fix account generation after 100 accounts have been derived so that
derivation is allowed when any of the previous 100 accounts have
public activity rather than just the previous account.

This change involves a database upgrade to version 4. This version
removes the next-to-use account branch child indexes, replacing them
with the last used child index.

Fixes #112.
Fixes #411.
Fixes #580.
Fixes #603.
Fixes #635.

@jrick
Copy link
Member Author

jrick commented Apr 4, 2017

Going to need to get travis ignoring that wallet/udb/testdata directory:

wallet/udb/testdata/v1.db.go:111:15:warning: assignment count mismatch (2 vs 1) (gosimple)

This also includes the source code to generate the v1 database.
Copy link
Member

@alexlyp alexlyp left a comment

Choose a reason for hiding this comment

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

code looks great, tACK on simnet getting hammered with ticketpurchases and sends

The new implementation is much simpler and safer, and provides more
useful features as well.  Addresses are now derived based on the last
used address, rather than incrementing and keeping track of a child
index to next use.  Address activity lookahead has been implemented so
that other wallets sharing the same seed will stay in sync so long as
all wallets respect the BIP0044 gap limit.

Fix account generation after 100 accounts have been derived so that
derivation is allowed when any of the previous 100 accounts have
public activity rather than just the previous account.

This change involves a database upgrade to version 4.  This version
removes the next-to-use account branch child indexes, replacing them
with the last used child index.
@jrick jrick merged commit ea729c6 into decred:master Apr 6, 2017
@jrick jrick deleted the killaddrpools branch April 6, 2017 22:56
@dajohi dajohi added this to the v1.0.0 milestone Apr 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants