From 67bf952c5a7a2d26ac3dbf921c0d0e04bc85b207 Mon Sep 17 00:00:00 2001 From: vyzo Date: Thu, 20 Aug 2020 18:06:06 +0300 Subject: [PATCH 1/3] gomod: update go-libp2p-pubsub@master --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d3c945c38..140525640 100644 --- a/go.mod +++ b/go.mod @@ -94,7 +94,7 @@ require ( github.com/libp2p/go-libp2p-noise v0.1.1 github.com/libp2p/go-libp2p-peer v0.2.0 github.com/libp2p/go-libp2p-peerstore v0.2.6 - github.com/libp2p/go-libp2p-pubsub v0.3.4 + github.com/libp2p/go-libp2p-pubsub v0.3.5-0.20200820150332-b7c28b504da7 github.com/libp2p/go-libp2p-quic-transport v0.7.1 github.com/libp2p/go-libp2p-record v0.1.3 github.com/libp2p/go-libp2p-routing-helpers v0.2.3 diff --git a/go.sum b/go.sum index a916c6074..d1148ff09 100644 --- a/go.sum +++ b/go.sum @@ -885,8 +885,8 @@ github.com/libp2p/go-libp2p-protocol v0.0.1/go.mod h1:Af9n4PiruirSDjHycM1QuiMi/1 github.com/libp2p/go-libp2p-protocol v0.1.0/go.mod h1:KQPHpAabB57XQxGrXCNvbL6UEXfQqUgC/1adR2Xtflk= github.com/libp2p/go-libp2p-pubsub v0.1.1/go.mod h1:ZwlKzRSe1eGvSIdU5bD7+8RZN/Uzw0t1Bp9R1znpR/Q= github.com/libp2p/go-libp2p-pubsub v0.3.2-0.20200527132641-c0712c6e92cf/go.mod h1:TxPOBuo1FPdsTjFnv+FGZbNbWYsp74Culx+4ViQpato= -github.com/libp2p/go-libp2p-pubsub v0.3.4 h1:8PollxXtUvzy0DMn5XFMg/JihjaKboWyk3ML6yRW1Lk= -github.com/libp2p/go-libp2p-pubsub v0.3.4/go.mod h1:DTMSVmZZfXodB/pvdTGrY2eHPZ9W2ev7hzTH83OKHrI= +github.com/libp2p/go-libp2p-pubsub v0.3.5-0.20200820150332-b7c28b504da7 h1:Ze6e0RU+JjLXYZEHUff1ziDC6hrmeMovwXHVpHLeyhc= +github.com/libp2p/go-libp2p-pubsub v0.3.5-0.20200820150332-b7c28b504da7/go.mod h1:DTMSVmZZfXodB/pvdTGrY2eHPZ9W2ev7hzTH83OKHrI= github.com/libp2p/go-libp2p-quic-transport v0.1.1/go.mod h1:wqG/jzhF3Pu2NrhJEvE+IE0NTHNXslOPn9JQzyCAxzU= github.com/libp2p/go-libp2p-quic-transport v0.5.0/go.mod h1:IEcuC5MLxvZ5KuHKjRu+dr3LjCT1Be3rcD/4d8JrX8M= github.com/libp2p/go-libp2p-quic-transport v0.7.1 h1:X6Ond9GANspXpgwJlSR9yxcMMD6SLBnGKRtwjBG5awc= From 98d6d25c74302a1d8c36ec045476d95cd008e965 Mon Sep 17 00:00:00 2001 From: vyzo Date: Thu, 20 Aug 2020 18:08:02 +0300 Subject: [PATCH 2/3] pubsub: set behaviour penalty threshold, increase IWANT follow up time to 5s --- node/modules/lp2p/pubsub.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/node/modules/lp2p/pubsub.go b/node/modules/lp2p/pubsub.go index bea5437ce..9acb19089 100644 --- a/node/modules/lp2p/pubsub.go +++ b/node/modules/lp2p/pubsub.go @@ -31,6 +31,7 @@ func init() { pubsub.GossipSubDhi = 12 pubsub.GossipSubDlazy = 12 pubsub.GossipSubDirectConnectInitialDelay = 30 * time.Second + pubsub.GossipSubIWantFollowupTime = 5 * time.Second } func ScoreKeeper() *dtypes.ScoreKeeper { return new(dtypes.ScoreKeeper) @@ -110,8 +111,9 @@ func GossipSub(in GossipIn) (service *pubsub.PubSub, err error) { // IPColocationFactorWhitelist: map[string]struct{}{}, // P7: behavioural penalties, decay after 1hr - BehaviourPenaltyWeight: -10, - BehaviourPenaltyDecay: pubsub.ScoreParameterDecay(time.Hour), + BehaviourPenaltyWeight: -10, + BehaviourPenaltyThreshold: 3, + BehaviourPenaltyDecay: pubsub.ScoreParameterDecay(time.Hour), DecayInterval: pubsub.DefaultDecayInterval, DecayToZero: pubsub.DefaultDecayToZero, From 6193f4e062e2a3ac7fcfe0e084fe437c6607267b Mon Sep 17 00:00:00 2001 From: vyzo Date: Thu, 20 Aug 2020 18:09:17 +0300 Subject: [PATCH 3/3] pubsub: increase gossip history length to 10 heartbeats --- node/modules/lp2p/pubsub.go | 1 + 1 file changed, 1 insertion(+) diff --git a/node/modules/lp2p/pubsub.go b/node/modules/lp2p/pubsub.go index 9acb19089..41f6599a8 100644 --- a/node/modules/lp2p/pubsub.go +++ b/node/modules/lp2p/pubsub.go @@ -32,6 +32,7 @@ func init() { pubsub.GossipSubDlazy = 12 pubsub.GossipSubDirectConnectInitialDelay = 30 * time.Second pubsub.GossipSubIWantFollowupTime = 5 * time.Second + pubsub.GossipSubHistoryLength = 10 } func ScoreKeeper() *dtypes.ScoreKeeper { return new(dtypes.ScoreKeeper)