server: Always serve known getcfilterv2 filters. #3035
Merged
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.
Similar to the recently changed
getheaders
handling, which also had the same semantics, the current logic for responding togetcfilterv2
includes a check to avoid serving filters whenever the current local chain is not considered to be current.Like the
getheaders
case, one less than ideal consequence of not responding is that it can lead to peers appearing to be unresponsive and/or stalled whenever the peer does not consider itself current, which can happen temporarily in a variety of corner cases such as after being unable to communicate with the network for a long time, or in testing scenarios where there are necessarily long periods of time without any new blocks.This existing behavior for
getcfilterv2
handling was inherited from the older bloom filter logic where it mattered because bloom filters could potentially put a substantial strain on the server and also could significantly slow down the initial chain sync.However, the aforementioned concerns no longer apply to version 2 block filters because they have a fixed creation cost per block, are required to exist for main chain blocks by consensus, and are the same for all peers.
Taken as a whole, this means that serving the filters is relatively cheap and therefore this modifies the semantics to always respond to
getcfilterv2
requests, even before the local chain is fully synced.