@peerbit/pubsub 4.1.4-07ba572 → 4.1.4-14881a0

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.
Files changed (46) hide show
  1. package/README.md +23 -20
  2. package/dist/benchmark/fanout-tree-sim-lib.d.ts +201 -0
  3. package/dist/benchmark/fanout-tree-sim-lib.d.ts.map +1 -0
  4. package/dist/benchmark/fanout-tree-sim-lib.js +1225 -0
  5. package/dist/benchmark/fanout-tree-sim-lib.js.map +1 -0
  6. package/dist/benchmark/fanout-tree-sim.d.ts +11 -0
  7. package/dist/benchmark/fanout-tree-sim.d.ts.map +1 -0
  8. package/dist/benchmark/fanout-tree-sim.js +521 -0
  9. package/dist/benchmark/fanout-tree-sim.js.map +1 -0
  10. package/dist/benchmark/index.d.ts +6 -0
  11. package/dist/benchmark/index.d.ts.map +1 -1
  12. package/dist/benchmark/index.js +38 -80
  13. package/dist/benchmark/index.js.map +1 -1
  14. package/dist/benchmark/pubsub-topic-sim-lib.d.ts +82 -0
  15. package/dist/benchmark/pubsub-topic-sim-lib.d.ts.map +1 -0
  16. package/dist/benchmark/pubsub-topic-sim-lib.js +625 -0
  17. package/dist/benchmark/pubsub-topic-sim-lib.js.map +1 -0
  18. package/dist/benchmark/pubsub-topic-sim.d.ts +9 -0
  19. package/dist/benchmark/pubsub-topic-sim.d.ts.map +1 -0
  20. package/dist/benchmark/pubsub-topic-sim.js +116 -0
  21. package/dist/benchmark/pubsub-topic-sim.js.map +1 -0
  22. package/dist/benchmark/sim/bench-utils.d.ts +25 -0
  23. package/dist/benchmark/sim/bench-utils.d.ts.map +1 -0
  24. package/dist/benchmark/sim/bench-utils.js +141 -0
  25. package/dist/benchmark/sim/bench-utils.js.map +1 -0
  26. package/dist/src/fanout-channel.d.ts +62 -0
  27. package/dist/src/fanout-channel.d.ts.map +1 -0
  28. package/dist/src/fanout-channel.js +114 -0
  29. package/dist/src/fanout-channel.js.map +1 -0
  30. package/dist/src/fanout-tree.d.ts +550 -0
  31. package/dist/src/fanout-tree.d.ts.map +1 -0
  32. package/dist/src/fanout-tree.js +4943 -0
  33. package/dist/src/fanout-tree.js.map +1 -0
  34. package/dist/src/index.d.ts +162 -39
  35. package/dist/src/index.d.ts.map +1 -1
  36. package/dist/src/index.js +1376 -455
  37. package/dist/src/index.js.map +1 -1
  38. package/dist/src/topic-root-control-plane.d.ts +43 -0
  39. package/dist/src/topic-root-control-plane.d.ts.map +1 -0
  40. package/dist/src/topic-root-control-plane.js +120 -0
  41. package/dist/src/topic-root-control-plane.js.map +1 -0
  42. package/package.json +10 -9
  43. package/src/fanout-channel.ts +150 -0
  44. package/src/fanout-tree.ts +6297 -0
  45. package/src/index.ts +1638 -593
  46. package/src/topic-root-control-plane.ts +160 -0
@@ -1,75 +1,198 @@
1
- import { type PeerId as Libp2pPeerId } from "@libp2p/interface";
1
+ import { type Connection, type PeerId as Libp2pPeerId } from "@libp2p/interface";
2
2
  import { PublicSignKey } from "@peerbit/crypto";
3
3
  import { type PubSub, type PubSubEvents, SubscriptionData } from "@peerbit/pubsub-interface";
4
4
  import { DirectStream, type DirectStreamComponents, type DirectStreamOptions, type PeerStreams } from "@peerbit/stream";
5
- import { AcknowledgeDelivery, DataMessage, type IdOptions, type PriorityOptions, SeekDelivery, SilentDelivery } from "@peerbit/stream-interface";
5
+ import { AcknowledgeDelivery, DataMessage, type IdOptions, type PriorityOptions, SilentDelivery, type WithExtraSigners } from "@peerbit/stream-interface";
6
6
  import { Uint8ArrayList } from "uint8arraylist";
7
+ import type { FanoutTree, FanoutTreeChannelOptions, FanoutTreeJoinOptions } from "./fanout-tree.js";
8
+ import { TopicRootControlPlane } from "./topic-root-control-plane.js";
9
+ export * from "./fanout-tree.js";
10
+ export * from "./fanout-channel.js";
11
+ export * from "./topic-root-control-plane.js";
7
12
  export declare const toUint8Array: (arr: Uint8ArrayList | Uint8Array) => Uint8Array<ArrayBufferLike>;
8
13
  export declare const logger: import("@libp2p/interface").Logger;
9
- export interface PeerStreamsInit {
10
- id: Libp2pPeerId;
11
- protocol: string;
12
- }
13
- export type DirectSubOptions = {
14
- aggregate: boolean;
14
+ export type TopicControlPlaneOptions = DirectStreamOptions & {
15
+ dispatchEventOnSelfPublish?: boolean;
16
+ subscriptionDebounceDelay?: number;
17
+ topicRootControlPlane?: TopicRootControlPlane;
18
+ /**
19
+ * Fanout overlay used for sharded topic delivery.
20
+ */
21
+ fanout: FanoutTree;
22
+ /**
23
+ * Base fanout channel options for shard overlays (applies to both roots and nodes).
24
+ */
25
+ fanoutChannel?: Partial<Omit<FanoutTreeChannelOptions, "role">>;
26
+ /**
27
+ * Fanout channel overrides applied only when this node is the shard root.
28
+ */
29
+ fanoutRootChannel?: Partial<Omit<FanoutTreeChannelOptions, "role">>;
30
+ /**
31
+ * Fanout channel overrides applied when joining shard overlays as a node.
32
+ *
33
+ * This is the primary knob for "leaf-only" subscribers: set `maxChildren=0`
34
+ * for non-router nodes so they never become relays under churn.
35
+ */
36
+ fanoutNodeChannel?: Partial<Omit<FanoutTreeChannelOptions, "role">>;
37
+ /**
38
+ * Fanout join options for overlay topics.
39
+ */
40
+ fanoutJoin?: FanoutTreeJoinOptions;
41
+ /**
42
+ * Number of pubsub shards (overlays) used for topic delivery.
43
+ *
44
+ * Each user-topic deterministically maps to exactly one shard topic:
45
+ * `shard = hash(topic) % shardCount`, and subscription joins that shard overlay.
46
+ *
47
+ * Default: 256.
48
+ */
49
+ shardCount?: number;
50
+ /**
51
+ * Prefix used to form internal shard topics.
52
+ *
53
+ * Default: `/peerbit/pubsub-shard/1/`.
54
+ */
55
+ shardTopicPrefix?: string;
56
+ /**
57
+ * If enabled, this node will host (open as root) every shard for which it is
58
+ * the deterministically selected root.
59
+ *
60
+ * This is intended for "router"/"supernode" deployments.
61
+ *
62
+ * Default: `false`.
63
+ */
64
+ hostShards?: boolean;
65
+ /**
66
+ * Fanout-backed topics: require a local `subscribe(topic)` before `publish(topic)` is allowed.
67
+ *
68
+ * Default: `false` (publishing without subscribing will temporarily join the overlay).
69
+ */
70
+ fanoutPublishRequiresSubscribe?: boolean;
71
+ /**
72
+ * When publishing on a fanout topic without subscribing, keep the ephemeral join
73
+ * open for this long since the last publish, then auto-leave.
74
+ *
75
+ * Default: 60s. Set to `0` to close immediately after each publish.
76
+ */
77
+ fanoutPublishIdleCloseMs?: number;
78
+ /**
79
+ * Max number of ephemeral fanout channels kept open concurrently for publish-only usage.
80
+ *
81
+ * Default: 64. Set to `0` to disable caching (channels will close after publish).
82
+ */
83
+ fanoutPublishMaxEphemeralChannels?: number;
84
+ /**
85
+ * Best-effort bound on cached remote subscribers per topic.
86
+ *
87
+ * This controls memory growth at scale and bounds `getSubscribers()` and the
88
+ * receiver lists used for routing optimizations.
89
+ */
90
+ subscriberCacheMaxEntries?: number;
15
91
  };
16
- export type DirectSubComponents = DirectStreamComponents;
92
+ export type TopicControlPlaneComponents = DirectStreamComponents;
17
93
  export type PeerId = Libp2pPeerId | PublicSignKey;
18
- export declare class DirectSub extends DirectStream<PubSubEvents> implements PubSub {
94
+ /**
95
+ * Runtime control-plane implementation for pubsub topic membership + forwarding.
96
+ */
97
+ export declare class TopicControlPlane extends DirectStream<PubSubEvents> implements PubSub {
19
98
  topics: Map<string, Map<string, SubscriptionData>>;
20
99
  peerToTopic: Map<string, Set<string>>;
21
- topicsToPeers: Map<string, Set<string>>;
22
100
  subscriptions: Map<string, {
23
101
  counter: number;
24
102
  }>;
25
- lastSubscriptionMessages: Map<string, Map<string, DataMessage>>;
103
+ private pendingSubscriptions;
104
+ lastSubscriptionMessages: Map<string, Map<string, bigint>>;
26
105
  dispatchEventOnSelfPublish: boolean;
106
+ readonly topicRootControlPlane: TopicRootControlPlane;
107
+ readonly subscriberCacheMaxEntries: number;
108
+ readonly fanout: FanoutTree;
27
109
  private debounceSubscribeAggregator;
28
110
  private debounceUnsubscribeAggregator;
29
- constructor(components: DirectSubComponents, props?: DirectStreamOptions & {
30
- dispatchEventOnSelfPublish?: boolean;
31
- subscriptionDebounceDelay?: number;
32
- });
111
+ private readonly shardCount;
112
+ private readonly shardTopicPrefix;
113
+ private readonly hostShards;
114
+ private readonly shardRootCache;
115
+ private readonly shardTopicCache;
116
+ private readonly shardRefCounts;
117
+ private readonly pinnedShards;
118
+ private readonly fanoutRootChannelOptions;
119
+ private readonly fanoutNodeChannelOptions;
120
+ private readonly fanoutJoinOptions?;
121
+ private readonly fanoutPublishRequiresSubscribe;
122
+ private readonly fanoutPublishIdleCloseMs;
123
+ private readonly fanoutPublishMaxEphemeralChannels;
124
+ private autoTopicRootCandidates;
125
+ private autoTopicRootCandidateSet?;
126
+ private reconcileShardOverlaysInFlight?;
127
+ private autoCandidatesBroadcastTimers;
128
+ private autoCandidatesGossipInterval?;
129
+ private autoCandidatesGossipUntil;
130
+ private fanoutChannels;
131
+ constructor(components: TopicControlPlaneComponents, props?: TopicControlPlaneOptions);
132
+ /**
133
+ * Configure deterministic topic-root candidates and disable the pubsub "auto"
134
+ * candidate mode.
135
+ *
136
+ * Auto mode is a convenience for small ad-hoc networks where no bootstraps/
137
+ * routers are configured. When an explicit candidate set is provided (e.g.
138
+ * from bootstraps or a test harness), we must stop mutating/gossiping the
139
+ * candidate set; otherwise shard root resolution can diverge and overlays can
140
+ * partition (especially in sparse graphs).
141
+ */
142
+ setTopicRootCandidates(candidates: string[]): void;
143
+ start(): Promise<void>;
33
144
  stop(): Promise<void>;
145
+ onPeerConnected(peerId: Libp2pPeerId, connection: Connection): Promise<void>;
146
+ addPeer(peerId: Libp2pPeerId, publicKey: PublicSignKey, protocol: string, connId: string): PeerStreams;
147
+ private maybeDisableAutoTopicRootCandidatesIfExternallyConfigured;
148
+ private maybeUpdateAutoTopicRootCandidates;
149
+ private normalizeAutoTopicRootCandidates;
150
+ private scheduleAutoTopicRootCandidatesBroadcast;
151
+ private ensureAutoCandidatesGossipInterval;
152
+ private sendAutoTopicRootCandidates;
153
+ private mergeAutoTopicRootCandidatesFromPeer;
154
+ private scheduleReconcileShardOverlays;
155
+ private reconcileShardOverlays;
156
+ private isTrackedTopic;
34
157
  private initializeTopic;
158
+ private untrackTopic;
35
159
  private initializePeer;
160
+ private pruneTopicSubscribers;
161
+ private getSubscriptionOverlap;
162
+ private clearFanoutIdleClose;
163
+ private scheduleFanoutIdleClose;
164
+ private touchFanoutChannel;
165
+ private evictEphemeralFanoutChannels;
166
+ private getShardTopicForUserTopic;
167
+ private resolveShardRoot;
168
+ private ensureFanoutChannel;
169
+ private closeFanoutChannel;
170
+ hostShardRootsNow(): Promise<void>;
36
171
  subscribe(topic: string): Promise<void>;
37
- /**
38
- * Subscribes to a given topic.
39
- */
40
- _subscribe(topics: {
41
- key: string;
42
- counter: number;
43
- }[]): Promise<void>;
44
- unsubscribe(topic: string): Promise<boolean>;
45
- _unsubscribe(topics: {
46
- key: string;
47
- counter: number;
48
- }[], options?: {
49
- force: boolean;
172
+ private _subscribe;
173
+ unsubscribe(topic: string, options?: {
174
+ force?: boolean;
175
+ data?: Uint8Array;
50
176
  }): Promise<boolean>;
177
+ private _announceUnsubscribe;
51
178
  getSubscribers(topic: string): PublicSignKey[] | undefined;
52
- private listenForSubscribers;
53
179
  requestSubscribers(topic: string | string[], to?: PublicSignKey): Promise<void>;
54
- getPeersOnTopics(topics: string[]): Set<string>;
55
- private shouldSendMessage;
56
180
  publish(data: Uint8Array | undefined, options?: {
57
181
  topics: string[];
58
182
  } & {
59
183
  client?: string;
60
184
  } & {
61
- mode?: SilentDelivery | AcknowledgeDelivery | SeekDelivery;
62
- } & PriorityOptions & IdOptions & {
185
+ mode?: SilentDelivery | AcknowledgeDelivery;
186
+ } & PriorityOptions & IdOptions & WithExtraSigners & {
63
187
  signal?: AbortSignal;
64
188
  }): Promise<Uint8Array | undefined>;
65
- private deletePeerFromTopic;
66
- private getSubscriptionOverlap;
67
- onPeerSession(key: PublicSignKey, session: number): void;
68
- onPeerReachable(publicKey: PublicSignKey): Promise<void>;
189
+ onPeerSession(key: PublicSignKey, _session: number): void;
69
190
  onPeerUnreachable(publicKeyHash: string): void;
70
191
  private removeSubscriptions;
71
192
  private subscriptionMessageIsLatest;
72
- private addPeersOnTopic;
193
+ private sendFanoutUnicastOrBroadcast;
194
+ private processDirectPubSubMessage;
195
+ private processShardPubSubMessage;
73
196
  onDataMessage(from: PublicSignKey, stream: PeerStreams, message: DataMessage, seenBefore: number): Promise<boolean>;
74
197
  }
75
198
  export declare const waitForSubscribers: (libp2p: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,aAAa,EAA0B,MAAM,iBAAiB,CAAC;AAExE,OAAO,EAGN,KAAK,MAAM,EAEX,KAAK,YAAY,EAIjB,gBAAgB,EAIhB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,YAAY,EACZ,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAEhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,mBAAmB,EAEnB,WAAW,EAEX,KAAK,SAAS,EAGd,KAAK,eAAe,EACpB,YAAY,EACZ,cAAc,EAEd,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAMhD,eAAO,MAAM,YAAY,GAAI,KAAK,cAAc,GAAG,UAAU,gCACR,CAAC;AAEtD,eAAO,MAAM,MAAM,oCAAwC,CAAC;AAS5D,MAAM,WAAW,eAAe;IAC/B,EAAE,EAAE,YAAY,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC9B,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AAEzD,MAAM,MAAM,MAAM,GAAG,YAAY,GAAG,aAAa,CAAC;AA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