Skip to content

Retransmit NodeAnnouncement on regular intervals - #2084

Merged
wpaulino merged 8 commits into
lightningnetwork:masterfrom
halseth:node-announcement-stale
Sep 17, 2019
Merged

Retransmit NodeAnnouncement on regular intervals#2084
wpaulino merged 8 commits into
lightningnetwork:masterfrom
halseth:node-announcement-stale

Conversation

@halseth

@halseth halseth commented Oct 23, 2018

Copy link
Copy Markdown
Contributor

This PR makes the gossiper retransmit our NodeAnnouncement every 24 hrs, to avoid other nodes considering it being a zombie. This is similar to what is done for channels.

Fixes #2005.

@Roasbeef
Roasbeef requested a review from wpaulino October 24, 2018 01:19
@Roasbeef Roasbeef added p2p Code related to the peer-to-peer behaviour P3 might get fixed, nice to have needs review PR needs review by regular contributors labels Oct 24, 2018

@wpaulino wpaulino left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice commit structure!

Comment thread discovery/gossiper.go Outdated
Comment thread discovery/gossiper_test.go Outdated
Comment thread discovery/gossiper_test.go Outdated
Comment thread discovery/gossiper_test.go Outdated
Comment thread discovery/gossiper_test.go Outdated
Comment thread discovery/gossiper.go Outdated
Comment thread server.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any reason this is the default? It could be made less spammy IMO.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Could reasonably be made longer, but don't think one update every 24 hrs is the biggest spam problem atm.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sure but given that we only consider things stale after 2 weeks it could be set a bit higher.

@wpaulino wpaulino added the first pass review done PR has had first pass of review, needs more tho label Oct 27, 2018
@halseth
halseth force-pushed the node-announcement-stale branch 3 times, most recently from 8821aad to 89edb0d Compare October 30, 2018 09:36
@halseth
halseth force-pushed the node-announcement-stale branch 2 times, most recently from f8ab1a7 to ce72601 Compare November 9, 2018 12:09
@wpaulino

wpaulino commented Sep 3, 2019

Copy link
Copy Markdown
Contributor

Needs a rebase!

@wpaulino wpaulino added the v0.8.0 label Sep 3, 2019
@wpaulino wpaulino added this to the 0.8.0 milestone Sep 3, 2019
@halseth
halseth force-pushed the node-announcement-stale branch from ce72601 to 16d4bac Compare September 4, 2019 09:28
@halseth
halseth force-pushed the node-announcement-stale branch from 16d4bac to 5085beb Compare September 4, 2019 09:34
@halseth

halseth commented Sep 4, 2019

Copy link
Copy Markdown
Contributor Author

Rebased.

@halseth
halseth requested a review from wpaulino September 4, 2019 09:34
Comment thread discovery/gossiper_test.go Outdated
Comment thread discovery/gossiper.go Outdated
Comment thread discovery/gossiper_test.go Outdated
Comment thread discovery/gossiper_test.go Outdated
@wpaulino
wpaulino removed the request for review from Roasbeef September 4, 2019 22:03
Comment thread discovery/gossiper.go Outdated
Comment thread discovery/gossiper_test.go Outdated
Comment thread discovery/gossiper_test.go Outdated
Comment thread discovery/gossiper.go Outdated
Comment thread discovery/gossiper.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just something to note, the timestamp of our node announcement is updated to time.Now every time the server is started.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Because of this, if a node restarts before it reaches a full day of uptime, it'll never rebroadcast its node announcement.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think that's good enough for now. I think maybe there was an issue/PR already for transmitting the node announcement if it changes?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Relevant:
#1120
#325
#274

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Won't the announcement be rebroadcast when the time us updated at startup? From that issue it seems so.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think that's the case. We only seem to send when opening a channel or when running with --nat.

Comment thread discovery/gossiper_test.go Outdated
@halseth
halseth force-pushed the node-announcement-stale branch 4 times, most recently from 506d249 to 4dc3b2c Compare September 10, 2019 12:39
Comment thread discovery/gossiper.go Outdated
Comment thread discovery/gossiper.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Because of this, if a node restarts before it reaches a full day of uptime, it'll never rebroadcast its node announcement.

Comment thread discovery/gossiper_test.go Outdated
@halseth
halseth force-pushed the node-announcement-stale branch from 4dc3b2c to ec91c34 Compare September 11, 2019 10:50
@halseth
halseth force-pushed the node-announcement-stale branch from ec91c34 to 92123c6 Compare September 16, 2019 08:56

@cfromknecht cfromknecht left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 🔥

@wpaulino wpaulino left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, though I still think the node announcement timestamp issue should be addressed in order to be consistent, likely as a separate PR.

@halseth

halseth commented Sep 17, 2019

Copy link
Copy Markdown
Contributor Author

LGTM, though I still think the node announcement timestamp issue should be addressed in order to be consistent, likely as a separate PR.

I updated and reopened #274. Let me know if this is what you had in mind.

@wpaulino

Copy link
Copy Markdown
Contributor

I updated and reopened #274. Let me know if this is what you had in mind.

SGTM

@wpaulino
wpaulino merged commit 9e4c4c5 into lightningnetwork:master Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

first pass review done PR has had first pass of review, needs more tho needs review PR needs review by regular contributors p2p Code related to the peer-to-peer behaviour P3 might get fixed, nice to have

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Send out updated announcements periodically

5 participants