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
handle_receive_get_filters returned false (desubscribe) after dispatching a response, and send_filter resubscribed via SUBSCRIBE_CHANNEL when the ancestry was exhausted. The resubscribe runs inside the notify cycle, re-entering the handler for the in-flight message and pegging a core (100% CPU livelock). Stay subscribed (return true) and drop the per-request resubscribe. This is the BIP157 compact-filter sibling of the protocol_transaction_out_106 get_data fix; the other two handlers here (get_filter_checkpoint, get_filter_headers) already return true and are unaffected.
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. |
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_filtersreturnsfalseafter dispatching a response, unsubscribing fromget_client_filters.send_filterthen re-subscribes viaSUBSCRIBE_CHANNELonce the ancestry is exhausted. Because that resubscribe happens inside the notify cycle, the handler is re-entered for the same in-flight message — the same consume-one / produce-one loop as theprotocol_transaction_out_106get_datalivelock.This is the bip157 compact-filter sibling of that bug — the identical resubscribe-during-notify pattern, found by inspection after it. Unlike the
tx_outcase it is latent, not reproduced:protocol_filter_out_70015only attaches when the node advertisesnode_client_filtersand the peer negotiates bip157, and a default node advertises neither (protocol_maximumcaps at bip130 and filters are off). It becomes reachable only when the node is configured as a compact-filter server ([peer] protocol_maximum = 70015plus thenode_client_filtersservice bit). Confirmed by source inspection and structural identity to the proventx_outfix; not exercised live.Fix
handle_receive_get_filters:return true(stay subscribed) instead ofreturn false.send_filter: drop the per-requestSUBSCRIBE_CHANNELresubscribe on completion.Mirrors the
protocol_transaction_out_106fix (#1070). The other two handlers in this protocol (get_filter_checkpoint,get_filter_headers) alreadyreturn trueand are unaffected.