Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If a user wants to add a new wallet, they need to rescan from genesis to find out about the wallet's history. Downloading all blocks will incur in a lot of resource usage. This PR creates an internal filter storage that can be used during rescan.
This is not the same filter that can be downloaded from the p2p network as per BIP157. While we use the same construction as BIP158, we customize what is committed, looking for deduction in size and CPU usage. Moreover, BIP157/158 filters aren't authenticated, so misbehaving peers could, in theory, fool our wallet with an invalid filter. While in theory, this can be handled by asking for BIP157 filter headers, it adds a lot of state and round-trips that are a bit tricky to represent in
floresta
right now.Currently, the filters are under the
watch-only
crate, we can only find blocks of interest, but not ask for such blocks, since the electrum server doesn't hold a handle to the node. I think it's fine if it does, but this needs to be implemented.