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

Wallet filter can be stored on disk/db to speed up startup time. #874

Open
nodech opened this issue Nov 14, 2023 · 0 comments
Open

Wallet filter can be stored on disk/db to speed up startup time. #874

nodech opened this issue Nov 14, 2023 · 0 comments
Labels
wallet-db part of the codebase

Comments

@nodech
Copy link
Contributor

nodech commented Nov 14, 2023

Wallet filter is always in memory. When wallet db starts, it loads all relevant information that it needs to track from the database: address hashes, outpoint hashes and name hashes. This is walletdb specific, not wallet one. This can grow in size quickly if the wallet is active/old enough. To speed up start up time of the wallet we could, after every batch write, also write filter to either disk or the database (this makes it easier to make sure there are no race issues). On load if the file exists, we load filter from the file instead of the looping through all WID mappings of above mentioned hashes.

Also worth investigating the number of items, after which having filter makes no more sense and returns high % of false positives. At certain point it's simpler to just grab the full block every time. For those settings wallet can just track the number of items filter indexes and use those stats to decide if the filter should be used.

@nodech nodech added the wallet-db part of the codebase label Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wallet-db part of the codebase
Projects
None yet
Development

No branches or pull requests

1 participant