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

Bump the last watched indexes of HD accounts #2076

Merged
merged 1 commit into from Aug 13, 2021

Conversation

jrick
Copy link
Member

@jrick jrick commented Aug 12, 2021

The last watched indexes were never being increased except on the very
first call to watchHDAddrs during the wallet sync. Because this index
is used as the starting point for watching new addresses, the wallet
would increasingly watch more and more of the same addresses each
time, sending each of these in a series of 'loadtxfilter' calls to
dcrd. This was bottlenecking block processing on long-running
heavily-used wallets which create and watch many addresses (especially
in the case of mixing ticketbuyers).

There are still some duplicate addresses being watched, but this
prevents the worst case situation of what is effectively a memory leak
of data that gets sent over the network on every new derived address.

The last watched indexes were never being increased except on the very
first call to watchHDAddrs during the wallet sync.  Because this index
is used as the starting point for watching new addresses, the wallet
would increasingly watch more and more of the same addresses each
time, sending each of these in a series of 'loadtxfilter' calls to
dcrd.  This was bottlenecking block processing on long-running
heavily-used wallets which create and watch many addresses (especially
in the case of mixing ticketbuyers).

There are still some duplicate addresses being watched, but this
prevents the worst case situation of what is effectively a memory leak
of data that gets sent over the network on every new derived address.
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.

tACK

@jrick jrick merged commit af96ee5 into decred:master Aug 13, 2021
@jrick jrick deleted the bumplastwatched branch August 13, 2021 16:01
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

2 participants