From c616958557d13168be436efb2b96b6c5168c6d43 Mon Sep 17 00:00:00 2001 From: vyzo Date: Sat, 5 Sep 2020 23:46:49 +0300 Subject: [PATCH] specify topic delivery weights, with priority for blocks --- node/modules/lp2p/pubsub.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/node/modules/lp2p/pubsub.go b/node/modules/lp2p/pubsub.go index c44d3dab8..d81133f81 100644 --- a/node/modules/lp2p/pubsub.go +++ b/node/modules/lp2p/pubsub.go @@ -278,7 +278,12 @@ func GossipSub(in GossipIn) (service *pubsub.PubSub, err error) { } // validation queue RED - options = append(options, pubsub.WithPeerGater(pubsub.DefaultPeerGaterParams())) + options = append(options, pubsub.WithPeerGater( + pubsub.DefaultPeerGaterParams().WithTopicDeliveryWeights(map[string]float64{ + drandTopic: 5, + build.BlocksTopic(in.Nn): 10, + build.MessagesTopic(in.Nn): 1, + }))) // tracer if in.Cfg.RemoteTracer != "" {