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

Add watchlast option to limit initially watched addresses #2196

Merged
merged 1 commit into from Jan 30, 2023

Conversation

jrick
Copy link
Member

@jrick jrick commented Jan 24, 2023

Very large wallets have many addresses that may not be needed anymore, but these addresses were always being loaded into the address transaction filters (cfilters in SPV mode, and given to dcrd to watch when running in full node mode). To improve startup resource usage and performance, add a new watchlast option that counts backwards from the current address index of every HD account branch, and ignores loading addresses prior to the cutoff during the initial sync.

Future iterations on this idea may allow custom values for different accounts and branches, or perhaps something automatic for mixed accounts where we don't expect old addresses to ever be used again, but for now this seems good enough.

Copy link
Member

@davecgh davecgh left a comment

Choose a reason for hiding this comment

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

Untested, but reads correct.

Very large wallets have many addresses that may not be needed anymore,
but these addresses were always being loaded into the address
transaction filters (cfilters in SPV mode, and given to dcrd to watch
when running in full node mode).  To improve startup resource usage
and performance, add a new watchlast option that counts backwards from
the current address index of every HD account branch, and ignores
loading addresses prior to the cutoff during the initial sync.

Future iterations on this idea may allow custom values for different
accounts and branches, or perhaps something automatic for mixed
accounts where we don't expect old addresses to ever be used again,
but for now this seems good enough.
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