@optimystic/db-p2p 1.0.0-beta.3 → 1.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.
Files changed (234) hide show
  1. package/dist/src/cluster/block-transfer-service.d.ts +73 -1
  2. package/dist/src/cluster/block-transfer-service.d.ts.map +1 -1
  3. package/dist/src/cluster/block-transfer-service.js +70 -3
  4. package/dist/src/cluster/block-transfer-service.js.map +1 -1
  5. package/dist/src/cluster/block-transfer.d.ts +16 -1
  6. package/dist/src/cluster/block-transfer.d.ts.map +1 -1
  7. package/dist/src/cluster/block-transfer.js +73 -72
  8. package/dist/src/cluster/block-transfer.js.map +1 -1
  9. package/dist/src/cluster/client.d.ts +4 -6
  10. package/dist/src/cluster/client.d.ts.map +1 -1
  11. package/dist/src/cluster/client.js +8 -13
  12. package/dist/src/cluster/client.js.map +1 -1
  13. package/dist/src/cluster/cluster-policy.d.ts +2 -1
  14. package/dist/src/cluster/cluster-policy.d.ts.map +1 -1
  15. package/dist/src/cluster/cluster-policy.js.map +1 -1
  16. package/dist/src/cluster/cluster-repo.d.ts +126 -6
  17. package/dist/src/cluster/cluster-repo.d.ts.map +1 -1
  18. package/dist/src/cluster/cluster-repo.js +378 -50
  19. package/dist/src/cluster/cluster-repo.js.map +1 -1
  20. package/dist/src/cluster/commit-proof.js +2 -2
  21. package/dist/src/cluster/race-resolution.d.ts +51 -7
  22. package/dist/src/cluster/race-resolution.d.ts.map +1 -1
  23. package/dist/src/cluster/race-resolution.js +71 -7
  24. package/dist/src/cluster/race-resolution.js.map +1 -1
  25. package/dist/src/cluster/rebalance-monitor.d.ts +67 -5
  26. package/dist/src/cluster/rebalance-monitor.d.ts.map +1 -1
  27. package/dist/src/cluster/rebalance-monitor.js +120 -26
  28. package/dist/src/cluster/rebalance-monitor.js.map +1 -1
  29. package/dist/src/cluster/spread-on-churn.d.ts.map +1 -1
  30. package/dist/src/cluster/spread-on-churn.js +34 -47
  31. package/dist/src/cluster/spread-on-churn.js.map +1 -1
  32. package/dist/src/cohort-topic/host.d.ts.map +1 -1
  33. package/dist/src/cohort-topic/host.js +8 -6
  34. package/dist/src/cohort-topic/host.js.map +1 -1
  35. package/dist/src/cohort-topic/membership-source.js +1 -1
  36. package/dist/src/cohort-topic/membership-source.js.map +1 -1
  37. package/dist/src/cohort-topic/peer-codec.d.ts.map +1 -1
  38. package/dist/src/cohort-topic/peer-codec.js +5 -2
  39. package/dist/src/cohort-topic/peer-codec.js.map +1 -1
  40. package/dist/src/cohort-topic/stream-util.d.ts +24 -3
  41. package/dist/src/cohort-topic/stream-util.d.ts.map +1 -1
  42. package/dist/src/cohort-topic/stream-util.js +36 -3
  43. package/dist/src/cohort-topic/stream-util.js.map +1 -1
  44. package/dist/src/cohort-topic/topic-router.d.ts +9 -0
  45. package/dist/src/cohort-topic/topic-router.d.ts.map +1 -1
  46. package/dist/src/cohort-topic/topic-router.js +12 -2
  47. package/dist/src/cohort-topic/topic-router.js.map +1 -1
  48. package/dist/src/dispute/client.d.ts.map +1 -1
  49. package/dist/src/dispute/client.js +15 -3
  50. package/dist/src/dispute/client.js.map +1 -1
  51. package/dist/src/index.d.ts +5 -0
  52. package/dist/src/index.d.ts.map +1 -1
  53. package/dist/src/index.js +5 -0
  54. package/dist/src/index.js.map +1 -1
  55. package/dist/src/libp2p-key-network.d.ts +78 -17
  56. package/dist/src/libp2p-key-network.d.ts.map +1 -1
  57. package/dist/src/libp2p-key-network.js +234 -147
  58. package/dist/src/libp2p-key-network.js.map +1 -1
  59. package/dist/src/libp2p-node-base.d.ts +35 -1
  60. package/dist/src/libp2p-node-base.d.ts.map +1 -1
  61. package/dist/src/libp2p-node-base.js +151 -26
  62. package/dist/src/libp2p-node-base.js.map +1 -1
  63. package/dist/src/libp2p-node-rn.d.ts +2 -2
  64. package/dist/src/libp2p-node-rn.d.ts.map +1 -1
  65. package/dist/src/libp2p-node-rn.js.map +1 -1
  66. package/dist/src/libp2p-node.d.ts +2 -2
  67. package/dist/src/libp2p-node.d.ts.map +1 -1
  68. package/dist/src/libp2p-node.js.map +1 -1
  69. package/dist/src/logger.d.ts.map +1 -1
  70. package/dist/src/logger.js +6 -1
  71. package/dist/src/logger.js.map +1 -1
  72. package/dist/src/matchmaking/query-transport.d.ts +3 -4
  73. package/dist/src/matchmaking/query-transport.d.ts.map +1 -1
  74. package/dist/src/matchmaking/query-transport.js +9 -9
  75. package/dist/src/matchmaking/query-transport.js.map +1 -1
  76. package/dist/src/network/network-manager-service.d.ts +10 -5
  77. package/dist/src/network/network-manager-service.d.ts.map +1 -1
  78. package/dist/src/network/network-manager-service.js +11 -2
  79. package/dist/src/network/network-manager-service.js.map +1 -1
  80. package/dist/src/network/relay-reservation.d.ts +170 -0
  81. package/dist/src/network/relay-reservation.d.ts.map +1 -0
  82. package/dist/src/network/relay-reservation.js +527 -0
  83. package/dist/src/network/relay-reservation.js.map +1 -0
  84. package/dist/src/pend-validation.d.ts +3 -2
  85. package/dist/src/pend-validation.d.ts.map +1 -1
  86. package/dist/src/pend-validation.js +3 -2
  87. package/dist/src/pend-validation.js.map +1 -1
  88. package/dist/src/protocol-client.d.ts +8 -1
  89. package/dist/src/protocol-client.d.ts.map +1 -1
  90. package/dist/src/protocol-client.js +11 -0
  91. package/dist/src/protocol-client.js.map +1 -1
  92. package/dist/src/reactivity/forwarder-host.d.ts +2 -1
  93. package/dist/src/reactivity/forwarder-host.d.ts.map +1 -1
  94. package/dist/src/reactivity/forwarder-host.js +2 -1
  95. package/dist/src/reactivity/forwarder-host.js.map +1 -1
  96. package/dist/src/reactivity/origination-manager.d.ts +3 -3
  97. package/dist/src/reactivity/origination-manager.js +3 -3
  98. package/dist/src/reactivity/recover-transport.d.ts +22 -14
  99. package/dist/src/reactivity/recover-transport.d.ts.map +1 -1
  100. package/dist/src/reactivity/recover-transport.js +32 -19
  101. package/dist/src/reactivity/recover-transport.js.map +1 -1
  102. package/dist/src/reactivity/subscription-manager.d.ts +2 -2
  103. package/dist/src/reactivity/topic-bytes.d.ts +6 -7
  104. package/dist/src/reactivity/topic-bytes.d.ts.map +1 -1
  105. package/dist/src/reactivity/topic-bytes.js +8 -9
  106. package/dist/src/reactivity/topic-bytes.js.map +1 -1
  107. package/dist/src/repo/client.d.ts +5 -2
  108. package/dist/src/repo/client.d.ts.map +1 -1
  109. package/dist/src/repo/client.js +49 -40
  110. package/dist/src/repo/client.js.map +1 -1
  111. package/dist/src/repo/cluster-coordinator.d.ts +77 -5
  112. package/dist/src/repo/cluster-coordinator.d.ts.map +1 -1
  113. package/dist/src/repo/cluster-coordinator.js +131 -20
  114. package/dist/src/repo/cluster-coordinator.js.map +1 -1
  115. package/dist/src/repo/coordinator-repo.d.ts +238 -122
  116. package/dist/src/repo/coordinator-repo.d.ts.map +1 -1
  117. package/dist/src/repo/coordinator-repo.js +625 -472
  118. package/dist/src/repo/coordinator-repo.js.map +1 -1
  119. package/dist/src/repo/i-under-replication-ledger.d.ts +87 -0
  120. package/dist/src/repo/i-under-replication-ledger.d.ts.map +1 -0
  121. package/dist/src/repo/i-under-replication-ledger.js +2 -0
  122. package/dist/src/repo/i-under-replication-ledger.js.map +1 -0
  123. package/dist/src/repo/kv-under-replication-ledger.d.ts +91 -0
  124. package/dist/src/repo/kv-under-replication-ledger.d.ts.map +1 -0
  125. package/dist/src/repo/kv-under-replication-ledger.js +287 -0
  126. package/dist/src/repo/kv-under-replication-ledger.js.map +1 -0
  127. package/dist/src/repo/responsibility.d.ts +37 -0
  128. package/dist/src/repo/responsibility.d.ts.map +1 -0
  129. package/dist/src/repo/responsibility.js +37 -0
  130. package/dist/src/repo/responsibility.js.map +1 -0
  131. package/dist/src/repo/service.d.ts +44 -15
  132. package/dist/src/repo/service.d.ts.map +1 -1
  133. package/dist/src/repo/service.js +64 -27
  134. package/dist/src/repo/service.js.map +1 -1
  135. package/dist/src/repo/stuck-reservation.d.ts +127 -0
  136. package/dist/src/repo/stuck-reservation.d.ts.map +1 -0
  137. package/dist/src/repo/stuck-reservation.js +179 -0
  138. package/dist/src/repo/stuck-reservation.js.map +1 -0
  139. package/dist/src/repo/under-replication-drain.d.ts +208 -0
  140. package/dist/src/repo/under-replication-drain.d.ts.map +1 -0
  141. package/dist/src/repo/under-replication-drain.js +461 -0
  142. package/dist/src/repo/under-replication-drain.js.map +1 -0
  143. package/dist/src/rn.d.ts +5 -0
  144. package/dist/src/rn.d.ts.map +1 -1
  145. package/dist/src/rn.js +5 -0
  146. package/dist/src/rn.js.map +1 -1
  147. package/dist/src/storage/block-latch.d.ts +3 -2
  148. package/dist/src/storage/block-latch.d.ts.map +1 -1
  149. package/dist/src/storage/block-latch.js +7 -4
  150. package/dist/src/storage/block-latch.js.map +1 -1
  151. package/dist/src/storage/block-storage.d.ts +45 -3
  152. package/dist/src/storage/block-storage.d.ts.map +1 -1
  153. package/dist/src/storage/block-storage.js +156 -9
  154. package/dist/src/storage/block-storage.js.map +1 -1
  155. package/dist/src/storage/i-block-storage.d.ts +57 -5
  156. package/dist/src/storage/i-block-storage.d.ts.map +1 -1
  157. package/dist/src/storage/i-block-storage.js.map +1 -1
  158. package/dist/src/storage/pending-claim.d.ts +167 -0
  159. package/dist/src/storage/pending-claim.d.ts.map +1 -0
  160. package/dist/src/storage/pending-claim.js +156 -0
  161. package/dist/src/storage/pending-claim.js.map +1 -0
  162. package/dist/src/storage/raw-store-codec.d.ts +13 -0
  163. package/dist/src/storage/raw-store-codec.d.ts.map +1 -1
  164. package/dist/src/storage/raw-store-codec.js +24 -3
  165. package/dist/src/storage/raw-store-codec.js.map +1 -1
  166. package/dist/src/storage/restoration-coordinator.d.ts.map +1 -1
  167. package/dist/src/storage/restoration-coordinator.js +2 -1
  168. package/dist/src/storage/restoration-coordinator.js.map +1 -1
  169. package/dist/src/storage/ring-shift-coordinator.d.ts.map +1 -1
  170. package/dist/src/storage/ring-shift-coordinator.js +3 -3
  171. package/dist/src/storage/ring-shift-coordinator.js.map +1 -1
  172. package/dist/src/storage/storage-repo.d.ts +122 -5
  173. package/dist/src/storage/storage-repo.d.ts.map +1 -1
  174. package/dist/src/storage/storage-repo.js +245 -68
  175. package/dist/src/storage/storage-repo.js.map +1 -1
  176. package/dist/src/storage/struct.d.ts +58 -0
  177. package/dist/src/storage/struct.d.ts.map +1 -1
  178. package/dist/src/testing/mesh-harness.d.ts +77 -11
  179. package/dist/src/testing/mesh-harness.d.ts.map +1 -1
  180. package/dist/src/testing/mesh-harness.js +226 -100
  181. package/dist/src/testing/mesh-harness.js.map +1 -1
  182. package/package.json +2 -2
  183. package/readme.md +27 -3
  184. package/src/cluster/block-transfer-service.ts +132 -4
  185. package/src/cluster/block-transfer.ts +79 -84
  186. package/src/cluster/client.ts +115 -119
  187. package/src/cluster/cluster-policy.ts +2 -1
  188. package/src/cluster/cluster-repo.ts +422 -56
  189. package/src/cluster/commit-proof.ts +2 -2
  190. package/src/cluster/race-resolution.ts +76 -7
  191. package/src/cluster/rebalance-monitor.ts +677 -539
  192. package/src/cluster/spread-on-churn.ts +34 -54
  193. package/src/cohort-topic/host.ts +8 -6
  194. package/src/cohort-topic/membership-source.ts +1 -1
  195. package/src/cohort-topic/peer-codec.ts +34 -31
  196. package/src/cohort-topic/stream-util.ts +39 -4
  197. package/src/cohort-topic/topic-router.ts +12 -2
  198. package/src/dispute/client.ts +17 -7
  199. package/src/index.ts +64 -59
  200. package/src/libp2p-key-network.ts +1377 -1260
  201. package/src/libp2p-node-base.ts +186 -27
  202. package/src/libp2p-node-rn.ts +31 -30
  203. package/src/libp2p-node.ts +37 -36
  204. package/src/logger.ts +6 -1
  205. package/src/matchmaking/query-transport.ts +9 -9
  206. package/src/network/network-manager-service.ts +16 -5
  207. package/src/network/relay-reservation.ts +636 -0
  208. package/src/pend-validation.ts +3 -2
  209. package/src/protocol-client.ts +13 -1
  210. package/src/reactivity/forwarder-host.ts +2 -1
  211. package/src/reactivity/origination-manager.ts +3 -3
  212. package/src/reactivity/recover-transport.ts +39 -22
  213. package/src/reactivity/subscription-manager.ts +2 -2
  214. package/src/reactivity/topic-bytes.ts +35 -37
  215. package/src/repo/client.ts +172 -173
  216. package/src/repo/cluster-coordinator.ts +145 -19
  217. package/src/repo/coordinator-repo.ts +652 -505
  218. package/src/repo/i-under-replication-ledger.ts +89 -0
  219. package/src/repo/kv-under-replication-ledger.ts +302 -0
  220. package/src/repo/responsibility.ts +48 -0
  221. package/src/repo/service.ts +76 -39
  222. package/src/repo/stuck-reservation.ts +224 -0
  223. package/src/repo/under-replication-drain.ts +582 -0
  224. package/src/rn.ts +74 -69
  225. package/src/storage/block-latch.ts +7 -4
  226. package/src/storage/block-storage.ts +161 -10
  227. package/src/storage/i-block-storage.ts +60 -5
  228. package/src/storage/pending-claim.ts +200 -0
  229. package/src/storage/raw-store-codec.ts +26 -3
  230. package/src/storage/restoration-coordinator.ts +212 -211
  231. package/src/storage/ring-shift-coordinator.ts +271 -271
  232. package/src/storage/storage-repo.ts +280 -72
  233. package/src/storage/struct.ts +58 -0
  234. package/src/testing/mesh-harness.ts +293 -112
@@ -1,4 +1,5 @@
1
- import { NetworkTransactor } from '@optimystic/db-core';
1
+ import { NetworkTransactor, routingKeyForBlock } from '@optimystic/db-core';
2
+ import { DigitreeStore, assembleCohort, hashKey, hashPeerId } from 'p2p-fret';
2
3
  import { peerIdFromPrivateKey } from '@libp2p/peer-id';
3
4
  import { generateKeyPair, generateKeyPairFromSeed } from '@libp2p/crypto/keys';
4
5
  import { ClusterMember, clusterMember } from '../cluster/cluster-repo.js';
@@ -9,7 +10,6 @@ import { MemoryRawStorage } from '../storage/memory-storage.js';
9
10
  import { BlockStorage } from '../storage/block-storage.js';
10
11
  import { serveBlockArchive, servableProof } from '../storage/block-archive.js';
11
12
  import { coordinatorRepo } from '../repo/coordinator-repo.js';
12
- import { sortPeersByDistance } from '../routing/responsibility.js';
13
13
  import { toString as u8ToString } from 'uint8arrays';
14
14
  class MockPeerNetwork {
15
15
  async connect(_peerId, _protocol) {
@@ -17,14 +17,26 @@ class MockPeerNetwork {
17
17
  }
18
18
  }
19
19
  /**
20
- * Mock IKeyNetwork that returns peers based on XOR distance.
21
- * With responsibilityK >= nodeCount, all nodes are returned.
22
- * Otherwise, K-nearest by XOR distance are returned.
20
+ * Mock IKeyNetwork that places a block where production does, by construction: it ranks the mesh's nodes
21
+ * with FRET's own `assembleCohort` over a ring (`DigitreeStore`) holding every node at its real ring
22
+ * coordinate (`hashPeerId`), the walk `Libp2pKeyPeerNetwork` asks FRET for. Like production it hashes the
23
+ * routing key exactly once. Every mesh node serves, so the network-membership scoping production layers on
24
+ * top never removes anyone, and a cohort is simply the nearest `responsibilityK` in walk order.
25
+ * `test/mesh-harness-cohort-parity.spec.ts` pins the two answers equal.
26
+ *
27
+ * - `findCluster`: the nearest `responsibilityK` nodes, nearest first. Nothing is added: a node is in a
28
+ * block's cohort only when it is among the nearest, as in production.
29
+ * - `findCoordinator`: the first non-excluded node of the whole ring's walk, which is the cohort's first
30
+ * member unless excluded, else the next nearest node, cohort member or not. That mirrors production's
31
+ * connected-peer fallback: a pick outside the cohort is a routing hop, not a placement.
23
32
  */
24
33
  class MockMeshKeyNetwork {
25
34
  nodes;
26
35
  responsibilityK;
27
36
  failures;
37
+ /** The ring, built on first lookup (node ids hash asynchronously, and `nodes` fills after construction)
38
+ * and rebuilt only if the node count changes; a restarted node keeps its identity and so its position. */
39
+ ring;
28
40
  constructor(nodes, responsibilityK, failures = {}) {
29
41
  this.nodes = nodes;
30
42
  this.responsibilityK = responsibilityK;
@@ -32,8 +44,7 @@ class MockMeshKeyNetwork {
32
44
  }
33
45
  async findCoordinator(key, options) {
34
46
  const excluded = new Set((options?.excludedPeers ?? []).map(p => p.toString()));
35
- const sorted = this.sortedByDistance(key);
36
- const pick = sorted.find(n => !excluded.has(n.peerId.toString()));
47
+ const pick = (await this.nearest(key, this.nodes.length)).find(n => !excluded.has(n.peerId.toString()));
37
48
  if (!pick) {
38
49
  throw new Error('No coordinator available for key (all candidates excluded)');
39
50
  }
@@ -43,11 +54,8 @@ class MockMeshKeyNetwork {
43
54
  if (this.failures.findClusterFails) {
44
55
  return {};
45
56
  }
46
- const sorted = this.sortedByDistance(key);
47
- const k = Math.min(this.responsibilityK, sorted.length);
48
- const selected = sorted.slice(0, k);
49
57
  const peers = {};
50
- for (const node of selected) {
58
+ for (const node of await this.nearest(key, this.responsibilityK)) {
51
59
  peers[node.peerId.toString()] = {
52
60
  multiaddrs: ['/ip4/127.0.0.1/tcp/8000'],
53
61
  publicKey: u8ToString(node.peerId.publicKey.raw, 'base64url')
@@ -55,13 +63,29 @@ class MockMeshKeyNetwork {
55
63
  }
56
64
  return peers;
57
65
  }
58
- sortedByDistance(key) {
59
- const knownPeers = this.nodes.map(n => ({
60
- id: n.peerId,
61
- addrs: ['/ip4/127.0.0.1/tcp/8000']
62
- }));
63
- const sorted = sortPeersByDistance(knownPeers, key);
64
- return sorted.map(kp => this.nodes.find(n => n.peerId.equals(kp.id)));
66
+ /** The `wants` nodes nearest `key`'s ring coordinate, nearest first. */
67
+ async nearest(key, wants) {
68
+ const { store, byId } = await this.ringStore();
69
+ const ids = assembleCohort(store, await hashKey(key), Math.min(wants, byId.size));
70
+ return ids.map(id => byId.get(id));
71
+ }
72
+ ringStore() {
73
+ if (this.ring?.size !== this.nodes.length) {
74
+ const members = [...this.nodes];
75
+ this.ring = {
76
+ size: members.length,
77
+ ready: (async () => {
78
+ const store = new DigitreeStore();
79
+ const byId = new Map();
80
+ for (const node of members) {
81
+ store.upsert(node.peerId.toString(), await hashPeerId(node.peerId));
82
+ byId.set(node.peerId.toString(), node);
83
+ }
84
+ return { store, byId };
85
+ })()
86
+ };
87
+ }
88
+ return this.ring.ready;
65
89
  }
66
90
  }
67
91
  /**
@@ -157,22 +181,26 @@ export async function createMesh(nodeCount, options) {
157
181
  : await generateKeyPairFromSeed('Ed25519', meshKeySeed(options.keySeed, i));
158
182
  return { peerId: peerIdFromPrivateKey(privateKey), privateKey };
159
183
  }));
160
- // Build nodes array (partially — coordinatorRepo added after keyNetwork is ready)
161
184
  const nodes = [];
162
185
  const peerNetwork = new MockPeerNetwork();
163
186
  // One real reconcile callback per node, shared between the member's commit-path `reconcileBlock`
164
187
  // and the coordinator's read-path `acquireBlockFromCohort` — production shares one instance
165
- // (`libp2p-node-base.ts`), and a spec must not be able to tell the two paths apart. Built in
166
- // phase 1 (with the member), consumed again in phase 2 (by the coordinator), so it is stashed
167
- // here keyed by peer id rather than widened onto the public `MeshNode` type.
188
+ // (`libp2p-node-base.ts`), and a spec must not be able to tell the two paths apart. Built with the
189
+ // member, consumed again by the coordinator, so it is stashed here keyed by peer id rather than
190
+ // widened onto the public `MeshNode` type.
168
191
  const reconcileByPeer = new Map();
192
+ /** What outlives a node instance, by peer id: the raw storage it was built over, and its index
193
+ * (`validatorFactory` is invoked with it again on restart). */
194
+ const durableByPeer = new Map();
195
+ /** The CURRENT instance's lifetime, by peer id — flipped to stopped by {@link Mesh.restart}. */
196
+ const lifetimeByPeer = new Map();
169
197
  // The mesh key network is built BEFORE the members: each member's `deriveExpectedCluster` (the
170
- // admission gate's view) needs a per-node key network in phase 1, and constructing it here beats
171
- // a late-bound slot a closure could fire on before it is filled. Safe because `nodes` is captured
172
- // by reference and only consulted at call time, after the array is fully populated.
198
+ // admission gate's view) needs a per-node key network, and constructing it here beats a late-bound
199
+ // slot a closure could fire on before it is filled. Safe because `nodes` is captured by reference
200
+ // and only consulted at call time, after the array is fully populated.
173
201
  //
174
202
  // `wrapKeyNetwork` is applied HERE, before `makeNodeKeyNetwork` closes over `keyNetwork` below and
175
- // before phase 1 builds any `deriveExpectedCluster` closure — every one of them reads the `keyNetwork`
203
+ // before any `deriveExpectedCluster` closure is built — every one of them reads the `keyNetwork`
176
204
  // binding, so a wrapper assigned to it here is what every node's coordinator, cluster member and the
177
205
  // returned `Mesh.keyNetwork` all observe. Reassigning `mesh.keyNetwork` after this function returns
178
206
  // only reaches whoever reads that property later (the transactor); it is too late for the rest.
@@ -180,13 +208,18 @@ export async function createMesh(nodeCount, options) {
180
208
  const keyNetwork = options.wrapKeyNetwork ? options.wrapKeyNetwork(sharedKeyNetwork) : sharedKeyNetwork;
181
209
  /**
182
210
  * One node's own view of the key network — what `Libp2pKeyPeerNetwork` gives a real node:
183
- * - `findCluster` always includes self, so a responsible member's derived view is never empty
184
- * (see the empty-view guard in `cluster-repo.admitMembership`);
211
+ * - `findCluster` is the shared cohort, which holds this node only when it is among the block's
212
+ * nearest `responsibilityK`, so the node's coordinator judges its own responsibility as a real
213
+ * node's does;
185
214
  * - under a simulated partition (`failures.partitionSides`), a caller inside a side sees only
186
215
  * its side's members of the cohort — the caller-aware filtering lives here, in the per-node
187
- * wrapper, precisely so `IKeyNetwork` itself needs no "who is asking" parameter.
188
- * The SAME instance serves both the member's admission derivation (phase 1) and the node's
189
- * coordinator (phase 2), so the two sides of a node can never see different topologies.
216
+ * wrapper, precisely so `IKeyNetwork` itself needs no "who is asking" parameter. A side holding
217
+ * none of the cohort sees an empty view, so a node there is not responsible for the block (and
218
+ * the empty-view guard in `cluster-repo.admitMembership` treats such a view as unconfident rather
219
+ * than as a reference set).
220
+ * The SAME instance serves both the member's admission derivation and the node's coordinator, so
221
+ * the two sides of a node can never see different topologies. It holds no state, so a restarted
222
+ * node keeps it.
190
223
  */
191
224
  const makeNodeKeyNetwork = (selfPeerId) => {
192
225
  const selfStr = selfPeerId.toString();
@@ -201,24 +234,17 @@ export async function createMesh(nodeCount, options) {
201
234
  delete peers[id];
202
235
  }
203
236
  }
204
- if (!(selfStr in peers)) {
205
- peers[selfStr] = {
206
- multiaddrs: ['/ip4/127.0.0.1/tcp/8000'],
207
- publicKey: u8ToString(selfPeerId.publicKey.raw, 'base64url')
208
- };
209
- }
210
237
  return peers;
211
238
  }
212
239
  };
213
240
  };
214
- const nodeKeyNetworkByPeer = new Map();
215
- // Phase 1: create storage + cluster members
216
- let nodeIndex = 0;
217
- for (const { peerId, privateKey } of keyPairs) {
218
- const index = nodeIndex++;
219
- const rawStorage = options.rawStorageFactory
220
- ? options.rawStorageFactory(index)
221
- : new MemoryRawStorage();
241
+ /**
242
+ * Build `meshNode`'s storage repo and cluster member over its durable raw storage, assigning both
243
+ * onto the node. Run once per node at assembly, and again by {@link Mesh.restart}.
244
+ */
245
+ const buildMember = (meshNode, lifetime) => {
246
+ const { peerId, privateKey } = meshNode;
247
+ const { rawStorage, index } = durableByPeer.get(peerId.toString());
222
248
  const storageRepo = new StorageRepo((blockId) => new BlockStorage(blockId, rawStorage));
223
249
  // Active reconciliation: when a member commits a block it never pended (cohort drift), or a
224
250
  // reader holds a corroborated revision it cannot promote locally, pull the committed revision
@@ -226,9 +252,12 @@ export async function createMesh(nodeCount, options) {
226
252
  // distinct peers must agree on the target `(rev, actionId)` AND on the block content, or the
227
253
  // pass declines, persisting nothing. `reputation` is omitted — no reputation subsystem in the
228
254
  // harness.
255
+ const fetchArchive = makeFetchArchive(nodes, peerId.toString(), failures);
229
256
  const reconcileBlock = createReconcileBlock({
230
257
  selfPeerId: peerId.toString(),
231
- fetchArchive: makeFetchArchive(nodes, peerId.toString(), failures),
258
+ // A stopped instance fetches nothing — the production fetch swallows a failed dial into
259
+ // the same `undefined`.
260
+ fetchArchive: async (peerIdStr, blockId) => lifetime.stopped ? undefined : await fetchArchive(peerIdStr, blockId),
232
261
  // Production shape: a proof reconcile verified against the agreed bytes is persisted so
233
262
  // the repaired replica serves it onward.
234
263
  saveReplicatedBlock: (blockId, block, source, verifiedProof) => storageRepo.saveReplicatedBlock(blockId, block, source, verifiedProof),
@@ -237,30 +266,19 @@ export async function createMesh(nodeCount, options) {
237
266
  repairCorroborationClusterSize: policy.repairCorroborationClusterSize
238
267
  });
239
268
  reconcileByPeer.set(peerId.toString(), reconcileBlock);
240
- const nodeKeyNetwork = makeNodeKeyNetwork(peerId);
241
- nodeKeyNetworkByPeer.set(peerId.toString(), nodeKeyNetwork);
242
- // The node object exists before its member so the admission derivation below can hand the
243
- // finished MeshNode to spec-supplied callbacks; `clusterMember`/`coordinatorRepo` are
244
- // assigned as they are built (member just below, coordinator in phase 2) and the closures
245
- // only run at vote time, long after both are in place.
246
- const meshNode = {
247
- peerId,
248
- privateKey,
249
- storageRepo,
250
- clusterMember: undefined,
251
- coordinatorRepo: undefined
252
- };
269
+ const nodeKeyNetwork = meshNode.keyNetwork;
253
270
  // Member-side cluster derivation for the membership admission gate — the production shape
254
271
  // (`libp2p-node-base.deriveExpectedCluster`): the SAME per-node key network the coordinator
255
- // selects its cohort from, plus a network-size confidence. The self-including wrapper keeps a
256
- // responsible member's view non-empty; `meshConfidence` is the FRET stand-in (default 1, i.e.
272
+ // selects its cohort from, plus a network-size confidence. A responsible member is in its own
273
+ // cohort, so its view is never empty; `meshConfidence` is the FRET stand-in (default 1, i.e.
257
274
  // confident — a partition spec collapses it per side).
258
275
  const deriveExpectedCluster = options.deriveExpectedCluster
259
276
  ? (blockId) => options.deriveExpectedCluster(meshNode, blockId)
260
277
  : async (blockId) => ({
261
- peers: await nodeKeyNetwork.findCluster(new TextEncoder().encode(blockId)) ?? {},
278
+ peers: await nodeKeyNetwork.findCluster(routingKeyForBlock(blockId)) ?? {},
262
279
  confidence: options.meshConfidence?.(meshNode) ?? 1
263
280
  });
281
+ meshNode.storageRepo = storageRepo;
264
282
  meshNode.clusterMember = clusterMember({
265
283
  storageRepo,
266
284
  peerNetwork,
@@ -271,11 +289,12 @@ export async function createMesh(nodeCount, options) {
271
289
  deriveExpectedCluster,
272
290
  // Absent by default: `undefined` here is identical to omitting the field, and
273
291
  // `validatePendOperations` then skips the validation step entirely.
274
- validator: options.validatorFactory?.(index, peerId)
292
+ validator: options.validatorFactory?.(index, peerId),
293
+ onCommittedHolders: options.onCommittedHolders && ((committed) => options.onCommittedHolders(meshNode, committed))
275
294
  });
276
- nodes.push(meshNode);
277
- }
278
- // Phase 2: coordinator repos (needs all nodes for routing; key network built in phase 1)
295
+ };
296
+ // Cluster traffic to a node, resolved per call: a delivery always reaches the target's CURRENT
297
+ // member, so a restarted node answers with its new instance.
279
298
  const createClusterClient = (targetPeerId) => {
280
299
  const target = nodes.find(n => n.peerId.equals(targetPeerId));
281
300
  if (!target) {
@@ -283,6 +302,7 @@ export async function createMesh(nodeCount, options) {
283
302
  }
284
303
  return {
285
304
  async update(record) {
305
+ failures.onClusterDelivery?.(targetPeerId.toString(), record);
286
306
  if (failures.failingPeers?.has(targetPeerId.toString())) {
287
307
  throw new Error(`Peer ${targetPeerId.toString()} is unreachable`);
288
308
  }
@@ -290,7 +310,13 @@ export async function createMesh(nodeCount, options) {
290
310
  }
291
311
  };
292
312
  };
293
- for (const node of nodes) {
313
+ /**
314
+ * Build `node`'s coordinator over its (already built) storage repo and member. It reaches the other
315
+ * nodes only at call time, never at construction. Run once per node at assembly, and again by
316
+ * {@link Mesh.restart}.
317
+ */
318
+ const buildCoordinator = (node, lifetime) => {
319
+ const stoppedError = () => new Error(`${node.peerId.toString()} was restarted; this instance is stopped`);
294
320
  // Per-node callback: reports the queried peer's latest revision, and NOTHING else. It used to
295
321
  // also write the peer's block into local storage ("simulate data sync"), which made every
296
322
  // read-repair assertion on this harness observe a convergence the production callback does not
@@ -298,6 +324,8 @@ export async function createMesh(nodeCount, options) {
298
324
  // existed to expose. Transfer now happens where it does in production: through
299
325
  // `acquireBlockFromCohort` below, gated on a corroborated revision.
300
326
  const clusterLatestCallback = async (peerId, blockId, context) => {
327
+ if (lifetime.stopped)
328
+ throw stoppedError();
301
329
  // Silence: the peer never answers. REJECTS, mirroring what a dial failure does to the
302
330
  // production callback — the coordinator must count this as "did not answer", never as
303
331
  // an absent claim (a resolved `undefined` remains the peer answering "I hold nothing").
@@ -320,17 +348,29 @@ export async function createMesh(nodeCount, options) {
320
348
  const proof = await servableProof(target.storageRepo, blockId, latest);
321
349
  return proof ? { ...latest, proof } : latest;
322
350
  };
323
- // The node's own self-including (and partition-aware) key-network view, built in phase 1
324
- // the SAME instance the member's admission derivation reads, matching real
325
- // Libp2pKeyPeerNetwork behavior.
326
- const nodeKeyNetwork = nodeKeyNetworkByPeer.get(node.peerId.toString());
327
- const factory = coordinatorRepo(nodeKeyNetwork, createClusterClient,
328
- // The SAME resolved policy the member above was built from, spread the way
329
- // `libp2p-node-base` spreads it into its coordinator factory — carrying
330
- // `repairCorroborationClusterSize` (the repair floor's yardstick, DEFAULT_CLUSTER_SIZE
331
- // when the mesh declared nothing), the production `minAbsoluteClusterSize` (2, not the
332
- // coordinator's own fallback of 3), and the `allowUnvalidatedSmallCluster` gate —
333
- // ARMED (false) unless the mesh opted out at its call site.
351
+ // The node's own (partition-aware) key-network view the SAME instance the member's admission
352
+ // derivation reads, matching real Libp2pKeyPeerNetwork behavior.
353
+ const nodeKeyNetwork = node.keyNetwork;
354
+ const factory = coordinatorRepo(nodeKeyNetwork,
355
+ // A stopped instance's cluster traffic fails at send — checked per delivery rather than when
356
+ // the client is made, because `ClusterCoordinator` also sends from a commit-retry timer that
357
+ // can fire long after a restart.
358
+ (targetPeerId) => {
359
+ const client = createClusterClient(targetPeerId);
360
+ return {
361
+ async update(record) {
362
+ if (lifetime.stopped)
363
+ throw stoppedError();
364
+ return await client.update(record);
365
+ }
366
+ };
367
+ },
368
+ // The SAME resolved policy the member was built from, spread the way `libp2p-node-base`
369
+ // spreads it into its coordinator factory — carrying `repairCorroborationClusterSize` (the
370
+ // repair floor's yardstick, DEFAULT_CLUSTER_SIZE when the mesh declared nothing), the
371
+ // production `minAbsoluteClusterSize` (2, not the coordinator's own fallback of 3), and the
372
+ // `allowUnvalidatedSmallCluster` gate — ARMED (false) unless the mesh opted out at its call
373
+ // site.
334
374
  { ...policy });
335
375
  node.coordinatorRepo = factory({
336
376
  storageRepo: node.storageRepo,
@@ -339,31 +379,126 @@ export async function createMesh(nodeCount, options) {
339
379
  clusterLatestCallback,
340
380
  // The read path's transfer mechanism — the SAME instance the member uses on the commit
341
381
  // path, mirroring how `libp2p-node-base` shares one `reconcileBlock` between both.
342
- acquireBlockFromCohort: reconcileByPeer.get(node.peerId.toString())
382
+ acquireBlockFromCohort: reconcileByPeer.get(node.peerId.toString()),
383
+ onCommittedHolders: options.onCommittedHolders && ((committed) => options.onCommittedHolders(node, committed))
384
+ });
385
+ };
386
+ // Phase 1: storage + cluster members, in key-pair order (the order `validatorFactory` indexes by).
387
+ for (const [index, { peerId, privateKey }] of keyPairs.entries()) {
388
+ const peerIdStr = peerId.toString();
389
+ durableByPeer.set(peerIdStr, {
390
+ rawStorage: options.rawStorageFactory ? options.rawStorageFactory(index) : new MemoryRawStorage(),
391
+ index
343
392
  });
393
+ const lifetime = { stopped: false };
394
+ lifetimeByPeer.set(peerIdStr, lifetime);
395
+ // The node object exists before its member so the admission derivation can hand the finished
396
+ // MeshNode to spec-supplied callbacks; `storageRepo`/`clusterMember` are assigned by
397
+ // `buildMember` just below and `coordinatorRepo` in phase 2, and those closures only run at
398
+ // vote time, long after all three are in place.
399
+ const meshNode = {
400
+ peerId,
401
+ privateKey,
402
+ keyNetwork: makeNodeKeyNetwork(peerId),
403
+ storageRepo: undefined,
404
+ clusterMember: undefined,
405
+ coordinatorRepo: undefined
406
+ };
407
+ buildMember(meshNode, lifetime);
408
+ nodes.push(meshNode);
344
409
  }
345
- return { nodes, failures, keyNetwork };
410
+ // Phase 2: coordinator repos, once every member exists.
411
+ for (const node of nodes) {
412
+ buildCoordinator(node, lifetimeByPeer.get(node.peerId.toString()));
413
+ }
414
+ const restart = (node) => {
415
+ const peerIdStr = node.peerId.toString();
416
+ if (!nodes.includes(node)) {
417
+ throw new Error(`restart: ${peerIdStr} is not a node of this mesh`);
418
+ }
419
+ // NOTE: this severs the old instance's traffic to OTHER nodes, not its in-process path to its own
420
+ // member and storage repo, which still write the shared raw storage if called. After a restart
421
+ // between transactions only one thing could reach it: a scheduled commit retry aimed at the
422
+ // coordinator's OWN member, which exists only when that member threw while applying the broadcast —
423
+ // a local fault no spec injects today. If a spec ever does, or restarts a node MID-transaction,
424
+ // sever the old coordinator's local member too.
425
+ lifetimeByPeer.get(peerIdStr).stopped = true;
426
+ node.clusterMember.dispose();
427
+ const lifetime = { stopped: false };
428
+ lifetimeByPeer.set(peerIdStr, lifetime);
429
+ buildMember(node, lifetime);
430
+ buildCoordinator(node, lifetime);
431
+ };
432
+ return { nodes, failures, keyNetwork, restart };
346
433
  }
347
434
  /**
348
435
  * The nodes the key network keeps OUT of `blockId`'s cohort — peers that receive none of the
349
436
  * block's cluster traffic, and so hold none of its content until something repairs them.
350
437
  *
351
- * Peer ids are generated fresh per mesh, so which node is responsible for a given block is random
352
- * from run to run: in a 3-node `responsibilityK: 1` mesh, `nodes[1]` is the block's sole responsible
353
- * peer about a third of the time, and then it receives the writer's commit directly. A test that
354
- * needs a genuinely non-responsible node has to ask the routing layer rather than assume an index.
438
+ * Unless the mesh is seeded (`keySeed`), peer ids are generated fresh per mesh, so which node is
439
+ * responsible for a given block is random from run to run: in a 3-node `responsibilityK: 1` mesh,
440
+ * `nodes[1]` is the block's sole responsible peer about a third of the time, and then it receives the
441
+ * writer's commit directly. A test that needs a genuinely non-responsible node has to ask the routing
442
+ * layer rather than assume an index.
355
443
  */
356
444
  export async function nonResponsibleNodes(mesh, blockId) {
357
- const cohort = await mesh.keyNetwork.findCluster(new TextEncoder().encode(blockId));
445
+ const cohort = await mesh.keyNetwork.findCluster(routingKeyForBlock(blockId));
358
446
  return mesh.nodes.filter(node => !(node.peerId.toString() in cohort));
359
447
  }
448
+ /**
449
+ * The nodes the key network places in `blockId`'s cohort, nearest first — the complement of
450
+ * {@link nonResponsibleNodes}. A node outside this list refuses a write for the block through its own
451
+ * coordinator (`CoordinatorRepo` checks responsibility), so a spec that writes through one node's
452
+ * coordinator directly picks that node from here rather than by index.
453
+ */
454
+ export async function responsibleNodes(mesh, blockId) {
455
+ const cohort = Object.keys(await mesh.keyNetwork.findCluster(routingKeyForBlock(blockId)));
456
+ return cohort.map(id => mesh.nodes.find(node => node.peerId.toString() === id));
457
+ }
458
+ /**
459
+ * The first `count` ids of the form `${prefix}-${i}` whose cohort includes `node` — for a spec that needs
460
+ * several blocks one node is responsible for (a multi-block pend through that node's coordinator, or
461
+ * sequential writes it coordinates alone). In a `responsibilityK: 1` mesh these are blocks the node is
462
+ * the SOLE responsible peer for. Throws after `maxCandidates` ids rather than looping on a node whose ring
463
+ * arc no id lands in.
464
+ */
465
+ export async function blockIdsInCohortOf(mesh, node, count, prefix, maxCandidates = 10_000) {
466
+ const nodeId = node.peerId.toString();
467
+ const ids = [];
468
+ for (let i = 0; ids.length < count && i < maxCandidates; i++) {
469
+ const id = `${prefix}-${i}`;
470
+ if (nodeId in await mesh.keyNetwork.findCluster(routingKeyForBlock(id)))
471
+ ids.push(id);
472
+ }
473
+ if (ids.length < count) {
474
+ throw new Error(`blockIdsInCohortOf: only ${ids.length} of ${count} ids with prefix ${prefix} place ${nodeId} in their cohort`);
475
+ }
476
+ return ids;
477
+ }
360
478
  /**
361
479
  * Builds a NetworkTransactor over a mesh. All nodes share the same mock
362
480
  * infrastructure so a single transactor routes to every peer via `getRepo`.
481
+ * It runs on no node (no `localPeerId`), so a coverage tie between cohort
482
+ * members goes to the nearest — a client-only writer's shape.
363
483
  * Suitable for solo-mesh tests; for multi-node tests prefer
364
484
  * `buildNetworkTransactors` to label "which node is driving".
365
485
  */
366
- export const buildNetworkTransactor = (mesh, options = {}) => {
486
+ export const buildNetworkTransactor = (mesh, options = {}) => meshTransactor(mesh, options, undefined);
487
+ /**
488
+ * Builds one NetworkTransactor per mesh node, keyed by peer-id string. Each
489
+ * transactor shares the mesh's key network and peer→repo map, and runs on its
490
+ * node the way a production node's transactor does (`localPeerId`): when that
491
+ * node is in a block's cohort and ties another member on coverage, it
492
+ * coordinates the write itself. Reads and retries still route by proximity.
493
+ */
494
+ export const buildNetworkTransactors = (mesh, options = {}) => {
495
+ const transactors = new Map();
496
+ for (const node of mesh.nodes) {
497
+ transactors.set(node.peerId.toString(), meshTransactor(mesh, options, node));
498
+ }
499
+ return transactors;
500
+ };
501
+ function meshTransactor(mesh, options, localNode) {
367
502
  const repoByPeer = new Map();
368
503
  for (const node of mesh.nodes) {
369
504
  const repo = node.coordinatorRepo;
@@ -372,25 +507,16 @@ export const buildNetworkTransactor = (mesh, options = {}) => {
372
507
  return new NetworkTransactor({
373
508
  timeoutMs: options.timeoutMs ?? 5_000,
374
509
  abortOrCancelTimeoutMs: options.abortOrCancelTimeoutMs ?? 5_000,
510
+ // NOTE: every transactor, `localNode`'s included, reads the unpartitioned shared view, not `localNode.keyNetwork`;
511
+ // no spec drives `partitionSides` through a node's transactor today. If one does, pass the node's own view.
375
512
  keyNetwork: mesh.keyNetwork,
376
513
  getRepo: (peerId) => {
377
514
  const repo = repoByPeer.get(peerId.toString());
378
515
  if (!repo)
379
516
  throw new Error(`Unknown peer ${peerId.toString()}`);
380
517
  return repo;
381
- }
518
+ },
519
+ localPeerId: localNode?.peerId
382
520
  });
383
- };
384
- /**
385
- * Builds one NetworkTransactor per mesh node, keyed by peer-id string. Each
386
- * transactor shares the mesh's key network and peer→repo map — the separate
387
- * instances exist so tests can semantically say "driven by node A".
388
- */
389
- export const buildNetworkTransactors = (mesh, options = {}) => {
390
- const transactors = new Map();
391
- for (const node of mesh.nodes) {
392
- transactors.set(node.peerId.toString(), buildNetworkTransactor(mesh, options));
393
- }
394
- return transactors;
395
- };
521
+ }
396
522
  //# sourceMappingURL=mesh-harness.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mesh-harness.js","sourceRoot":"","sources":["../../../src/testing/mesh-harness.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,aAAa,EAA6F,MAAM,4BAA4B,CAAC;AACrK,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAyD,MAAM,8BAA8B,CAAC;AAC3H,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I,CAAC,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,gBAAgB,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YAChE,OAAO,IAAI,CAAC;QACb,CAAC;QACD,WAAW,EAAE,SAAS,EAAE,MAAM;KAC9B,CAAC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optimystic/db-p2p",
3
- "version": "1.0.0-beta.3",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "description": "P2P database functionality for Optimystic",
6
6
  "main": "dist/src/index.js",
@@ -86,7 +86,7 @@
86
86
  "@multiformats/multiaddr": "^13.0.1",
87
87
  "@noble/curves": "^2.0.1",
88
88
  "@noble/hashes": "^2.0.1",
89
- "@optimystic/db-core": "^1.0.0-beta.3",
89
+ "@optimystic/db-core": "^1.0.0",
90
90
  "async-mutex": "^0.5.0",
91
91
  "debug": "^4.4.3",
92
92
  "it-all": "^3.0.9",