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

Retransmit NodeAnnouncement on regular intervals #2084

Merged
merged 8 commits into from Sep 17, 2019

Conversation

@halseth
Copy link
Collaborator

@halseth halseth commented Oct 23, 2018

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.

Copy link
Collaborator

@wpaulino wpaulino left a comment

Nice commit structure!

discovery/gossiper.go Outdated Show resolved Hide resolved
discovery/gossiper_test.go Outdated Show resolved Hide resolved
discovery/gossiper_test.go Outdated Show resolved Hide resolved
discovery/gossiper_test.go Outdated Show resolved Hide resolved
discovery/gossiper_test.go Outdated Show resolved Hide resolved
discovery/gossiper.go Outdated Show resolved Hide resolved
server.go Outdated
ProofMatureDelta: 0,
TrickleDelay: time.Millisecond * time.Duration(cfg.TrickleDelay),
RetransmitDelay: time.Minute * 30,
RebroadcastInterval: time.Hour * 24,
Copy link
Collaborator

@wpaulino wpaulino Oct 27, 2018

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
Collaborator Author

@halseth halseth Oct 29, 2018

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
Collaborator

@wpaulino wpaulino Sep 10, 2019

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.

@halseth halseth force-pushed the node-announcement-stale branch 3 times, most recently from 8821aad to 89edb0d Oct 30, 2018
@halseth halseth force-pushed the node-announcement-stale branch 2 times, most recently from f8ab1a7 to ce72601 Nov 9, 2018
@wpaulino
Copy link
Collaborator

@wpaulino wpaulino commented Sep 3, 2019

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 Sep 4, 2019
@halseth halseth force-pushed the node-announcement-stale branch from 16d4bac to 5085beb Sep 4, 2019
@halseth
Copy link
Collaborator Author

@halseth halseth commented Sep 4, 2019

Rebased.

@halseth halseth requested a review from wpaulino Sep 4, 2019
discovery/gossiper_test.go Outdated Show resolved Hide resolved
discovery/gossiper.go Outdated Show resolved Hide resolved
discovery/gossiper_test.go Outdated Show resolved Hide resolved
discovery/gossiper_test.go Outdated Show resolved Hide resolved
@wpaulino wpaulino removed the request for review from Roasbeef Sep 4, 2019
discovery/gossiper.go Show resolved Hide resolved
discovery/gossiper_test.go Show resolved Hide resolved
discovery/gossiper_test.go Outdated Show resolved Hide resolved
discovery/gossiper.go Outdated Show resolved Hide resolved
err)
}

timestamp := time.Unix(int64(currentNodeAnn.Timestamp), 0)
Copy link
Collaborator

@wpaulino wpaulino Sep 4, 2019

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
Collaborator

@wpaulino wpaulino Sep 10, 2019

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
Collaborator Author

@halseth halseth Sep 12, 2019

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
Collaborator Author

@halseth halseth Sep 12, 2019

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
Collaborator Author

@halseth halseth Sep 12, 2019

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
Collaborator

@wpaulino wpaulino Sep 14, 2019

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.

discovery/gossiper_test.go Outdated Show resolved Hide resolved
@halseth halseth force-pushed the node-announcement-stale branch 4 times, most recently from 506d249 to 4dc3b2c Sep 10, 2019
@halseth halseth requested review from cfromknecht and wpaulino Sep 10, 2019
discovery/gossiper.go Outdated Show resolved Hide resolved
err)
}

timestamp := time.Unix(int64(currentNodeAnn.Timestamp), 0)
Copy link
Collaborator

@wpaulino wpaulino Sep 10, 2019

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.

discovery/gossiper_test.go Outdated Show resolved Hide resolved
@halseth halseth force-pushed the node-announcement-stale branch from 4dc3b2c to ec91c34 Sep 11, 2019
@halseth halseth force-pushed the node-announcement-stale branch from ec91c34 to 92123c6 Sep 16, 2019
Copy link
Collaborator

@cfromknecht cfromknecht left a comment

LGTM 🔥

Copy link
Collaborator

@wpaulino wpaulino left a comment

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

@halseth
Copy link
Collaborator Author

@halseth halseth commented Sep 17, 2019

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
Collaborator

@wpaulino wpaulino commented Sep 17, 2019

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
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants