Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

peer: avoid chansync resend loop #4010

Merged
merged 1 commit into from
Mar 11, 2020

Conversation

halseth
Copy link
Contributor

@halseth halseth commented Feb 17, 2020

If a peer receives a channel reestablish message shortly after the
channel has been closed, it will resend its own channel reestablish
message. In the meantime the other peer could also have seen the channel
being closed and will also resend its own message. This leads to a
resend loop that never terminates.

To avoid two peers getting into this situation, we now allow only one
such resent message per conenction.

Noticed during integration tests: https://travis-ci.org/lightningnetwork/lnd/jobs/650839757?utm_medium=notification&utm_source=github_status

@halseth halseth added the p2p Code related to the peer-to-peer behaviour label Feb 17, 2020
@halseth halseth added this to the 0.10.0 milestone Feb 18, 2020
Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

Fix looks sound, but appears half of it is missing (actually populating resentChanSyncMsg.

peer.go Show resolved Hide resolved
@halseth halseth force-pushed the avoid-resend-chansync-loop branch from a377a5d to 77a2dbf Compare February 19, 2020 08:03
@halseth halseth requested a review from Roasbeef February 19, 2020 08:04
Copy link
Contributor

@cfromknecht cfromknecht left a comment

Choose a reason for hiding this comment

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

LGTM 🤘

Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

LGTM 🗿

Needs a rebase to land.

If a peer receives a channel reestablish message shortly after the
channel has been closed, it will resend its own channel reestablish
message. In the meantime the other peer could also have seen the channel
being closed and will also resend its own message. This leads to a
resend loop that never terminates.

To avoid two peers getting into this situation, we now allow only one
such resent message per conection.
@halseth halseth force-pushed the avoid-resend-chansync-loop branch from 77a2dbf to 7b8eae3 Compare March 11, 2020 11:14
@halseth halseth merged commit 5484436 into lightningnetwork:master Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flake fix p2p Code related to the peer-to-peer behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants