@optimystic/db-p2p 0.24.1 → 0.25.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 (257) hide show
  1. package/{readme.md → README.md} +688 -668
  2. package/dist/src/cluster/block-transfer-service.d.ts +133 -10
  3. package/dist/src/cluster/block-transfer-service.d.ts.map +1 -1
  4. package/dist/src/cluster/block-transfer-service.js +155 -9
  5. package/dist/src/cluster/block-transfer-service.js.map +1 -1
  6. package/dist/src/cluster/block-transfer.d.ts +67 -7
  7. package/dist/src/cluster/block-transfer.d.ts.map +1 -1
  8. package/dist/src/cluster/block-transfer.js +127 -24
  9. package/dist/src/cluster/block-transfer.js.map +1 -1
  10. package/dist/src/cluster/certified-claims.d.ts +170 -0
  11. package/dist/src/cluster/certified-claims.d.ts.map +1 -0
  12. package/dist/src/cluster/certified-claims.js +200 -0
  13. package/dist/src/cluster/certified-claims.js.map +1 -0
  14. package/dist/src/cluster/client-signature-verifier.d.ts +23 -0
  15. package/dist/src/cluster/client-signature-verifier.d.ts.map +1 -0
  16. package/dist/src/cluster/client-signature-verifier.js +33 -0
  17. package/dist/src/cluster/client-signature-verifier.js.map +1 -0
  18. package/dist/src/cluster/cluster-policy.d.ts +9 -3
  19. package/dist/src/cluster/cluster-policy.d.ts.map +1 -1
  20. package/dist/src/cluster/cluster-policy.js +111 -27
  21. package/dist/src/cluster/cluster-policy.js.map +1 -1
  22. package/dist/src/cluster/cluster-repo.d.ts +140 -11
  23. package/dist/src/cluster/cluster-repo.d.ts.map +1 -1
  24. package/dist/src/cluster/cluster-repo.js +485 -29
  25. package/dist/src/cluster/cluster-repo.js.map +1 -1
  26. package/dist/src/cluster/commit-proof.d.ts +134 -0
  27. package/dist/src/cluster/commit-proof.d.ts.map +1 -0
  28. package/dist/src/cluster/commit-proof.js +263 -0
  29. package/dist/src/cluster/commit-proof.js.map +1 -0
  30. package/dist/src/cluster/quorum-restore.d.ts +95 -8
  31. package/dist/src/cluster/quorum-restore.d.ts.map +1 -1
  32. package/dist/src/cluster/quorum-restore.js +113 -14
  33. package/dist/src/cluster/quorum-restore.js.map +1 -1
  34. package/dist/src/cluster/rebalance-monitor.d.ts +84 -0
  35. package/dist/src/cluster/rebalance-monitor.d.ts.map +1 -1
  36. package/dist/src/cluster/rebalance-monitor.js +207 -5
  37. package/dist/src/cluster/rebalance-monitor.js.map +1 -1
  38. package/dist/src/cluster/reconcile-block.d.ts +27 -7
  39. package/dist/src/cluster/reconcile-block.d.ts.map +1 -1
  40. package/dist/src/cluster/reconcile-block.js +179 -38
  41. package/dist/src/cluster/reconcile-block.js.map +1 -1
  42. package/dist/src/cluster/service.d.ts +21 -4
  43. package/dist/src/cluster/service.d.ts.map +1 -1
  44. package/dist/src/cluster/service.js +28 -17
  45. package/dist/src/cluster/service.js.map +1 -1
  46. package/dist/src/cluster/spread-on-churn.d.ts +8 -2
  47. package/dist/src/cluster/spread-on-churn.d.ts.map +1 -1
  48. package/dist/src/cluster/spread-on-churn.js +7 -7
  49. package/dist/src/cluster/spread-on-churn.js.map +1 -1
  50. package/dist/src/cohort-topic/host.d.ts.map +1 -1
  51. package/dist/src/cohort-topic/host.js +8 -7
  52. package/dist/src/cohort-topic/host.js.map +1 -1
  53. package/dist/src/cohort-topic/stream-util.d.ts +7 -6
  54. package/dist/src/cohort-topic/stream-util.d.ts.map +1 -1
  55. package/dist/src/cohort-topic/stream-util.js +14 -41
  56. package/dist/src/cohort-topic/stream-util.js.map +1 -1
  57. package/dist/src/dispute/cascade.d.ts +7 -8
  58. package/dist/src/dispute/cascade.d.ts.map +1 -1
  59. package/dist/src/dispute/cascade.js +24 -7
  60. package/dist/src/dispute/cascade.js.map +1 -1
  61. package/dist/src/dispute/dispute-service.d.ts +5 -0
  62. package/dist/src/dispute/dispute-service.d.ts.map +1 -1
  63. package/dist/src/dispute/dispute-service.js +13 -3
  64. package/dist/src/dispute/dispute-service.js.map +1 -1
  65. package/dist/src/dispute/invalidation.d.ts +33 -15
  66. package/dist/src/dispute/invalidation.d.ts.map +1 -1
  67. package/dist/src/dispute/invalidation.js +127 -34
  68. package/dist/src/dispute/invalidation.js.map +1 -1
  69. package/dist/src/dispute/service.d.ts.map +1 -1
  70. package/dist/src/dispute/service.js +2 -1
  71. package/dist/src/dispute/service.js.map +1 -1
  72. package/dist/src/index.d.ts +7 -0
  73. package/dist/src/index.d.ts.map +1 -1
  74. package/dist/src/index.js +7 -0
  75. package/dist/src/index.js.map +1 -1
  76. package/dist/src/libp2p-key-network.d.ts +78 -6
  77. package/dist/src/libp2p-key-network.d.ts.map +1 -1
  78. package/dist/src/libp2p-key-network.js +136 -57
  79. package/dist/src/libp2p-key-network.js.map +1 -1
  80. package/dist/src/libp2p-node-base.d.ts +38 -7
  81. package/dist/src/libp2p-node-base.d.ts.map +1 -1
  82. package/dist/src/libp2p-node-base.js +150 -62
  83. package/dist/src/libp2p-node-base.js.map +1 -1
  84. package/dist/src/logger.d.ts +2 -2
  85. package/dist/src/logger.js +2 -2
  86. package/dist/src/network/open-protocol-stream.d.ts +56 -0
  87. package/dist/src/network/open-protocol-stream.d.ts.map +1 -0
  88. package/dist/src/network/open-protocol-stream.js +60 -0
  89. package/dist/src/network/open-protocol-stream.js.map +1 -0
  90. package/dist/src/network/register-protocol-handler.d.ts +66 -0
  91. package/dist/src/network/register-protocol-handler.d.ts.map +1 -0
  92. package/dist/src/network/register-protocol-handler.js +51 -0
  93. package/dist/src/network/register-protocol-handler.js.map +1 -0
  94. package/dist/src/peer-address-book.d.ts +128 -1
  95. package/dist/src/peer-address-book.d.ts.map +1 -1
  96. package/dist/src/peer-address-book.js +198 -15
  97. package/dist/src/peer-address-book.js.map +1 -1
  98. package/dist/src/pend-validation.d.ts +65 -0
  99. package/dist/src/pend-validation.d.ts.map +1 -0
  100. package/dist/src/pend-validation.js +69 -0
  101. package/dist/src/pend-validation.js.map +1 -0
  102. package/dist/src/reactivity/notify-transport.d.ts.map +1 -1
  103. package/dist/src/reactivity/notify-transport.js +2 -1
  104. package/dist/src/reactivity/notify-transport.js.map +1 -1
  105. package/dist/src/reactivity/push-state-gossip.d.ts.map +1 -1
  106. package/dist/src/reactivity/push-state-gossip.js +2 -1
  107. package/dist/src/reactivity/push-state-gossip.js.map +1 -1
  108. package/dist/src/repo/cluster-coordinator.d.ts +32 -6
  109. package/dist/src/repo/cluster-coordinator.d.ts.map +1 -1
  110. package/dist/src/repo/cluster-coordinator.js +44 -10
  111. package/dist/src/repo/cluster-coordinator.js.map +1 -1
  112. package/dist/src/repo/coordinator-repo.d.ts +181 -25
  113. package/dist/src/repo/coordinator-repo.d.ts.map +1 -1
  114. package/dist/src/repo/coordinator-repo.js +650 -62
  115. package/dist/src/repo/coordinator-repo.js.map +1 -1
  116. package/dist/src/repo/served-repo-proxy.d.ts +30 -0
  117. package/dist/src/repo/served-repo-proxy.d.ts.map +1 -0
  118. package/dist/src/repo/served-repo-proxy.js +50 -0
  119. package/dist/src/repo/served-repo-proxy.js.map +1 -0
  120. package/dist/src/repo/service.d.ts +22 -1
  121. package/dist/src/repo/service.d.ts.map +1 -1
  122. package/dist/src/repo/service.js +25 -13
  123. package/dist/src/repo/service.js.map +1 -1
  124. package/dist/src/reputation/types.d.ts +3 -1
  125. package/dist/src/reputation/types.d.ts.map +1 -1
  126. package/dist/src/reputation/types.js +3 -1
  127. package/dist/src/reputation/types.js.map +1 -1
  128. package/dist/src/rn.d.ts +24 -2
  129. package/dist/src/rn.d.ts.map +1 -1
  130. package/dist/src/rn.js +33 -4
  131. package/dist/src/rn.js.map +1 -1
  132. package/dist/src/routing/libp2p-known-peers.d.ts.map +1 -1
  133. package/dist/src/routing/libp2p-known-peers.js +5 -0
  134. package/dist/src/routing/libp2p-known-peers.js.map +1 -1
  135. package/dist/src/storage/block-archive.d.ts +153 -0
  136. package/dist/src/storage/block-archive.d.ts.map +1 -0
  137. package/dist/src/storage/block-archive.js +194 -0
  138. package/dist/src/storage/block-archive.js.map +1 -0
  139. package/dist/src/storage/block-latch.d.ts +92 -0
  140. package/dist/src/storage/block-latch.d.ts.map +1 -0
  141. package/dist/src/storage/block-latch.js +132 -0
  142. package/dist/src/storage/block-latch.js.map +1 -0
  143. package/dist/src/storage/block-storage.d.ts +169 -12
  144. package/dist/src/storage/block-storage.d.ts.map +1 -1
  145. package/dist/src/storage/block-storage.js +415 -152
  146. package/dist/src/storage/block-storage.js.map +1 -1
  147. package/dist/src/storage/cached-raw-storage.d.ts +5 -1
  148. package/dist/src/storage/cached-raw-storage.d.ts.map +1 -1
  149. package/dist/src/storage/cached-raw-storage.js +16 -1
  150. package/dist/src/storage/cached-raw-storage.js.map +1 -1
  151. package/dist/src/storage/cached-store-driver.d.ts +14 -4
  152. package/dist/src/storage/cached-store-driver.d.ts.map +1 -1
  153. package/dist/src/storage/cached-store-driver.js +39 -5
  154. package/dist/src/storage/cached-store-driver.js.map +1 -1
  155. package/dist/src/storage/i-block-storage.d.ts +70 -19
  156. package/dist/src/storage/i-block-storage.d.ts.map +1 -1
  157. package/dist/src/storage/i-block-storage.js +21 -1
  158. package/dist/src/storage/i-block-storage.js.map +1 -1
  159. package/dist/src/storage/i-raw-storage.d.ts +38 -0
  160. package/dist/src/storage/i-raw-storage.d.ts.map +1 -1
  161. package/dist/src/storage/kv-raw-storage.d.ts +14 -8
  162. package/dist/src/storage/kv-raw-storage.d.ts.map +1 -1
  163. package/dist/src/storage/kv-raw-storage.js +29 -9
  164. package/dist/src/storage/kv-raw-storage.js.map +1 -1
  165. package/dist/src/storage/memory-store-driver.d.ts +4 -1
  166. package/dist/src/storage/memory-store-driver.d.ts.map +1 -1
  167. package/dist/src/storage/memory-store-driver.js +22 -2
  168. package/dist/src/storage/memory-store-driver.js.map +1 -1
  169. package/dist/src/storage/raw-store-codec.js +2 -2
  170. package/dist/src/storage/raw-store-driver.d.ts +44 -3
  171. package/dist/src/storage/raw-store-driver.d.ts.map +1 -1
  172. package/dist/src/storage/shared-cache-pool.d.ts +60 -3
  173. package/dist/src/storage/shared-cache-pool.d.ts.map +1 -1
  174. package/dist/src/storage/shared-cache-pool.js +68 -4
  175. package/dist/src/storage/shared-cache-pool.js.map +1 -1
  176. package/dist/src/storage/storage-repo.d.ts +204 -26
  177. package/dist/src/storage/storage-repo.d.ts.map +1 -1
  178. package/dist/src/storage/storage-repo.js +422 -119
  179. package/dist/src/storage/storage-repo.js.map +1 -1
  180. package/dist/src/storage/store-identity.d.ts +21 -0
  181. package/dist/src/storage/store-identity.d.ts.map +1 -0
  182. package/dist/src/storage/store-identity.js +33 -0
  183. package/dist/src/storage/store-identity.js.map +1 -0
  184. package/dist/src/storage/struct.d.ts +15 -0
  185. package/dist/src/storage/struct.d.ts.map +1 -1
  186. package/dist/src/storage/with-read-cache.d.ts +92 -0
  187. package/dist/src/storage/with-read-cache.d.ts.map +1 -0
  188. package/dist/src/storage/with-read-cache.js +132 -0
  189. package/dist/src/storage/with-read-cache.js.map +1 -0
  190. package/dist/src/sync/service.d.ts +13 -3
  191. package/dist/src/sync/service.d.ts.map +1 -1
  192. package/dist/src/sync/service.js +7 -30
  193. package/dist/src/sync/service.js.map +1 -1
  194. package/dist/src/testing/mesh-harness.d.ts +75 -2
  195. package/dist/src/testing/mesh-harness.d.ts.map +1 -1
  196. package/dist/src/testing/mesh-harness.js +193 -81
  197. package/dist/src/testing/mesh-harness.js.map +1 -1
  198. package/dist/src/testing/raw-storage-conformance.d.ts +8 -0
  199. package/dist/src/testing/raw-storage-conformance.d.ts.map +1 -1
  200. package/dist/src/testing/raw-storage-conformance.js +97 -2
  201. package/dist/src/testing/raw-storage-conformance.js.map +1 -1
  202. package/package.json +5 -6
  203. package/src/cluster/block-transfer-service.ts +528 -312
  204. package/src/cluster/block-transfer.ts +547 -424
  205. package/src/cluster/certified-claims.ts +319 -0
  206. package/src/cluster/client-signature-verifier.ts +34 -0
  207. package/src/cluster/cluster-policy.ts +294 -203
  208. package/src/cluster/cluster-repo.ts +2501 -2034
  209. package/src/cluster/commit-proof.ts +344 -0
  210. package/src/cluster/quorum-restore.ts +348 -223
  211. package/src/cluster/rebalance-monitor.ts +539 -254
  212. package/src/cluster/reconcile-block.ts +404 -203
  213. package/src/cluster/service.ts +308 -293
  214. package/src/cluster/spread-on-churn.ts +352 -346
  215. package/src/cohort-topic/host.ts +8 -7
  216. package/src/cohort-topic/stream-util.ts +14 -43
  217. package/src/dispute/cascade.ts +31 -15
  218. package/src/dispute/dispute-service.ts +706 -696
  219. package/src/dispute/invalidation.ts +162 -52
  220. package/src/dispute/service.ts +126 -125
  221. package/src/index.ts +7 -0
  222. package/src/libp2p-key-network.ts +142 -58
  223. package/src/libp2p-node-base.ts +1793 -1675
  224. package/src/logger.ts +27 -27
  225. package/src/network/open-protocol-stream.ts +87 -0
  226. package/src/network/register-protocol-handler.ts +85 -0
  227. package/src/peer-address-book.ts +360 -149
  228. package/src/pend-validation.ts +89 -0
  229. package/src/reactivity/notify-transport.ts +145 -144
  230. package/src/reactivity/push-state-gossip.ts +292 -291
  231. package/src/repo/cluster-coordinator.ts +65 -11
  232. package/src/repo/coordinator-repo.ts +729 -71
  233. package/src/repo/served-repo-proxy.ts +55 -0
  234. package/src/repo/service.ts +332 -313
  235. package/src/reputation/types.ts +3 -1
  236. package/src/rn.ts +34 -4
  237. package/src/routing/libp2p-known-peers.ts +31 -26
  238. package/src/storage/block-archive.ts +242 -0
  239. package/src/storage/block-latch.ts +144 -0
  240. package/src/storage/block-storage.ts +787 -498
  241. package/src/storage/cached-raw-storage.ts +21 -1
  242. package/src/storage/cached-store-driver.ts +898 -859
  243. package/src/storage/i-block-storage.ts +172 -116
  244. package/src/storage/i-raw-storage.ts +40 -0
  245. package/src/storage/kv-raw-storage.ts +34 -9
  246. package/src/storage/memory-store-driver.ts +26 -2
  247. package/src/storage/raw-store-codec.ts +42 -42
  248. package/src/storage/raw-store-driver.ts +45 -3
  249. package/src/storage/shared-cache-pool.ts +516 -452
  250. package/src/storage/storage-repo.ts +1421 -1014
  251. package/src/storage/store-identity.ts +41 -0
  252. package/src/storage/struct.ts +52 -34
  253. package/src/storage/with-read-cache.ts +182 -0
  254. package/src/sync/service.ts +178 -198
  255. package/src/testing/cohort-topic-mesh-harness.ts +673 -673
  256. package/src/testing/mesh-harness.ts +524 -344
  257. package/src/testing/raw-storage-conformance.ts +114 -2
@@ -1 +1 @@
1
- {"version":3,"file":"invalidation.js","sourceRoot":"","sources":["../../../src/dispute/invalidation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAK7E,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,GAAG,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC;AAEzC;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAa,CAAC;AAc1C;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,WAAmB,EAAE,MAAyB;IACrF,MAAM,cAAc,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;IACnD,OAAO,MAAM,UAAU,CAAC,GAAG,WAAW,IAAI,MAAM,CAAC,mBAAmB,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AACrG,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,aAAoC;IAClF,OAAO,MAAM,UAAU,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAiB,EAAE,IAAY,EAAE,YAAoB,EAAE,UAAkB,EAAE,OAAe;IAC5H,OAAO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
  import { MAX_CONTROL_MESSAGE_BYTES } from '../protocol-limits.js';
4
+ import { registerProtocolHandler } from '../network/register-protocol-handler.js';
4
5
  export function disputeProtocolService(init = {}) {
5
6
  return (components) => new DisputeProtocolService(components, init);
6
7
  }
@@ -29,7 +30,7 @@ export class DisputeProtocolService {
29
30
  async start() {
30
31
  if (this.running)
31
32
  return;
32
- await this.components.registrar.handle(this.protocol, this.handleIncomingStream.bind(this), {
33
+ await registerProtocolHandler(this.components.registrar, this.protocol, this.handleIncomingStream.bind(this), {
33
34
  maxInboundStreams: this.maxInboundStreams,
34
35
  maxOutboundStreams: this.maxOutboundStreams,
35
36
  });
@@ -1 +1 @@
1
- {"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/dispute/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAuBlE,MAAM,UAAU,sBAAsB,CAAC,OAAmC,EAAE;IAC3E,OAAO,CAAC,UAA4C,EAAE,EAAE,CAAC,IAAI,sBAAsB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AACvG,CAAC;AAED;;;GAGG;AACH,MAAM,OAAO,sBAAsB;IACjB,QAAQ,CAAS;IACjB,iBAAiB,CAAS;IAC1B,kBAAkB,CAAS;IAC3B,GAAG,CAAS;IACZ,cAAc,CAAiB;IAC/B,UAAU,CAAmC;IACtD,OAAO,CAAU;IAEzB,YAAY,UAA4C,EAAE,OAAmC,EAAE;QAC9F,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,cAAc,IAAI,SAAS,CAAC,GAAG,gBAAgB,CAAC;QACvF,IAAI,CAAC,iB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AC,IAAI,CAAC,EACxB,CAAC,MAAM,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAC5B,CAAC;gBACF,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,SAAS,EAAE,CAAC;oBACrC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACpB,CAAC;gBACD,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;YACtB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACd,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,sDAAsD,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;gBACpF,MAAM,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACnE,CAAC;QACF,CAAC,CAAC,EAAE,CAAC;IACN,CAAC;CACD"}
@@ -1,7 +1,9 @@
1
1
  export * from "./cluster/client.js";
2
+ export * from "./cluster/client-signature-verifier.js";
2
3
  export * from "./cluster/cluster-repo.js";
3
4
  export * from "./cluster/cluster-policy.js";
4
5
  export * from "./cluster/commit-cert.js";
6
+ export * from "./cluster/commit-proof.js";
5
7
  export * from "./cluster/service.js";
6
8
  export * from "./cluster/rebalance-monitor.js";
7
9
  export * from "./cluster/spread-on-churn.js";
@@ -12,18 +14,23 @@ export * from "./protocol-client.js";
12
14
  export * from "./repo/client.js";
13
15
  export * from "./repo/cluster-coordinator.js";
14
16
  export * from "./repo/coordinator-repo.js";
17
+ export * from "./repo/served-repo-proxy.js";
15
18
  export * from "./repo/service.js";
16
19
  export * from "./storage/block-storage.js";
20
+ export * from "./storage/block-latch.js";
21
+ export * from "./storage/store-identity.js";
17
22
  export * from "./storage/raw-store-driver.js";
18
23
  export * from "./storage/kv-raw-storage.js";
19
24
  export * from "./storage/shared-cache-pool.js";
20
25
  export * from "./storage/cached-store-driver.js";
21
26
  export * from "./storage/cached-raw-storage.js";
27
+ export * from "./storage/with-read-cache.js";
22
28
  export * from "./storage/memory-store-driver.js";
23
29
  export * from "./storage/memory-storage.js";
24
30
  export * from "./storage/i-block-storage.js";
25
31
  export * from "./storage/i-raw-storage.js";
26
32
  export * from "./storage/struct.js";
33
+ export * from "./storage/block-archive.js";
27
34
  export * from "./storage/storage-repo.js";
28
35
  export * from "./storage/restoration-coordinator.js";
29
36
  export * from "./storage/ring-selector.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sCAAsC,CAAC;AACrD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,oBAAoB,CA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5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sCAAsC,CAAC;AACrD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wCAAwC,CAAC;AACvD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAChE,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC"}
package/dist/src/index.js CHANGED
@@ -1,7 +1,9 @@
1
1
  export * from "./cluster/client.js";
2
+ export * from "./cluster/client-signature-verifier.js";
2
3
  export * from "./cluster/cluster-repo.js";
3
4
  export * from "./cluster/cluster-policy.js";
4
5
  export * from "./cluster/commit-cert.js";
6
+ export * from "./cluster/commit-proof.js";
5
7
  export * from "./cluster/service.js";
6
8
  export * from "./cluster/rebalance-monitor.js";
7
9
  export * from "./cluster/spread-on-churn.js";
@@ -12,18 +14,23 @@ export * from "./protocol-client.js";
12
14
  export * from "./repo/client.js";
13
15
  export * from "./repo/cluster-coordinator.js";
14
16
  export * from "./repo/coordinator-repo.js";
17
+ export * from "./repo/served-repo-proxy.js";
15
18
  export * from "./repo/service.js";
16
19
  export * from "./storage/block-storage.js";
20
+ export * from "./storage/block-latch.js";
21
+ export * from "./storage/store-identity.js";
17
22
  export * from "./storage/raw-store-driver.js";
18
23
  export * from "./storage/kv-raw-storage.js";
19
24
  export * from "./storage/shared-cache-pool.js";
20
25
  export * from "./storage/cached-store-driver.js";
21
26
  export * from "./storage/cached-raw-storage.js";
27
+ export * from "./storage/with-read-cache.js";
22
28
  export * from "./storage/memory-store-driver.js";
23
29
  export * from "./storage/memory-storage.js";
24
30
  export * from "./storage/i-block-storage.js";
25
31
  export * from "./storage/i-raw-storage.js";
26
32
  export * from "./storage/struct.js";
33
+ export * from "./storage/block-archive.js";
27
34
  export * from "./storage/storage-repo.js";
28
35
  export * from "./storage/restoration-coordinator.js";
29
36
  export * from "./storage/ring-selector.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BA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C,CAAC;AACvD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAChE,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC"}
@@ -52,6 +52,30 @@ export declare class FindCoordinatorError extends Error {
52
52
  readonly code: FindCoordinatorErrorCode;
53
53
  constructor(code: FindCoordinatorErrorCode, message: string);
54
54
  }
55
+ /**
56
+ * `.code` on {@link SelfRelayOnlyAddressesError}. A stable string so it survives the
57
+ * `ClusterErrorEnvelope` round trip (`toClusterErrorEnvelope` carries `name` and `code`) and shows
58
+ * up as `code=SELF_RELAY_ONLY_ADDRESSES` on `ProtocolClient`'s `dial:fail` line instead of `none`.
59
+ */
60
+ export declare const SELF_RELAY_ONLY_ERROR_CODE = "SELF_RELAY_ONLY_ADDRESSES";
61
+ /**
62
+ * Thrown by {@link Libp2pKeyPeerNetwork.connect} when we hold addresses for a peer but EVERY one
63
+ * of them reaches it by relaying through this node.
64
+ *
65
+ * This is the steady state a relay reaches for its own reservation holders: the address such a
66
+ * client advertises is `/<our transport addr>/p2p/<our peer id>/p2p-circuit`, which is correct and
67
+ * useful to every node except us. Dialing it asks us to relay to the client through ourselves, so
68
+ * it can only fail — with an error text (`NoValidAddressesError`, or an `AggregateError` of
69
+ * `Can not dial self`, depending on whether the circuit transport is registered as a dialer here)
70
+ * that is indistinguishable from "nobody ever taught us an address". Retrying cannot help: once the
71
+ * client's connection drops, only the client can re-initiate. So we fail fast and distinctly,
72
+ * letting the caller's existing exclude-and-continue logic move to another cohort member instead of
73
+ * burning a dial timeout.
74
+ */
75
+ export declare class SelfRelayOnlyAddressesError extends Error {
76
+ readonly code = "SELF_RELAY_ONLY_ADDRESSES";
77
+ constructor(peer: string, protocol: string, addrCount: number);
78
+ }
55
79
  /** Snapshot format this build writes and is willing to read. Bump on any incompatible change. */
56
80
  export declare const PERSISTED_STATE_VERSION: 2;
57
81
  /**
@@ -216,6 +240,12 @@ export declare class Libp2pKeyPeerNetwork implements IKeyNetwork, IPeerNetwork {
216
240
  private readonly coordinatorCache;
217
241
  private static readonly MAX_CACHE_ENTRIES;
218
242
  private readonly log;
243
+ /**
244
+ * This instance's logger, in the shape `peer-address-book.ts` accepts. Declared once so the
245
+ * five address predicates that take a sink all report under the same peer-id-suffixed
246
+ * namespace, rather than five separately-written adapters drifting apart.
247
+ */
248
+ private readonly addressLog;
219
249
  private toCacheKey;
220
250
  /**
221
251
  * Set up connection event tracking to update high water mark and last connected time.
@@ -281,6 +311,15 @@ export declare class Libp2pKeyPeerNetwork implements IKeyNetwork, IPeerNetwork {
281
311
  * nor banned by reputation. Shared by all three places `findCoordinator` narrows a candidate
282
312
  * list — the FRET tier, the connected-peer fallback, and the retry-futility input — so the
283
313
  * futility test can never disagree with the tiers about who is pickable.
314
+ *
315
+ * NOTE: eligibility here is deliberately blind to self-dialability, so on a relay
316
+ * `findCoordinator` can still pick one of our own reservation holders and only then fail fast
317
+ * with `SelfRelayOnlyAddressesError`. The caller's exclude-and-continue walk
318
+ * (`db-core/utility/batch-coordinator.ts`) absorbs it, and each such pick now costs an
319
+ * instant refusal rather than a burned dial timeout, so it is a selection round-trip, not a
320
+ * stall — and the verdict is a live peerStore read that a stale eligibility filter would have
321
+ * to guess at. If a relay serving many reservation holders is ever measured spending real time
322
+ * walking through them, feed the verdict into the tiers instead of discovering it at dial.
284
323
  */
285
324
  private isSelectable;
286
325
  private persistState;
@@ -323,18 +362,51 @@ export declare class Libp2pKeyPeerNetwork implements IKeyNetwork, IPeerNetwork {
323
362
  recordPeerAddresses(peerId: PeerId, multiaddrs: string[]): void;
324
363
  private getCachedCoordinator;
325
364
  /**
326
- * True for a circuit-relay ("limited") connection. libp2p stamps a relayed
327
- * connection with `limits` (per-circuit data/duration caps); we additionally
328
- * sniff the multiaddr for `/p2p-circuit` as a fallback for transports/versions
329
- * that don't populate `limits`.
365
+ * Open a stream to `peerId` on `protocol` — reusing a live connection when we hold one, and
366
+ * otherwise dialing.
367
+ *
368
+ * Connection selection (prefer a direct connection over a resettable circuit-relay one, skip
369
+ * entries libp2p has not yet evicted, opt in to limited connections) lives in
370
+ * {@link openProtocolStream}, the single place in this package that opens a protocol stream.
371
+ *
372
+ * `negotiateFully: false` is safe here and saves a round trip: this is request/response and the
373
+ * caller always reads a reply, so an unsupported-protocol failure deferred to the first read is
374
+ * still observed. The caller's `AbortSignal` is forwarded so a per-peer dial deadline (enforced
375
+ * upstream by `ProtocolClient.processMessage`) can actually cancel a stuck dial — without it,
376
+ * libp2p falls back to its built-in connection-manager `dialTimeout` and the caller's tighter
377
+ * deadline is decorative.
378
+ *
379
+ * The cold path pays one `peerStore.get` before dialing, to separate two failures libp2p
380
+ * reports identically: "nobody ever taught us an address" and "every address we hold routes
381
+ * back through us" (see {@link SelfRelayOnlyAddressesError}). Only the second is diagnosed
382
+ * here; the first still dials, so an unknown peer produces libp2p's own `NoValidAddressesError`
383
+ * exactly as before. It rides `beforeDial`, which never runs on the reuse path — the warm path
384
+ * is deliberately kept clear of that read, since a live connection is the case this method
385
+ * exists to make cheap.
330
386
  */
331
- private isLimitedConnection;
332
387
  connect(peerId: PeerId, protocol: string, options?: AbortOptions): Promise<Stream>;
388
+ /**
389
+ * Throw {@link SelfRelayOnlyAddressesError} when every address we hold for `peerId` routes
390
+ * through us, so the caller skips a dial that cannot succeed.
391
+ *
392
+ * Holding NOTHING is left alone on purpose — that dial still happens and still fails with
393
+ * libp2p's `NoValidAddressesError`, because "we were never told an address" is a genuinely
394
+ * different condition with a genuinely different remedy (someone teaches us one; see
395
+ * `recordPeerAddresses`).
396
+ */
397
+ private assertNotSelfRelayOnly;
333
398
  private getFret;
334
399
  private getNeighborIdsForKey;
335
400
  findCoordinator(key: Uint8Array, _options?: Partial<FindCoordinatorOptions>): Promise<PeerId>;
401
+ /**
402
+ * Connection-derived addresses for the cluster record, keyed by peer id.
403
+ *
404
+ * Only OUTBOUND connections contribute — see {@link publishableConnectionAddr} for why an
405
+ * inbound connection's `remoteAddr` is an ephemeral source socket that no third party can
406
+ * reach. This is the only place `findCluster` derives addresses from connections, so the
407
+ * rule has exactly one site.
408
+ */
336
409
  private getConnectedAddrsByPeer;
337
- private parseMultiaddrs;
338
410
  findCluster(key: Uint8Array): Promise<ClusterPeers>;
339
411
  /**
340
412
  * Look up the libp2p peerStore for known multiaddrs of the given peer ids.
@@ -1 +1 @@
1
- {"version":3,"file":"libp2p-key-network.d.ts","sourceRoot":"","sources":["../../src/libp2p-key-network.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE1F,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE9H,OAAO,KAAK,EAAe,eAAe,EAAE,MAAM,UAAU,CAAA;AAI5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAI5D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B;IACxC;;;;;;OAMG;;IAEH;;;;OAIG;;IAEH,2DAA2D;;IAE3D;;;;;;OAMG;;CAEM,CAAC;AAEX,MAAM,MAAM,wBAAwB,GACnC,OAAO,4BAA4B,CAAC,MAAM,OAAO,4BAA4B,CAAC,CAAC;AAEhF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAEjE,qBAAa,oBAAqB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC;gBAC5B,IAAI,EAAE,wBAAwB,EAAE,OAAO,EAAE,MAAM;CAK3D;AAED,iGAAiG;AACjG,eAAO,MAAM,uBAAuB,EAAG,CAAU,CAAC;AAElD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,qBAAqB;IACrC,O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AsB;IAiBpC,OAAO,CAAC,OAAO;YAMD,oBAAoB;IAO5B,eAAe,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IA0OnG;;;;;;;OAOG;IACH,OAAO,CAAC,uBAAuB;IAazB,WAAW,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC;IA2JzD;;;;;OAKG;YACW,uBAAuB;IAiBrC;;;;;;;;OAQG;YACW,yBAAyB;IAiBvC;;;;;OAKG;YACW,2BAA2B;IAgBzC;;;;;;;OAOG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IASpB;;;;;;;;;;;;;;;;;OAiBG;YACW,kBAAkB;CAahC"}
@@ -2,7 +2,8 @@ import { toString as u8ToString } from 'uint8arrays';
2
2
  import { peerIdFromString } from '@libp2p/peer-id';
3
3
  import { hashKey } from 'p2p-fret';
4
4
  import { createLogger, verbose } from './logger.js';
5
- import { mergePeerAddresses, validMultiaddrStrings } from './peer-address-book.js';
5
+ import { classifySelfDialability, mergePeerAddresses, publishableConnectionAddr, unionPublishableAddrs } from './peer-address-book.js';
6
+ import { openProtocolStream } from './network/open-protocol-stream.js';
6
7
  /**
7
8
  * Error codes surfaced by {@link Libp2pKeyPeerNetwork.findCoordinator}. Callers
8
9
  * (notably the batch-retry logic in `NetworkTransactor`) can inspect `.code`
@@ -43,6 +44,35 @@ export class FindCoordinatorError extends Error {
43
44
  this.code = code;
44
45
  }
45
46
  }
47
+ /**
48
+ * `.code` on {@link SelfRelayOnlyAddressesError}. A stable string so it survives the
49
+ * `ClusterErrorEnvelope` round trip (`toClusterErrorEnvelope` carries `name` and `code`) and shows
50
+ * up as `code=SELF_RELAY_ONLY_ADDRESSES` on `ProtocolClient`'s `dial:fail` line instead of `none`.
51
+ */
52
+ export const SELF_RELAY_ONLY_ERROR_CODE = 'SELF_RELAY_ONLY_ADDRESSES';
53
+ /**
54
+ * Thrown by {@link Libp2pKeyPeerNetwork.connect} when we hold addresses for a peer but EVERY one
55
+ * of them reaches it by relaying through this node.
56
+ *
57
+ * This is the steady state a relay reaches for its own reservation holders: the address such a
58
+ * client advertises is `/<our transport addr>/p2p/<our peer id>/p2p-circuit`, which is correct and
59
+ * useful to every node except us. Dialing it asks us to relay to the client through ourselves, so
60
+ * it can only fail — with an error text (`NoValidAddressesError`, or an `AggregateError` of
61
+ * `Can not dial self`, depending on whether the circuit transport is registered as a dialer here)
62
+ * that is indistinguishable from "nobody ever taught us an address". Retrying cannot help: once the
63
+ * client's connection drops, only the client can re-initiate. So we fail fast and distinctly,
64
+ * letting the caller's existing exclude-and-continue logic move to another cohort member instead of
65
+ * burning a dial timeout.
66
+ */
67
+ export class SelfRelayOnlyAddressesError extends Error {
68
+ code = SELF_RELAY_ONLY_ERROR_CODE;
69
+ constructor(peer, protocol, addrCount) {
70
+ super(`Peer ${peer} is reachable only through a circuit on THIS node: all ${addrCount} address(es) ` +
71
+ `we hold route back through us, so no dial for ${protocol} can succeed. ` +
72
+ `Only that peer can re-establish the connection.`);
73
+ this.name = 'SelfRelayOnlyAddressesError';
74
+ }
75
+ }
46
76
  /** Snapshot format this build writes and is willing to read. Bump on any incompatible change. */
47
77
  export const PERSISTED_STATE_VERSION = 2;
48
78
  export class Libp2pKeyPeerNetwork {
@@ -136,6 +166,12 @@ export class Libp2pKeyPeerNetwork {
136
166
  coordinatorCache = new Map();
137
167
  static MAX_CACHE_ENTRIES = 1000;
138
168
  log;
169
+ /**
170
+ * This instance's logger, in the shape `peer-address-book.ts` accepts. Declared once so the
171
+ * five address predicates that take a sink all report under the same peer-id-suffixed
172
+ * namespace, rather than five separately-written adapters drifting apart.
173
+ */
174
+ addressLog = (fmt, ...args) => this.log(fmt, ...args);
139
175
  toCacheKey(key) { return u8ToString(key, 'base64url'); }
140
176
  /**
141
177
  * Set up connection event tracking to update high water mark and last connected time.
@@ -272,6 +308,15 @@ export class Libp2pKeyPeerNetwork {
272
308
  * nor banned by reputation. Shared by all three places `findCoordinator` narrows a candidate
273
309
  * list — the FRET tier, the connected-peer fallback, and the retry-futility input — so the
274
310
  * futility test can never disagree with the tiers about who is pickable.
311
+ *
312
+ * NOTE: eligibility here is deliberately blind to self-dialability, so on a relay
313
+ * `findCoordinator` can still pick one of our own reservation holders and only then fail fast
314
+ * with `SelfRelayOnlyAddressesError`. The caller's exclude-and-continue walk
315
+ * (`db-core/utility/batch-coordinator.ts`) absorbs it, and each such pick now costs an
316
+ * instant refusal rather than a burned dial timeout, so it is a selection round-trip, not a
317
+ * stall — and the verdict is a live peerStore read that a stale eligibility filter would have
318
+ * to guess at. If a relay serving many reservation holders is ever measured spending real time
319
+ * walking through them, feed the verdict into the tiers instead of discovering it at dial.
275
320
  */
276
321
  isSelectable(id, excluded) {
277
322
  return !excluded.has(id) && !(this.reputation?.isBanned(id));
@@ -407,7 +452,7 @@ export class Libp2pKeyPeerNetwork {
407
452
  * protocol client dials through.
408
453
  */
409
454
  recordPeerAddresses(peerId, multiaddrs) {
410
- mergePeerAddresses(this.libp2p, peerId, multiaddrs, (fmt, ...args) => this.log(fmt, ...args));
455
+ mergePeerAddresses(this.libp2p, peerId, multiaddrs, this.addressLog);
411
456
  }
412
457
  getCachedCoordinator(key) {
413
458
  const k = this.toCacheKey(key);
@@ -419,49 +464,59 @@ export class Libp2pKeyPeerNetwork {
419
464
  return undefined;
420
465
  }
421
466
  /**
422
- * True for a circuit-relay ("limited") connection. libp2p stamps a relayed
423
- * connection with `limits` (per-circuit data/duration caps); we additionally
424
- * sniff the multiaddr for `/p2p-circuit` as a fallback for transports/versions
425
- * that don't populate `limits`.
467
+ * Open a stream to `peerId` on `protocol` — reusing a live connection when we hold one, and
468
+ * otherwise dialing.
469
+ *
470
+ * Connection selection (prefer a direct connection over a resettable circuit-relay one, skip
471
+ * entries libp2p has not yet evicted, opt in to limited connections) lives in
472
+ * {@link openProtocolStream}, the single place in this package that opens a protocol stream.
473
+ *
474
+ * `negotiateFully: false` is safe here and saves a round trip: this is request/response and the
475
+ * caller always reads a reply, so an unsupported-protocol failure deferred to the first read is
476
+ * still observed. The caller's `AbortSignal` is forwarded so a per-peer dial deadline (enforced
477
+ * upstream by `ProtocolClient.processMessage`) can actually cancel a stuck dial — without it,
478
+ * libp2p falls back to its built-in connection-manager `dialTimeout` and the caller's tighter
479
+ * deadline is decorative.
480
+ *
481
+ * The cold path pays one `peerStore.get` before dialing, to separate two failures libp2p
482
+ * reports identically: "nobody ever taught us an address" and "every address we hold routes
483
+ * back through us" (see {@link SelfRelayOnlyAddressesError}). Only the second is diagnosed
484
+ * here; the first still dials, so an unknown peer produces libp2p's own `NoValidAddressesError`
485
+ * exactly as before. It rides `beforeDial`, which never runs on the reuse path — the warm path
486
+ * is deliberately kept clear of that read, since a live connection is the case this method
487
+ * exists to make cheap.
426
488
  */
427
- isLimitedConnection(c) {
428
- if (c.limits != null)
429
- return true;
430
- const addr = c.remoteAddr?.toString?.();
431
- return addr != null && addr.includes('/p2p-circuit');
489
+ async connect(peerId, protocol, options) {
490
+ return await openProtocolStream(this.libp2p, peerId, protocol, {
491
+ signal: options?.signal,
492
+ negotiateFully: false,
493
+ beforeDial: () => this.assertNotSelfRelayOnly(peerId, protocol, options)
494
+ });
432
495
  }
433
- connect(peerId, protocol, options) {
434
- const conns = this.libp2p.getConnections?.(peerId) ?? [];
435
- // Filter to only-open connections so a closing/closed entry that libp2p
436
- // hasn't yet evicted from its index doesn't get picked up here.
437
- const open = conns.filter(c => c?.status === 'open' && typeof c?.newStream === 'function');
438
- // Prefer a DIRECT connection over a limited (circuit-relay) one for the RPC.
439
- // A relayed/limited connection can be reset by the relay once a per-circuit
440
- // cap or reservation lapses (@libp2p/circuit-relay-v2), surfacing to the
441
- // coordinator as a StreamResetError that fails consensus. After DCUtR upgrades
442
- // a relayed link to direct, both connections briefly coexist — picking the
443
- // direct one avoids riding the soon-to-be-reset circuit. We only fall back to
444
- // the limited connection (with runOnLimitedConnection) when it is the only open
445
- // path the steady state for browsers and NATed peers before any upgrade.
446
- const chosen = open.find(c => !this.isLimitedConnection(c)) ?? open[0];
447
- if (chosen) {
448
- // runOnLimitedConnection: true is required to open a stream over a
449
- // circuit-relay (limited) connection — the steady-state path for
450
- // browsers and NATed peers. Without it, the warm relay connection
451
- // from a prior dialProtocol cannot be reused on subsequent RPCs. It is
452
- // a harmless no-op on the preferred direct connection.
453
- return chosen.newStream([protocol], {
454
- signal: options?.signal,
455
- runOnLimitedConnection: true,
456
- negotiateFully: false
457
- });
458
- }
459
- // Forward the caller's AbortSignal so a per-peer dial deadline (enforced
460
- // upstream by ProtocolClient.processMessage) can actually cancel a stuck
461
- // dial — without this, libp2p falls back to its built-in dial timeout
462
- // (default ~30s) and the caller's tighter deadline is decorative.
463
- const dialOptions = { runOnLimitedConnection: true, negotiateFully: false, signal: options?.signal };
464
- return this.libp2p.dialProtocol(peerId, [protocol], dialOptions);
496
+ /**
497
+ * Throw {@link SelfRelayOnlyAddressesError} when every address we hold for `peerId` routes
498
+ * through us, so the caller skips a dial that cannot succeed.
499
+ *
500
+ * Holding NOTHING is left alone on purpose that dial still happens and still fails with
501
+ * libp2p's `NoValidAddressesError`, because "we were never told an address" is a genuinely
502
+ * different condition with a genuinely different remedy (someone teaches us one; see
503
+ * `recordPeerAddresses`).
504
+ */
505
+ async assertNotSelfRelayOnly(peerId, protocol, options) {
506
+ // NOTE: this costs one `peerStore.get` on EVERY cold dial, not only on relays, and libp2p's
507
+ // own dial queue reads the same record moments later so a cold dial pays the peerStore
508
+ // twice. Unmeasured, and negligible against a dial's own cost; if cold-dial latency or
509
+ // peerStore contention ever shows up in a profile, hoist the verdict into the dial path
510
+ // rather than reading ahead of it.
511
+ const idStr = peerId.toString();
512
+ const held = (await this.getPeerStoreAddrsByPeer([idStr]))[idStr] ?? [];
513
+ // A caller that cancelled while we were reading the peerStore is owed ITS reason, not a
514
+ // verdict we computed from a snapshot it no longer cares about.
515
+ options?.signal?.throwIfAborted();
516
+ if (classifySelfDialability(held, this.libp2p.peerId.toString(), this.addressLog) !== 'self-relay-only')
517
+ return;
518
+ this.log('connect:self-relay-only peer=%s protocol=%s addrs=%d', idStr.substring(0, 12), protocol, held.length);
519
+ throw new SelfRelayOnlyAddressesError(idStr, protocol, held.length);
465
520
  }
466
521
  getFret() {
467
522
  const svc = this.libp2p.services?.fret;
@@ -684,20 +739,27 @@ export class Libp2pKeyPeerNetwork {
684
739
  this.log('findCoordinator:all-excluded key=%s self=%s', keyStr, self.toString().substring(0, 12));
685
740
  throw new FindCoordinatorError(FIND_COORDINATOR_ERROR_CODES.NO_COORDINATOR_AVAILABLE, 'No coordinator available for key (all candidates excluded)');
686
741
  }
742
+ /**
743
+ * Connection-derived addresses for the cluster record, keyed by peer id.
744
+ *
745
+ * Only OUTBOUND connections contribute — see {@link publishableConnectionAddr} for why an
746
+ * inbound connection's `remoteAddr` is an ephemeral source socket that no third party can
747
+ * reach. This is the only place `findCluster` derives addresses from connections, so the
748
+ * rule has exactly one site.
749
+ */
687
750
  getConnectedAddrsByPeer() {
688
751
  const conns = this.libp2p.getConnections();
689
752
  const byPeer = {};
690
753
  for (const c of conns) {
754
+ const addr = publishableConnectionAddr(c, this.addressLog);
755
+ if (addr === undefined)
756
+ continue;
691
757
  const id = c.remotePeer.toString();
692
- const addr = c.remoteAddr?.toString?.();
693
- if (addr)
694
- (byPeer[id] ??= []).push(addr);
758
+ const forPeer = byPeer[id] ??= [];
759
+ forPeer.push(addr);
695
760
  }
696
761
  return byPeer;
697
762
  }
698
- parseMultiaddrs(addrs) {
699
- return validMultiaddrStrings(addrs, (fmt, ...args) => this.log(fmt, ...args));
700
- }
701
763
  async findCluster(key) {
702
764
  const t0 = Date.now();
703
765
  const fret = this.getFret();
@@ -789,6 +851,13 @@ export class Libp2pKeyPeerNetwork {
789
851
  // reported symptom: clean membership logs on every node while every dial to the
790
852
  // addressless member died instantly and the write never completed.
791
853
  const addressless = [];
854
+ // The OTHER way a member can be undialable by us: we hold addresses, but every one of
855
+ // them is a circuit through this node — the steady state for our own reservation holders.
856
+ // Counted separately because the two have different remedies (be taught an address, vs.
857
+ // wait for the client to re-dial us) and libp2p's dial error cannot tell them apart.
858
+ // These addresses are still PUBLISHED: a cohort sibling reaching the member through our
859
+ // relay is the working path, and dropping them would break it.
860
+ const selfRelayOnly = [];
792
861
  for (const idStr of ids) {
793
862
  if (idStr === selfId) {
794
863
  const raw = this.libp2p.peerId.publicKey?.raw ?? new Uint8Array();
@@ -797,12 +866,13 @@ export class Libp2pKeyPeerNetwork {
797
866
  }
798
867
  const connectedStrings = connectedByPeer[idStr] ?? [];
799
868
  const peerStoreStrings = peerStoreAddrs[idStr] ?? [];
800
- // De-duplicate while preserving connected-first ordering. The
801
- // connected multiaddr is the one libp2p just used to reach this peer
802
- // and is the most reliable; peerStore addrs are the fallback for
803
- // cohort members we know-of but aren't currently connected to.
804
- const merged = Array.from(new Set([...connectedStrings, ...peerStoreStrings]));
805
- const parsed = this.parseMultiaddrs(merged);
869
+ // The union rule connected-first, de-duplicated, validated — lives in
870
+ // `unionPublishableAddrs` so a cluster record and a redirect payload cannot describe
871
+ // the same peer differently. The sync form is used here (rather than
872
+ // `publishableAddrsForPeer`) because both halves are already in hand: the peerStore
873
+ // read above is batched across the whole cohort, and on the membership-scoped path it
874
+ // is the same `store.get` that fetched protocols.
875
+ const parsed = unionPublishableAddrs(connectedStrings, peerStoreStrings, this.addressLog);
806
876
  const remotePeerId = peerIdFromString(idStr);
807
877
  const raw = remotePeerId.publicKey?.raw ?? new Uint8Array();
808
878
  // Note: parsed may be empty for a cohort member we have neither a
@@ -811,8 +881,11 @@ export class Libp2pKeyPeerNetwork {
811
881
  // retry/exclude logic takes over — we intentionally do NOT drop
812
882
  // addressless members here, because shrinking the cohort below
813
883
  // `clusterSize` puts consensus supermajority out of reach.
814
- if (parsed.length === 0)
884
+ const dialability = classifySelfDialability(parsed, selfId, this.addressLog);
885
+ if (dialability === 'none')
815
886
  addressless.push(idStr.substring(0, 12));
887
+ else if (dialability === 'self-relay-only')
888
+ selfRelayOnly.push(idStr.substring(0, 12));
816
889
  peers[idStr] = { multiaddrs: parsed, publicKey: u8ToString(raw, 'base64url') };
817
890
  }
818
891
  // Unconditional (not gated on `verbose`): this is the one line that turns a silent
@@ -822,7 +895,13 @@ export class Libp2pKeyPeerNetwork {
822
895
  if (addressless.length > 0) {
823
896
  this.log('findCluster:addressless-members key=%s count=%d of=%d peers=%o', keyStr, addressless.length, Object.keys(peers).length, addressless);
824
897
  }
825
- this.log('findCluster:done key=%s ms=%d peers=%d addressless=%d', keyStr, Date.now() - t0, Object.keys(peers).length, addressless.length);
898
+ // Same reasoning, second condition: a non-zero count here means we DO hold addresses for
899
+ // these members and still cannot dial them, because the only route we know runs through
900
+ // our own relay. No amount of retrying changes that (see `SelfRelayOnlyAddressesError`).
901
+ if (selfRelayOnly.length > 0) {
902
+ this.log('findCluster:self-relay-only-members key=%s count=%d of=%d peers=%o', keyStr, selfRelayOnly.length, Object.keys(peers).length, selfRelayOnly);
903
+ }
904
+ this.log('findCluster:done key=%s ms=%d peers=%d addressless=%d selfRelayOnly=%d', keyStr, Date.now() - t0, Object.keys(peers).length, addressless.length, selfRelayOnly.length);
826
905
  return peers;
827
906
  }
828
907
  /**