@libp2p/gossipsub 16.1.1 → 17.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 +2 -1
- package/dist/index.min.js.map +4 -4
- package/dist/src/constants.d.ts +13 -0
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +13 -0
- package/dist/src/constants.js.map +1 -1
- package/dist/src/gossipsub.d.ts +3 -0
- package/dist/src/gossipsub.d.ts.map +1 -1
- package/dist/src/gossipsub.js +33 -5
- package/dist/src/gossipsub.js.map +1 -1
- package/dist/src/index.d.ts +11 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js.map +1 -1
- package/package.json +1 -1
- package/src/constants.ts +15 -0
- package/src/gossipsub.ts +37 -6
- package/src/index.ts +12 -0
package/src/index.ts
CHANGED
|
@@ -197,6 +197,18 @@ export interface GossipsubOpts extends GossipsubOptsSpec {
|
|
|
197
197
|
*/
|
|
198
198
|
allowedTopics?: string[] | Set<string>
|
|
199
199
|
|
|
200
|
+
/**
|
|
201
|
+
* A per-peer memory budget for tracking that peer's topic subscriptions. Each
|
|
202
|
+
* subscribed topic costs its string length plus a fixed per-entry overhead
|
|
203
|
+
* (~1 KiB, approximating the Map/Set bookkeeping), so this bounds both the
|
|
204
|
+
* total topic bytes and the number of topics a single peer may occupy in the
|
|
205
|
+
* topics map (roughly budget / 1 KiB topics). Subscriptions beyond the budget
|
|
206
|
+
* are ignored; a peer that reaches it silently stops receiving messages for
|
|
207
|
+
* further topics, so keep this well above any legitimate peer's needs.
|
|
208
|
+
* (default 1 MiB, ~1000 topics)
|
|
209
|
+
*/
|
|
210
|
+
maxTopicBytesPerPeer?: number
|
|
211
|
+
|
|
200
212
|
/**
|
|
201
213
|
* Limits to bound protobuf decoding
|
|
202
214
|
*/
|