From bfc85238735f6c88a76a196a2cf2f4cee5ce9046 Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Wed, 10 Feb 2021 14:38:09 -0800 Subject: [PATCH] Revert "discovery: add new option to toggle gossip rate limiting" This reverts commit 13a2598ded5944c1bc91ecff2c2b1b156486bda5. --- discovery/gossiper.go | 10 ++-------- discovery/gossiper_test.go | 1 - server.go | 1 - 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/discovery/gossiper.go b/discovery/gossiper.go index e669f61a..5901dce1 100644 --- a/discovery/gossiper.go +++ b/discovery/gossiper.go @@ -233,11 +233,6 @@ type Config struct { // graph on connect. IgnoreHistoricalFilters bool - // GossipUpdateThrottle if true, then the gossiper will throttle - // gossip updates to once per RebroadcastInterval for any keep-alive - // updates, and once per block for other types of updates. - GossipUpdateThrottle bool - // PinnedSyncers is a set of peers that will always transition to // ActiveSync upon connection. These peers will never transition to // PassiveSync. @@ -1937,9 +1932,8 @@ func (d *AuthenticatedGossiper) processNetworkAnnouncement( // If we have a previous version of the edge being updated, // we'll want to rate limit its updates to prevent spam - // throughout the network if we're currently throttling such - // updates. - if d.cfg.GossipUpdateThrottle && nMsg.isRemote && edgeToUpdate != nil { + // throughout the network. + if nMsg.isRemote && edgeToUpdate != nil { // If it's a keep-alive update, we'll only propagate one // if it's been a day since the previous. This follows // our own heuristic of sending keep-alive updates after diff --git a/discovery/gossiper_test.go b/discovery/gossiper_test.go index 1c1e60ca..cab9e5f3 100644 --- a/discovery/gossiper_test.go +++ b/discovery/gossiper_test.go @@ -3938,7 +3938,6 @@ func TestRateLimitChannelUpdates(t *testing.T) { } defer cleanup() ctx.gossiper.cfg.RebroadcastInterval = time.Hour - ctx.gossiper.cfg.GossipUpdateThrottle = true // The graph should start empty. require.Empty(t, ctx.router.infos) diff --git a/server.go b/server.go index 8bf77cc6..7435e4bf 100644 --- a/server.go +++ b/server.go @@ -819,7 +819,6 @@ func newServer(cfg *Config, listenAddrs []net.Addr, MinimumBatchSize: 10, SubBatchDelay: time.Second * 5, IgnoreHistoricalFilters: cfg.IgnoreHistoricalGossipFilters, - GossipUpdateThrottle: !cfg.ProtocolOptions.NoGossipThrottle(), PinnedSyncers: cfg.Gossip.PinnedSyncers, }, s.identityECDH.PubKey(),