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

Gossip ratelimiting #3040


Copy link

@rustyrussell rustyrussell commented Sep 9, 2019

We more aggressively suppress our own gossip, and we have a ratelimit on others' gossip. We also enforce timestamp sanity on gossip we receive (I'm surprised we didn't already!).

Closes: #2993
Closes: #2994

@rustyrussell rustyrussell added this to the 0.7.3 milestone Sep 9, 2019
@rustyrussell rustyrussell requested a review from cdecker as a code owner Sep 9, 2019
@rustyrussell rustyrussell added this to To Do in Gossip: sip, don't gulp. via automation Sep 9, 2019
@rustyrussell rustyrussell moved this from To Do to Working... in Gossip: sip, don't gulp. Sep 9, 2019
rustyrussell added 15 commits Sep 10, 2019
We overrode this with travis, but it's not a travis issue.

Signed-off-by: Rusty Russell <>
We've been slack, but it's going to be important for testing

Signed-off-by: Rusty Russell <>
In particular, the timestamp might be wrong once we start checking that.

Signed-off-by: Rusty Russell <>
Signed-off-by: Rusty Russell <>
sig is only non-const so we can override if NULL, but talz helps
us here.

Signed-off-by: Rusty Russell <>
Write helpers to split it into non-timestamp, non-signature parts,
and simply compare those.  We extract a helper to do channel_update, too.

This is more generic than our previous approach, and simpler.

Signed-off-by: Rusty Russell <>
Default is 5 x gossip interval == 5 minutes.

Signed-off-by: Rusty Russell <>
Never make them less than gossip_min_interval apart.

Signed-off-by: Rusty Russell <>
Make update_local_channel use a timer if it's too soon to make another

1. Implement cupdate_different() which compares two updates.
2. make update_local_channel() take a single arg for timer usage.
3. Set timestamp of non-disable update back 5 minutes, so we can
   always generate a disable update if we need to.
4. Make update_local_channel() itself do the "unchanged update" suppression.

Signed-off-by: Rusty Russell <>
gossipd.c is doing too many things: this is a start.

Signed-off-by: Rusty Russell <>
This is useful for various "partial timestamp" forms of propagation
in future, esp. minisketch.

Signed-off-by: Rusty Russell <>
One day is plenty of time to propagate the update.

Signed-off-by: Rusty Russell <>
If you send a message which simply changes timestamp and signature, we
drop it.  You shouldn't be doing that, and the door to ignoring them
was opened by by option_gossip_query_ex, which would allow clients to
ignore updates with the same checksum.

This is more aggressive at reducing spam messages, but we allow refreshes
(to be conservative, we allow them even when 1/2 of the way through the
refresh period).

I dropped the now-unnecessary sleep from test_gossip_pruning, too.

Signed-off-by: Rusty Russell <>
And similar for node_announcement.

Signed-off-by: Rusty Russell <>
Signed-off-by: Rusty Russell <>
@rustyrussell rustyrussell force-pushed the guilt/dont-rexmit-recvd-gossip branch from 185f954 to 5dd585e Compare Sep 10, 2019
Copy link
Contributor Author

@rustyrussell rustyrussell commented Sep 10, 2019

Closing to break it up into more reviewable pieces.

@rustyrussell rustyrussell deleted the guilt/dont-rexmit-recvd-gossip branch Sep 10, 2019
@rustyrussell rustyrussell moved this from Working... to Done in Gossip: sip, don't gulp. Oct 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant