Fix get_client_filters livelock in protocol_filter_out_70015#1071
Open
echennells wants to merge 1 commit into
Open
Fix get_client_filters livelock in protocol_filter_out_70015#1071echennells wants to merge 1 commit into
echennells wants to merge 1 commit into
Conversation
This was referenced Jul 3, 2026
Member
|
The fix doesn’t seem to address why the subscription is being dropped while a notification is being handled. The channel must not accept another request on the protocol type while one is being handled. This opens the node up to DoS by way of memory exhaustion. |
294b347 to
e09c28d
Compare
Author
|
Revised, same fix as #1070 -- keeps the drop (backpressure), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Bug
handle_receive_get_filtersreturnsfalse(drop), andsend_filter, on an empty ancestry, resubscribes viaSUBSCRIBE_CHANNELinside the notify cycle, re-entering the handler for the same in-flight message. This is the bip157 compact-filter sibling of theprotocol_transaction_out_106get_datalivelock (#1070) -- the identical resubscribe-during-notify pattern.Reachability
Config-gated:
protocol_filter_out_70015attaches only when the node advertisesnode_client_filtersand the peer negotiates bip157, and a default node advertises neither (protocol_maximumcaps at bip130, filters off). It becomes reachable only when the node is configured as a compact-filter server ([peer] protocol_maximum = 70015plus thenode_client_filtersservice bit andfilter_bk_buckets > 0).Now reproduced live under that config (previously latent / inspection-only): on a filter-indexed testnet3 store, a single-block
getcfilters(start_height == stopheight) yields count 0 -> empty ancestry -> the loop. Unpatched spins CPU hot; patched holds ~0% and still serves filters. (The count-0-for-a-single-block result is a separate off-by-one, handled independently -- this PR is only the livelock.)Fix (revised per review)
Same as #1070: keep
return false(the drop is backpressure) and the resubscribe; wrap the send inPOST(send_filter, ...)so it runs outsidenotify. The other two handlers in this protocol (get_filter_checkpoint,get_filter_headers) alreadyreturn trueand are unaffected.