Skip to content

bolt07: explicit that the peer may fail the connection if wrong chain_hash in query_messages#678

Closed
darosior wants to merge 1 commit into
lightning:masterfrom
darosior:complete_to_0
Closed

bolt07: explicit that the peer may fail the connection if wrong chain_hash in query_messages#678
darosior wants to merge 1 commit into
lightning:masterfrom
darosior:complete_to_0

Conversation

@darosior
Copy link
Copy Markdown
Contributor

@darosior darosior commented Oct 1, 2019

In the query_ messages, the node receiving the query (query_[channel_range/short_channel_ids]) will set the complete flag to 0 in the reply if it does not maintain up-to-date informations about the network specified in the request chain_hash. If this is the case then it's not an interesting node for the initial peer, which may fail the connection.

This explicits a constraints on the reply_channel_range that is implied to not have any information in the first place (to set the len of the list of scds to 0). This is a modification of a MUST but we already do this for C-lightning, and (really not sure though) I don't think Eclair and LND even send a reply with complete to 0 on bad chain_hash ? (https://github.com/lightningnetwork/lnd/blob/2dd23819bb0b24d1ece97057d7c469efb9e1d844/discovery/syncer.go#L809, https://github.com/ACINQ/eclair/blob/b5461b80c83b3500449d5593afdce1d660e4aeb8/eclair-core/src/main/scala/fr/acinq/eclair/router/Router.scala#L584)

The behavior was already described in the rationale, this explicits it.

This adds a restriction for 'reply_channel_range' which is implied by
the fact of not maintaining up-to-date informations (for this 'chain').
Copy link
Copy Markdown
Collaborator

@t-bast t-bast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds reasonable, @sstone WDYT?

@darosior
Copy link
Copy Markdown
Contributor Author

This finally does not seem to be a good idea, as we are going to use the complete flags for lightnweight nodes, closing this

@darosior darosior closed this Oct 20, 2019
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.

2 participants