p2p-fret 1.0.0 → 1.0.1

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.
@@ -297,8 +297,8 @@ export declare function isLimitedConnection(c: Connection): boolean;
297
297
  * exists (neighbors fetch/announce reduce churn this way) and `undefined` is
298
298
  * returned; otherwise we `dialProtocol`.
299
299
  *
300
- * `opts.signal` bounds the open itself. Both `newStream` and `dialProtocol` take
301
- * `NewStreamOptions extends AbortOptions`; without it a dial that hangs — no address,
300
+ * `opts.signal` bounds the open itself. Both `newStream` and `dialProtocol` take an
301
+ * `AbortOptions` signal; without it a dial that hangs — no address,
302
302
  * unresponsive transport, half-open TCP — hangs the caller with no budget at all. An
303
303
  * already-aborted signal throws here rather than dialing, so a `stop()` racing a
304
304
  * maintenance tick cannot still issue dials.
@@ -596,8 +596,8 @@ export function isLimitedConnection(c) {
596
596
  * exists (neighbors fetch/announce reduce churn this way) and `undefined` is
597
597
  * returned; otherwise we `dialProtocol`.
598
598
  *
599
- * `opts.signal` bounds the open itself. Both `newStream` and `dialProtocol` take
600
- * `NewStreamOptions extends AbortOptions`; without it a dial that hangs — no address,
599
+ * `opts.signal` bounds the open itself. Both `newStream` and `dialProtocol` take an
600
+ * `AbortOptions` signal; without it a dial that hangs — no address,
601
601
  * unresponsive transport, half-open TCP — hangs the caller with no budget at all. An
602
602
  * already-aborted signal throws here rather than dialing, so a `stop()` racing a
603
603
  * maintenance tick cannot still issue dials.
@@ -618,6 +618,8 @@ export async function openRpcStream(node, pid, protocols, opts = {}) {
618
618
  // Prefer a direct connection; fall back to the limited one only when it is
619
619
  // the only open path (the steady state for browsers and NATed peers).
620
620
  const chosen = open.find(c => !isLimitedConnection(c)) ?? open[0];
621
+ // Typed for the dial: one object feeds both opens below, and since libp2p 3.3 only
622
+ // `DialProtocolOptions`' `onProgress` also admits connection-open events.
621
623
  const streamOpts = {
622
624
  runOnLimitedConnection: true,
623
625
  negotiateFully: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "p2p-fret",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "description": "FRET: Finger Ring Ensemble Topology (libp2p ring overlay with Digitree)",
6
6
  "main": "dist/src/index.js",
@@ -23,42 +23,43 @@
23
23
  "test": "node --import ./register.mjs node_modules/mocha/bin/mocha.js \"test/**/*.spec.ts\" --colors"
24
24
  },
25
25
  "peerDependencies": {
26
- "@libp2p/interface": "^3.1.0",
27
- "@libp2p/peer-id": "^6.0.4",
28
- "libp2p": "^3.1.3"
26
+ "@libp2p/interface": "^3.3.0",
27
+ "@libp2p/peer-id": "^6.0.15",
28
+ "libp2p": "^3.3.11"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@chainsafe/libp2p-noise": "^17.0.0",
32
32
  "@chainsafe/libp2p-yamux": "^8.0.1",
33
- "@libp2p/circuit-relay-v2": "4.1.3",
34
- "@libp2p/crypto": "^5.1.13",
35
- "@libp2p/identify": "4.0.10",
36
- "@libp2p/interface": "^3.1.0",
37
- "@libp2p/memory": "^2.0.10",
38
- "@libp2p/peer-id": "^6.0.4",
39
- "@libp2p/plaintext": "^3.0.10",
40
- "@libp2p/tcp": "^11.0.10",
33
+ "@libp2p/circuit-relay-v2": "^4.2.13",
34
+ "@libp2p/crypto": "^5.1.23",
35
+ "@libp2p/identify": "^4.1.14",
36
+ "@libp2p/interface": "^3.3.0",
37
+ "@libp2p/memory": "^2.0.28",
38
+ "@libp2p/peer-id": "^6.0.15",
39
+ "@libp2p/plaintext": "^3.0.28",
40
+ "@libp2p/tcp": "^11.0.28",
41
41
  "@types/chai": "^5.2.3",
42
42
  "@types/mocha": "^10.0.10",
43
43
  "@types/node": "^25.2.2",
44
44
  "chai": "^6.2.2",
45
45
  "fast-check": "^4.5.3",
46
- "libp2p": "^3.1.3",
46
+ "libp2p": "^3.3.11",
47
47
  "mocha": "^11.7.5",
48
48
  "rimraf": "^6.1.3",
49
49
  "ts-node": "^10.9.2",
50
50
  "typescript": "^5.9.3"
51
51
  },
52
52
  "dependencies": {
53
- "@libp2p/logger": "^6.2.2",
54
- "@libp2p/peer-record": "^9.0.5",
55
- "@libp2p/utils": "^7.0.10",
56
- "@multiformats/multiaddr": "^13.0.1",
53
+ "@libp2p/logger": "^6.2.13",
54
+ "@libp2p/peer-record": "^9.0.16",
55
+ "@libp2p/utils": "^7.4.1",
56
+ "@multiformats/multiaddr": "^13.0.3",
57
57
  "digitree": "^1.4.6",
58
- "it-length-prefixed": "^10.0.1",
59
- "multiformats": "^13.4.2",
60
- "uint8-varint": "^2.0.4",
61
- "uint8arraylist": "^2.4.8",
62
- "uint8arrays": "^5.1.0"
58
+ "it-length-prefixed": "^11.0.1",
59
+ "main-event": "^1.0.1",
60
+ "multiformats": "^14.0.5",
61
+ "uint8-varint": "^3.0.0",
62
+ "uint8arraylist": "^3.0.2",
63
+ "uint8arrays": "^6.1.1"
63
64
  }
64
65
  }