@libp2p/gossipsub 15.0.23-ed1ad1f26 → 16.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +3 -3
- package/dist/src/constants.d.ts +4 -0
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +4 -0
- package/dist/src/constants.js.map +1 -1
- package/dist/src/gossipsub.d.ts +6 -0
- package/dist/src/gossipsub.d.ts.map +1 -1
- package/dist/src/gossipsub.js +64 -30
- package/dist/src/gossipsub.js.map +1 -1
- package/dist/src/message/decodeRpc.d.ts.map +1 -1
- package/dist/src/message/decodeRpc.js +8 -7
- package/dist/src/message/decodeRpc.js.map +1 -1
- package/dist/typedoc-urls.json +195 -0
- package/package.json +9 -9
- package/src/constants.ts +5 -0
- package/src/gossipsub.ts +69 -30
- package/src/message/decodeRpc.ts +8 -7
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
{
|
|
2
|
+
"TopicValidatorResult": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub..TopicValidatorResult.html",
|
|
3
|
+
".:TopicValidatorResult": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub..TopicValidatorResult.html",
|
|
4
|
+
"GossipSub": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..GossipSub.html",
|
|
5
|
+
".:GossipSub": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..GossipSub.html",
|
|
6
|
+
"GossipSubComponents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..GossipSubComponents.html",
|
|
7
|
+
".:GossipSubComponents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..GossipSubComponents.html",
|
|
8
|
+
"GossipSubEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..GossipSubEvents.html",
|
|
9
|
+
".:GossipSubEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..GossipSubEvents.html",
|
|
10
|
+
"GossipsubMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..GossipsubMessage.html",
|
|
11
|
+
".:GossipsubMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..GossipsubMessage.html",
|
|
12
|
+
"GossipsubOpts": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..GossipsubOpts.html",
|
|
13
|
+
".:GossipsubOpts": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..GossipsubOpts.html",
|
|
14
|
+
"MeshPeer": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..MeshPeer.html",
|
|
15
|
+
".:MeshPeer": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..MeshPeer.html",
|
|
16
|
+
"PublishResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..PublishResult.html",
|
|
17
|
+
".:PublishResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..PublishResult.html",
|
|
18
|
+
"SignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..SignedMessage.html",
|
|
19
|
+
".:SignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..SignedMessage.html",
|
|
20
|
+
"Subscription": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..Subscription.html",
|
|
21
|
+
".:Subscription": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..Subscription.html",
|
|
22
|
+
"SubscriptionChangeData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..SubscriptionChangeData.html",
|
|
23
|
+
".:SubscriptionChangeData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..SubscriptionChangeData.html",
|
|
24
|
+
"TopicValidatorFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..TopicValidatorFn.html",
|
|
25
|
+
".:TopicValidatorFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..TopicValidatorFn.html",
|
|
26
|
+
"UnsignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..UnsignedMessage.html",
|
|
27
|
+
".:UnsignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..UnsignedMessage.html",
|
|
28
|
+
"Message": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub..Message.html",
|
|
29
|
+
".:Message": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub..Message.html",
|
|
30
|
+
"SignaturePolicy": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub..SignaturePolicy.html",
|
|
31
|
+
".:SignaturePolicy": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub..SignaturePolicy.html",
|
|
32
|
+
"multicodec": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub..multicodec.html",
|
|
33
|
+
".:multicodec": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub..multicodec.html",
|
|
34
|
+
"StrictNoSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub..StrictNoSign.html",
|
|
35
|
+
".:StrictNoSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub..StrictNoSign.html",
|
|
36
|
+
"StrictSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub..StrictSign.html",
|
|
37
|
+
".:StrictSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub..StrictSign.html",
|
|
38
|
+
"gossipsub": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub..gossipsub.html",
|
|
39
|
+
".:gossipsub": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub..gossipsub.html",
|
|
40
|
+
"ControlGraftTopicIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlGraft.ControlGraftTopicIDFieldEvent.html",
|
|
41
|
+
"codec": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.message.RPC.ControlGraft.codec.html",
|
|
42
|
+
"decode": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.message.RPC.ControlGraft.decode.html",
|
|
43
|
+
"encode": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.message.RPC.ControlGraft.encode.html",
|
|
44
|
+
"stream": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.message.RPC.ControlGraft.stream.html",
|
|
45
|
+
"ControlIDontWantMessageIDsFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlIDontWant.ControlIDontWantMessageIDsFieldEvent.html",
|
|
46
|
+
"ControlIHaveMessageIDsFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlIHave.ControlIHaveMessageIDsFieldEvent.html",
|
|
47
|
+
"ControlIHaveTopicIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlIHave.ControlIHaveTopicIDFieldEvent.html",
|
|
48
|
+
"ControlIWantMessageIDsFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlIWant.ControlIWantMessageIDsFieldEvent.html",
|
|
49
|
+
"ControlMessageGraftTopicIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlMessage.ControlMessageGraftTopicIDFieldEvent.html",
|
|
50
|
+
"ControlMessageIdontwantMessageIDsFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlMessage.ControlMessageIdontwantMessageIDsFieldEvent.html",
|
|
51
|
+
"ControlMessageIhaveMessageIDsFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlMessage.ControlMessageIhaveMessageIDsFieldEvent.html",
|
|
52
|
+
"ControlMessageIhaveTopicIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlMessage.ControlMessageIhaveTopicIDFieldEvent.html",
|
|
53
|
+
"ControlMessageIwantMessageIDsFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlMessage.ControlMessageIwantMessageIDsFieldEvent.html",
|
|
54
|
+
"ControlMessagePruneBackoffFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlMessage.ControlMessagePruneBackoffFieldEvent.html",
|
|
55
|
+
"ControlMessagePrunePeersPeerIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlMessage.ControlMessagePrunePeersPeerIDFieldEvent.html",
|
|
56
|
+
"ControlMessagePrunePeersSignedPeerRecordFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlMessage.ControlMessagePrunePeersSignedPeerRecordFieldEvent.html",
|
|
57
|
+
"ControlMessagePruneTopicIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlMessage.ControlMessagePruneTopicIDFieldEvent.html",
|
|
58
|
+
"ControlPruneBackoffFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlPrune.ControlPruneBackoffFieldEvent.html",
|
|
59
|
+
"ControlPrunePeersPeerIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlPrune.ControlPrunePeersPeerIDFieldEvent.html",
|
|
60
|
+
"ControlPrunePeersSignedPeerRecordFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlPrune.ControlPrunePeersSignedPeerRecordFieldEvent.html",
|
|
61
|
+
"ControlPruneTopicIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlPrune.ControlPruneTopicIDFieldEvent.html",
|
|
62
|
+
"MessageDataFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.Message.MessageDataFieldEvent.html",
|
|
63
|
+
"MessageFromFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.Message.MessageFromFieldEvent.html",
|
|
64
|
+
"MessageKeyFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.Message.MessageKeyFieldEvent.html",
|
|
65
|
+
"MessageSeqnoFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.Message.MessageSeqnoFieldEvent.html",
|
|
66
|
+
"MessageSignatureFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.Message.MessageSignatureFieldEvent.html",
|
|
67
|
+
"MessageTopicFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.Message.MessageTopicFieldEvent.html",
|
|
68
|
+
"PeerInfoPeerIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.PeerInfo.PeerInfoPeerIDFieldEvent.html",
|
|
69
|
+
"PeerInfoSignedPeerRecordFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.PeerInfo.PeerInfoSignedPeerRecordFieldEvent.html",
|
|
70
|
+
"SubOptsSubscribeFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.SubOpts.SubOptsSubscribeFieldEvent.html",
|
|
71
|
+
"SubOptsTopicFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.SubOpts.SubOptsTopicFieldEvent.html",
|
|
72
|
+
"ControlGraft": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlGraft.html",
|
|
73
|
+
"ControlIDontWant": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlIDontWant.html",
|
|
74
|
+
"ControlIHave": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlIHave.html",
|
|
75
|
+
"ControlIWant": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlIWant.html",
|
|
76
|
+
"ControlMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlMessage.html",
|
|
77
|
+
"ControlPrune": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlPrune.html",
|
|
78
|
+
"PeerInfo": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.PeerInfo.html",
|
|
79
|
+
"RPCControlGraftTopicIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCControlGraftTopicIDFieldEvent.html",
|
|
80
|
+
"RPCControlIdontwantMessageIDsFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCControlIdontwantMessageIDsFieldEvent.html",
|
|
81
|
+
"RPCControlIhaveMessageIDsFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCControlIhaveMessageIDsFieldEvent.html",
|
|
82
|
+
"RPCControlIhaveTopicIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCControlIhaveTopicIDFieldEvent.html",
|
|
83
|
+
"RPCControlIwantMessageIDsFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCControlIwantMessageIDsFieldEvent.html",
|
|
84
|
+
"RPCControlPruneBackoffFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCControlPruneBackoffFieldEvent.html",
|
|
85
|
+
"RPCControlPrunePeersPeerIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCControlPrunePeersPeerIDFieldEvent.html",
|
|
86
|
+
"RPCControlPrunePeersSignedPeerRecordFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCControlPrunePeersSignedPeerRecordFieldEvent.html",
|
|
87
|
+
"RPCControlPruneTopicIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCControlPruneTopicIDFieldEvent.html",
|
|
88
|
+
"RPCMessagesDataFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCMessagesDataFieldEvent.html",
|
|
89
|
+
"RPCMessagesFromFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCMessagesFromFieldEvent.html",
|
|
90
|
+
"RPCMessagesKeyFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCMessagesKeyFieldEvent.html",
|
|
91
|
+
"RPCMessagesSeqnoFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCMessagesSeqnoFieldEvent.html",
|
|
92
|
+
"RPCMessagesSignatureFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCMessagesSignatureFieldEvent.html",
|
|
93
|
+
"RPCMessagesTopicFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCMessagesTopicFieldEvent.html",
|
|
94
|
+
"RPCSubscriptionsSubscribeFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCSubscriptionsSubscribeFieldEvent.html",
|
|
95
|
+
"RPCSubscriptionsTopicFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCSubscriptionsTopicFieldEvent.html",
|
|
96
|
+
"SubOpts": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.SubOpts.html",
|
|
97
|
+
"RPC": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.html",
|
|
98
|
+
"ChurnReason": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.ChurnReason.html",
|
|
99
|
+
"./metrics:ChurnReason": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.ChurnReason.html",
|
|
100
|
+
"IHaveIgnoreReason": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.IHaveIgnoreReason.html",
|
|
101
|
+
"./metrics:IHaveIgnoreReason": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.IHaveIgnoreReason.html",
|
|
102
|
+
"InclusionReason": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.InclusionReason.html",
|
|
103
|
+
"./metrics:InclusionReason": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.InclusionReason.html",
|
|
104
|
+
"MessageSource": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.MessageSource.html",
|
|
105
|
+
"./metrics:MessageSource": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.MessageSource.html",
|
|
106
|
+
"ScorePenalty": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.ScorePenalty.html",
|
|
107
|
+
"./metrics:ScorePenalty": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.ScorePenalty.html",
|
|
108
|
+
"ScoreThreshold": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.ScoreThreshold.html",
|
|
109
|
+
"./metrics:ScoreThreshold": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.ScoreThreshold.html",
|
|
110
|
+
"AvgMinMax": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.AvgMinMax.html",
|
|
111
|
+
"./metrics:AvgMinMax": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.AvgMinMax.html",
|
|
112
|
+
"Gauge": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.Gauge.html",
|
|
113
|
+
"./metrics:Gauge": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.Gauge.html",
|
|
114
|
+
"Histogram": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.Histogram.html",
|
|
115
|
+
"./metrics:Histogram": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.Histogram.html",
|
|
116
|
+
"MetricsRegister": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.MetricsRegister.html",
|
|
117
|
+
"./metrics:MetricsRegister": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.MetricsRegister.html",
|
|
118
|
+
"ScoreWeights": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.ScoreWeights.html",
|
|
119
|
+
"./metrics:ScoreWeights": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.ScoreWeights.html",
|
|
120
|
+
"ToAddGroupCount": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.ToAddGroupCount.html",
|
|
121
|
+
"./metrics:ToAddGroupCount": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.ToAddGroupCount.html",
|
|
122
|
+
"TopicScoreWeights": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.TopicScoreWeights.html",
|
|
123
|
+
"./metrics:TopicScoreWeights": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.TopicScoreWeights.html",
|
|
124
|
+
"ToSendGroupCount": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.ToSendGroupCount.html",
|
|
125
|
+
"./metrics:ToSendGroupCount": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.ToSendGroupCount.html",
|
|
126
|
+
"AvgMinMaxConfig": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.AvgMinMaxConfig.html",
|
|
127
|
+
"./metrics:AvgMinMaxConfig": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.AvgMinMaxConfig.html",
|
|
128
|
+
"GaugeConfig": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.GaugeConfig.html",
|
|
129
|
+
"./metrics:GaugeConfig": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.GaugeConfig.html",
|
|
130
|
+
"HistogramConfig": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.HistogramConfig.html",
|
|
131
|
+
"./metrics:HistogramConfig": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.HistogramConfig.html",
|
|
132
|
+
"Metrics": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.Metrics.html",
|
|
133
|
+
"./metrics:Metrics": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.Metrics.html",
|
|
134
|
+
"PeersByScoreThreshold": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.PeersByScoreThreshold.html",
|
|
135
|
+
"./metrics:PeersByScoreThreshold": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.PeersByScoreThreshold.html",
|
|
136
|
+
"PromiseDeliveredStats": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.PromiseDeliveredStats.html",
|
|
137
|
+
"./metrics:PromiseDeliveredStats": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.PromiseDeliveredStats.html",
|
|
138
|
+
"TopicLabel": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.TopicLabel.html",
|
|
139
|
+
"./metrics:TopicLabel": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.TopicLabel.html",
|
|
140
|
+
"TopicStrToLabel": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.TopicStrToLabel.html",
|
|
141
|
+
"./metrics:TopicStrToLabel": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.TopicStrToLabel.html",
|
|
142
|
+
"getMetrics": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.metrics.getMetrics.html",
|
|
143
|
+
"./metrics:getMetrics": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.metrics.getMetrics.html",
|
|
144
|
+
"PeerScore": "https://libp2p.github.io/js-libp2p/classes/_libp2p_gossipsub.score.PeerScore.html",
|
|
145
|
+
"PeerScoreParams": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.score.PeerScoreParams.html",
|
|
146
|
+
"PeerScoreThresholds": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.score.PeerScoreThresholds.html",
|
|
147
|
+
"TopicScoreParams": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.score.TopicScoreParams.html",
|
|
148
|
+
"PeerScoreStatsDump": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.score.PeerScoreStatsDump.html",
|
|
149
|
+
"defaultPeerScoreParams": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub.score.defaultPeerScoreParams.html",
|
|
150
|
+
"defaultPeerScoreThresholds": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub.score.defaultPeerScoreThresholds.html",
|
|
151
|
+
"defaultTopicScoreParams": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub.score.defaultTopicScoreParams.html",
|
|
152
|
+
"createPeerScoreParams": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.score.createPeerScoreParams.html",
|
|
153
|
+
"createPeerScoreThresholds": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.score.createPeerScoreThresholds.html",
|
|
154
|
+
"createTopicScoreParams": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.score.createTopicScoreParams.html",
|
|
155
|
+
"validatePeerScoreParams": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.score.validatePeerScoreParams.html",
|
|
156
|
+
"validatePeerScoreThresholds": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.score.validatePeerScoreThresholds.html",
|
|
157
|
+
"validateTopicScoreParams": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.score.validateTopicScoreParams.html",
|
|
158
|
+
"MessageStatus": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.types.MessageStatus.html",
|
|
159
|
+
"./types:MessageStatus": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.types.MessageStatus.html",
|
|
160
|
+
"PublishConfigType": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.types.PublishConfigType.html",
|
|
161
|
+
"./types:PublishConfigType": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.types.PublishConfigType.html",
|
|
162
|
+
"RejectReason": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.types.RejectReason.html",
|
|
163
|
+
"./types:RejectReason": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.types.RejectReason.html",
|
|
164
|
+
"./types:SignaturePolicy": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.types.SignaturePolicy.html",
|
|
165
|
+
"ValidateError": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.types.ValidateError.html",
|
|
166
|
+
"./types:ValidateError": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.types.ValidateError.html",
|
|
167
|
+
"AddrInfo": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.AddrInfo.html",
|
|
168
|
+
"./types:AddrInfo": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.AddrInfo.html",
|
|
169
|
+
"DataTransform": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.DataTransform.html",
|
|
170
|
+
"./types:DataTransform": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.DataTransform.html",
|
|
171
|
+
"FastMsgIdFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.FastMsgIdFn.html",
|
|
172
|
+
"./types:FastMsgIdFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.FastMsgIdFn.html",
|
|
173
|
+
"MessageId": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.MessageId.html",
|
|
174
|
+
"./types:MessageId": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.MessageId.html",
|
|
175
|
+
"MsgIdFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.MsgIdFn.html",
|
|
176
|
+
"./types:MsgIdFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.MsgIdFn.html",
|
|
177
|
+
"MsgIdToStrFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.MsgIdToStrFn.html",
|
|
178
|
+
"./types:MsgIdToStrFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.MsgIdToStrFn.html",
|
|
179
|
+
"PublishOpts": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.PublishOpts.html",
|
|
180
|
+
"./types:PublishOpts": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.PublishOpts.html",
|
|
181
|
+
"IPStr": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.IPStr.html",
|
|
182
|
+
"./types:IPStr": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.IPStr.html",
|
|
183
|
+
"MsgIdStr": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.MsgIdStr.html",
|
|
184
|
+
"./types:MsgIdStr": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.MsgIdStr.html",
|
|
185
|
+
"PeerIdStr": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.PeerIdStr.html",
|
|
186
|
+
"./types:PeerIdStr": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.PeerIdStr.html",
|
|
187
|
+
"PublishConfig": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.PublishConfig.html",
|
|
188
|
+
"./types:PublishConfig": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.PublishConfig.html",
|
|
189
|
+
"RejectReasonObj": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.RejectReasonObj.html",
|
|
190
|
+
"./types:RejectReasonObj": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.RejectReasonObj.html",
|
|
191
|
+
"TopicStr": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.TopicStr.html",
|
|
192
|
+
"./types:TopicStr": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.TopicStr.html",
|
|
193
|
+
"rejectReasonFromAcceptance": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.types.rejectReasonFromAcceptance.html",
|
|
194
|
+
"./types:rejectReasonFromAcceptance": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.types.rejectReasonFromAcceptance.html"
|
|
195
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/gossipsub",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.0",
|
|
4
4
|
"description": "A typescript implementation of gossipsub",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -79,11 +79,11 @@
|
|
|
79
79
|
},
|
|
80
80
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/gossipsub#readme",
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@libp2p/crypto": "5.1.18
|
|
83
|
-
"@libp2p/interface": "3.2.2
|
|
84
|
-
"@libp2p/interface-internal": "3.1.5
|
|
85
|
-
"@libp2p/peer-id": "6.0.9
|
|
86
|
-
"@libp2p/utils": "7.2.1
|
|
82
|
+
"@libp2p/crypto": "^5.1.18",
|
|
83
|
+
"@libp2p/interface": "^3.2.2",
|
|
84
|
+
"@libp2p/interface-internal": "^3.1.5",
|
|
85
|
+
"@libp2p/peer-id": "^6.0.9",
|
|
86
|
+
"@libp2p/utils": "^7.2.1",
|
|
87
87
|
"@multiformats/multiaddr": "^13.0.1",
|
|
88
88
|
"denque": "^2.1.0",
|
|
89
89
|
"it-length-prefixed": "^10.0.1",
|
|
@@ -97,9 +97,9 @@
|
|
|
97
97
|
"devDependencies": {
|
|
98
98
|
"@chainsafe/as-sha256": "^1.2.0",
|
|
99
99
|
"@dapplion/benchmark": "^1.0.0",
|
|
100
|
-
"@libp2p/floodsub": "11.0.
|
|
101
|
-
"@libp2p/logger": "6.2.7
|
|
102
|
-
"@libp2p/peer-store": "12.0.20
|
|
100
|
+
"@libp2p/floodsub": "^11.0.22",
|
|
101
|
+
"@libp2p/logger": "^6.2.7",
|
|
102
|
+
"@libp2p/peer-store": "^12.0.20",
|
|
103
103
|
"@types/node": "^22.18.1",
|
|
104
104
|
"@types/sinon": "^21.0.1",
|
|
105
105
|
"abortable-iterator": "^5.1.0",
|
package/src/constants.ts
CHANGED
|
@@ -214,6 +214,11 @@ export const GossipsubMaxIHaveLength = 5000
|
|
|
214
214
|
*/
|
|
215
215
|
export const GossipsubMaxIHaveMessages = 10
|
|
216
216
|
|
|
217
|
+
/**
|
|
218
|
+
* GossipsubMaxIWantMessages is the maximum number of IWANT messages to accept from a peer within a heartbeat.
|
|
219
|
+
*/
|
|
220
|
+
export const GossipsubMaxIWantMessages = 10
|
|
221
|
+
|
|
217
222
|
/**
|
|
218
223
|
* Time to wait for a message requested through IWANT following an IHAVE advertisement.
|
|
219
224
|
* If the message is not received within this window, a broken promise is declared and
|
package/src/gossipsub.ts
CHANGED
|
@@ -183,6 +183,9 @@ export class GossipSub extends TypedEventEmitter<GossipSubEvents> implements Typ
|
|
|
183
183
|
/** Number of messages we have asked from peer in the last heartbeat */
|
|
184
184
|
private readonly iasked = new Map<PeerIdStr, number>()
|
|
185
185
|
|
|
186
|
+
/** Number of IWANT messages we have received from peer in the last heartbeat */
|
|
187
|
+
private readonly iwantCounts = new Map<PeerIdStr, number>()
|
|
188
|
+
|
|
186
189
|
/** Prune backoff map */
|
|
187
190
|
private readonly backoff = new Map<TopicStr, Map<PeerIdStr, number>>()
|
|
188
191
|
|
|
@@ -592,6 +595,7 @@ export class GossipSub extends TypedEventEmitter<GossipSubEvents> implements Typ
|
|
|
592
595
|
this.control.clear()
|
|
593
596
|
this.peerhave.clear()
|
|
594
597
|
this.iasked.clear()
|
|
598
|
+
this.iwantCounts.clear()
|
|
595
599
|
this.backoff.clear()
|
|
596
600
|
this.outbound.clear()
|
|
597
601
|
this.gossipTracer.clear()
|
|
@@ -850,6 +854,29 @@ export class GossipSub extends TypedEventEmitter<GossipSubEvents> implements Typ
|
|
|
850
854
|
|
|
851
855
|
// MESSAGE METHODS
|
|
852
856
|
|
|
857
|
+
/**
|
|
858
|
+
* Decode an inbound RPC, enforcing this.decodeRpcLimits.
|
|
859
|
+
*/
|
|
860
|
+
private decodeRpc (rpcBytes: Uint8Array | Uint8ArrayList): RPC {
|
|
861
|
+
return RPC.decode(rpcBytes, {
|
|
862
|
+
limits: {
|
|
863
|
+
subscriptions: this.decodeRpcLimits.maxSubscriptions,
|
|
864
|
+
messages: this.decodeRpcLimits.maxMessages,
|
|
865
|
+
control: {
|
|
866
|
+
ihave: this.decodeRpcLimits.maxControlMessages,
|
|
867
|
+
ihave$: { messageIDs: this.decodeRpcLimits.maxIhaveMessageIDs },
|
|
868
|
+
iwant: this.decodeRpcLimits.maxControlMessages,
|
|
869
|
+
iwant$: { messageIDs: this.decodeRpcLimits.maxIwantMessageIDs },
|
|
870
|
+
graft: this.decodeRpcLimits.maxControlMessages,
|
|
871
|
+
prune: this.decodeRpcLimits.maxControlMessages,
|
|
872
|
+
prune$: { peers: this.decodeRpcLimits.maxPeerInfos },
|
|
873
|
+
idontwant: this.decodeRpcLimits.maxControlMessages,
|
|
874
|
+
idontwant$: { messageIDs: this.decodeRpcLimits.maxIdontwantMessageIDs }
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
})
|
|
878
|
+
}
|
|
879
|
+
|
|
853
880
|
/**
|
|
854
881
|
* Responsible for processing each RPC message received by other peers.
|
|
855
882
|
*/
|
|
@@ -862,25 +889,7 @@ export class GossipSub extends TypedEventEmitter<GossipSubEvents> implements Typ
|
|
|
862
889
|
const rpcBytes = data.subarray()
|
|
863
890
|
// Note: This function may throw, it must be wrapped in a try {} catch {} to prevent closing the stream.
|
|
864
891
|
// TODO: What should we do if the entire RPC is invalid?
|
|
865
|
-
const rpc =
|
|
866
|
-
limits: {
|
|
867
|
-
subscriptions: this.decodeRpcLimits.maxSubscriptions,
|
|
868
|
-
messages: this.decodeRpcLimits.maxMessages,
|
|
869
|
-
control$: {
|
|
870
|
-
ihave: this.decodeRpcLimits.maxIhaveMessageIDs,
|
|
871
|
-
iwant: this.decodeRpcLimits.maxIwantMessageIDs,
|
|
872
|
-
graft: this.decodeRpcLimits.maxControlMessages,
|
|
873
|
-
prune: this.decodeRpcLimits.maxControlMessages,
|
|
874
|
-
prune$: {
|
|
875
|
-
peers: this.decodeRpcLimits.maxPeerInfos
|
|
876
|
-
},
|
|
877
|
-
idontwant: this.decodeRpcLimits.maxControlMessages,
|
|
878
|
-
idontwant$: {
|
|
879
|
-
messageIDs: this.decodeRpcLimits.maxIdontwantMessageIDs
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
}
|
|
883
|
-
})
|
|
892
|
+
const rpc = this.decodeRpc(rpcBytes)
|
|
884
893
|
|
|
885
894
|
this.metrics?.onRpcRecv(rpc, rpcBytes.length)
|
|
886
895
|
|
|
@@ -1316,23 +1325,32 @@ export class GossipSub extends TypedEventEmitter<GossipSubEvents> implements Typ
|
|
|
1316
1325
|
// string msgId => msgId
|
|
1317
1326
|
const iwant = new Map<MsgIdStr, Uint8Array>()
|
|
1318
1327
|
|
|
1319
|
-
|
|
1328
|
+
// Cap the message ids we examine per call at GossipsubMaxIHaveLength
|
|
1329
|
+
let processed = 0
|
|
1330
|
+
// eslint-disable-next-line no-labels
|
|
1331
|
+
out: for (const { topicID, messageIDs } of ihave) {
|
|
1320
1332
|
if (topicID == null || (messageIDs == null) || !this.mesh.has(topicID)) {
|
|
1321
|
-
|
|
1333
|
+
continue
|
|
1322
1334
|
}
|
|
1323
1335
|
|
|
1324
1336
|
let idonthave = 0
|
|
1325
1337
|
|
|
1326
|
-
|
|
1338
|
+
for (const msgId of messageIDs) {
|
|
1339
|
+
if (processed >= constants.GossipsubMaxIHaveLength) {
|
|
1340
|
+
// eslint-disable-next-line no-labels
|
|
1341
|
+
break out
|
|
1342
|
+
}
|
|
1343
|
+
processed++
|
|
1344
|
+
|
|
1327
1345
|
const msgIdStr = this.msgIdToStrFn(msgId)
|
|
1328
1346
|
if (!this.seenCache.has(msgIdStr)) {
|
|
1329
1347
|
iwant.set(msgIdStr, msgId)
|
|
1330
1348
|
idonthave++
|
|
1331
1349
|
}
|
|
1332
|
-
}
|
|
1350
|
+
}
|
|
1333
1351
|
|
|
1334
1352
|
this.metrics?.onIhaveRcv(topicID, messageIDs.length, idonthave)
|
|
1335
|
-
}
|
|
1353
|
+
}
|
|
1336
1354
|
|
|
1337
1355
|
if (iwant.size === 0) {
|
|
1338
1356
|
return []
|
|
@@ -1378,29 +1396,49 @@ export class GossipSub extends TypedEventEmitter<GossipSubEvents> implements Typ
|
|
|
1378
1396
|
return []
|
|
1379
1397
|
}
|
|
1380
1398
|
|
|
1399
|
+
// IWANT flood protection
|
|
1400
|
+
const iwantCount = (this.iwantCounts.get(id) ?? 0) + 1
|
|
1401
|
+
this.iwantCounts.set(id, iwantCount)
|
|
1402
|
+
if (iwantCount > constants.GossipsubMaxIWantMessages) {
|
|
1403
|
+
this.log('IWANT: peer %s has requested too many times within this heartbeat interval; ignoring', id)
|
|
1404
|
+
return []
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1381
1407
|
const ihave = new Map<MsgIdStr, RPC.Message>()
|
|
1382
1408
|
const iwantByTopic = new Map<TopicStr, number>()
|
|
1383
1409
|
let iwantDonthave = 0
|
|
1384
1410
|
|
|
1385
|
-
|
|
1386
|
-
|
|
1411
|
+
// Cap the message ids we examine per call at GossipsubMaxIHaveLength
|
|
1412
|
+
let processed = 0
|
|
1413
|
+
// eslint-disable-next-line no-labels
|
|
1414
|
+
out: for (const { messageIDs } of iwant) {
|
|
1415
|
+
if (messageIDs == null) {
|
|
1416
|
+
continue
|
|
1417
|
+
}
|
|
1418
|
+
for (const msgId of messageIDs) {
|
|
1419
|
+
if (processed >= constants.GossipsubMaxIHaveLength) {
|
|
1420
|
+
// eslint-disable-next-line no-labels
|
|
1421
|
+
break out
|
|
1422
|
+
}
|
|
1423
|
+
processed++
|
|
1424
|
+
|
|
1387
1425
|
const msgIdStr = this.msgIdToStrFn(msgId)
|
|
1388
1426
|
const entry = this.mcache.getWithIWantCount(msgIdStr, id)
|
|
1389
1427
|
if (entry == null) {
|
|
1390
1428
|
iwantDonthave++
|
|
1391
|
-
|
|
1429
|
+
continue
|
|
1392
1430
|
}
|
|
1393
1431
|
|
|
1394
1432
|
iwantByTopic.set(entry.msg.topic, 1 + (iwantByTopic.get(entry.msg.topic) ?? 0))
|
|
1395
1433
|
|
|
1396
1434
|
if (entry.count > constants.GossipsubGossipRetransmission) {
|
|
1397
1435
|
this.log('IWANT: Peer %s has asked for message %s too many times: ignoring request', id, msgId)
|
|
1398
|
-
|
|
1436
|
+
continue
|
|
1399
1437
|
}
|
|
1400
1438
|
|
|
1401
1439
|
ihave.set(msgIdStr, entry.msg)
|
|
1402
|
-
}
|
|
1403
|
-
}
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1404
1442
|
|
|
1405
1443
|
this.metrics?.onIwantRcv(iwantByTopic, iwantDonthave)
|
|
1406
1444
|
|
|
@@ -2615,6 +2653,7 @@ export class GossipSub extends TypedEventEmitter<GossipSubEvents> implements Typ
|
|
|
2615
2653
|
this.peerhave.clear()
|
|
2616
2654
|
this.metrics?.cacheSize.set({ cache: 'iasked' }, this.iasked.size)
|
|
2617
2655
|
this.iasked.clear()
|
|
2656
|
+
this.iwantCounts.clear()
|
|
2618
2657
|
|
|
2619
2658
|
// apply IWANT request penalties
|
|
2620
2659
|
this.applyIwantPenalties()
|
package/src/message/decodeRpc.ts
CHANGED
|
@@ -9,11 +9,12 @@ export interface DecodeRPCLimits {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export const defaultDecodeRpcLimits: DecodeRPCLimits = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
maxControlMessages:
|
|
18
|
-
|
|
12
|
+
// 5000 = GossipsubMaxIHaveLength, used as a generous upper bound for these
|
|
13
|
+
maxSubscriptions: 5000,
|
|
14
|
+
maxMessages: 5000,
|
|
15
|
+
maxIhaveMessageIDs: 5000,
|
|
16
|
+
maxIwantMessageIDs: 5000,
|
|
17
|
+
maxControlMessages: 5000,
|
|
18
|
+
maxIdontwantMessageIDs: 512, // GossipsubIdontwantMaxMessages
|
|
19
|
+
maxPeerInfos: 16 // GossipsubPrunePeers
|
|
19
20
|
}
|