Skip to content

connectd: don't answer an unknown-chain query_short_channel_ids twice - #9805

Open
devvaansh wants to merge 1 commit into
ElementsProject:masterfrom
devvaansh:qsci-unknown-chain-return
Open

devvaansh wants to merge 1 commit into
ElementsProject:masterfrom
devvaansh:qsci-unknown-chain-return

Conversation

@devvaansh

Copy link
Copy Markdown

When handle_query_short_channel_ids receives a chain_hash we don't follow, it sends reply_short_channel_ids_end with full_information = 0, as BOLT 7 requires, but then falls through and handles the query as if it were for our chain. Any short_channel_ids found in our gossmap get their gossip sent, and the reply ends with a second reply_short_channel_ids_end, with our chain_hash and full_information = 1.

Return after the first reply, as handle_query_channel_range already does for an unknown chain.

test_query_short_channel_id now also queries a known channel with an unknown chain_hash and expects a single reply_short_channel_ids_end with full_information = 0. Without the fix it gets 11 messages: the first reply, 9 gossip messages, and the second reply.

Fixes #9803.

Found while adding gossip query support to smite.

Checklist

Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:

  • The changelog has been updated in the relevant commit(s) according to the guidelines.
  • Tests have been added or modified to reflect the changes.
  • Documentation has been reviewed and updated as needed.
  • Related issues have been listed and linked, including any that this PR closes.
  • Important All PRs must consider how to reverse any persistent changes for tools/lightning-downgrade

When handle_query_short_channel_ids receives a chain_hash we don't
follow, it sends reply_short_channel_ids_end with full_information = 0,
as BOLT 7 requires, but then falls through and handles the query as if
it were for our chain. Any short_channel_ids found in our gossmap get
their gossip sent, and the reply ends with a second
reply_short_channel_ids_end, with our chain_hash and
full_information = 1.

Return after the first reply, as handle_query_channel_range already
does for an unknown chain.

Fixes: ElementsProject#9803
Changelog-Fixed: connectd: `query_short_channel_ids` for an unknown chain no longer also sends gossip from our chain and a second `reply_short_channel_ids_end`.
Signed-off-by: Devansh Vashisht <devansh.vashisht.ug24@nsut.ac.in>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

connectd: query_short_channel_ids for an unknown chain is also answered as a normal query

1 participant