@@ -43,28 +43,34 @@ func LightPeerScoreParams(cfg *rollup.Config) pubsub.PeerScoreParams {
4343 tenEpochs := 10 * epoch
4444 oneHundredEpochs := 100 * epoch
4545 invalidDecayPeriod := 50 * epoch
46+
47+ defaultTopicScoreParams := pubsub.TopicScoreParams {
48+ TopicWeight : 0.8 ,
49+ TimeInMeshWeight : MaxInMeshScore / inMeshCap (slot ),
50+ TimeInMeshQuantum : slot ,
51+ TimeInMeshCap : inMeshCap (slot ),
52+ FirstMessageDeliveriesWeight : 1 ,
53+ FirstMessageDeliveriesDecay : ScoreDecay (20 * epoch , slot ),
54+ FirstMessageDeliveriesCap : 23 ,
55+ MeshMessageDeliveriesWeight : MeshWeight ,
56+ MeshMessageDeliveriesDecay : ScoreDecay (DecayEpoch * epoch , slot ),
57+ MeshMessageDeliveriesCap : float64 (uint64 (epoch / slot ) * uint64 (DecayEpoch )),
58+ MeshMessageDeliveriesThreshold : float64 (uint64 (epoch / slot ) * uint64 (DecayEpoch ) / 10 ),
59+ MeshMessageDeliveriesWindow : 2 * time .Second ,
60+ MeshMessageDeliveriesActivation : 4 * epoch ,
61+ MeshFailurePenaltyWeight : MeshWeight ,
62+ MeshFailurePenaltyDecay : ScoreDecay (DecayEpoch * epoch , slot ),
63+ InvalidMessageDeliveriesWeight : - 140.4475 ,
64+ InvalidMessageDeliveriesDecay : ScoreDecay (invalidDecayPeriod , slot ),
65+ }
66+
67+ topics := make (map [string ]* pubsub.TopicScoreParams )
68+ for _ , topic := range allBlocksTopics (cfg ) {
69+ topics [topic ] = & defaultTopicScoreParams
70+ }
71+
4672 return pubsub.PeerScoreParams {
47- Topics : map [string ]* pubsub.TopicScoreParams {
48- blocksTopicV1 (cfg ): {
49- TopicWeight : 0.8 ,
50- TimeInMeshWeight : MaxInMeshScore / inMeshCap (slot ),
51- TimeInMeshQuantum : slot ,
52- TimeInMeshCap : inMeshCap (slot ),
53- FirstMessageDeliveriesWeight : 1 ,
54- FirstMessageDeliveriesDecay : ScoreDecay (20 * epoch , slot ),
55- FirstMessageDeliveriesCap : 23 ,
56- MeshMessageDeliveriesWeight : MeshWeight ,
57- MeshMessageDeliveriesDecay : ScoreDecay (DecayEpoch * epoch , slot ),
58- MeshMessageDeliveriesCap : float64 (uint64 (epoch / slot ) * uint64 (DecayEpoch )),
59- MeshMessageDeliveriesThreshold : float64 (uint64 (epoch / slot ) * uint64 (DecayEpoch ) / 10 ),
60- MeshMessageDeliveriesWindow : 2 * time .Second ,
61- MeshMessageDeliveriesActivation : 4 * epoch ,
62- MeshFailurePenaltyWeight : MeshWeight ,
63- MeshFailurePenaltyDecay : ScoreDecay (DecayEpoch * epoch , slot ),
64- InvalidMessageDeliveriesWeight : - 140.4475 ,
65- InvalidMessageDeliveriesDecay : ScoreDecay (invalidDecayPeriod , slot ),
66- },
67- },
73+ Topics : topics ,
6874 TopicScoreCap : 34 ,
6975 AppSpecificScore : func (p peer.ID ) float64 {
7076 return 0
0 commit comments