@serfab/cadre-core 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/announce-addrs.d.ts +49 -0
- package/dist/announce-addrs.js +78 -0
- package/dist/announce-addrs.js.map +1 -0
- package/dist/cadre-node.d.ts +281 -30
- package/dist/cadre-node.js +513 -103
- package/dist/cadre-node.js.map +1 -1
- package/dist/control-database.d.ts +155 -23
- package/dist/control-database.js +272 -104
- package/dist/control-database.js.map +1 -1
- package/dist/control-read-retry.d.ts +103 -0
- package/dist/control-read-retry.js +145 -0
- package/dist/control-read-retry.js.map +1 -0
- package/dist/control-retry.d.ts +101 -0
- package/dist/control-retry.js +108 -0
- package/dist/control-retry.js.map +1 -0
- package/dist/control-schema.d.ts +1 -1
- package/dist/control-schema.js +20 -4
- package/dist/control-schema.js.map +1 -1
- package/dist/control-write-retry.d.ts +59 -35
- package/dist/control-write-retry.js +21 -92
- package/dist/control-write-retry.js.map +1 -1
- package/dist/delegate-admission.d.ts +17 -15
- package/dist/delegate-admission.js +17 -15
- package/dist/delegate-admission.js.map +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.js +17 -8
- package/dist/index.js.map +1 -1
- package/dist/membership-connection-gater.d.ts +211 -25
- package/dist/membership-connection-gater.js +309 -29
- package/dist/membership-connection-gater.js.map +1 -1
- package/dist/peer-record.d.ts +26 -0
- package/dist/peer-record.js +32 -0
- package/dist/peer-record.js.map +1 -1
- package/dist/relay-addrs.d.ts +76 -26
- package/dist/relay-addrs.js +115 -27
- package/dist/relay-addrs.js.map +1 -1
- package/dist/relay-reservation.d.ts +20 -15
- package/dist/relay-reservation.js +18 -14
- package/dist/relay-reservation.js.map +1 -1
- package/dist/strand-addr-protocol.js +16 -0
- package/dist/strand-addr-protocol.js.map +1 -1
- package/dist/strand-backfill.js +13 -4
- package/dist/strand-backfill.js.map +1 -1
- package/dist/strand-formation-manager.d.ts +10 -9
- package/dist/strand-formation-manager.js +10 -9
- package/dist/strand-formation-manager.js.map +1 -1
- package/dist/strand-formation-protocol.d.ts +7 -7
- package/dist/strand-formation-protocol.js +8 -8
- package/dist/strand-formation-protocol.js.map +1 -1
- package/dist/strand-instance-manager.d.ts +4 -3
- package/dist/strand-instance-manager.js +31 -6
- package/dist/strand-instance-manager.js.map +1 -1
- package/dist/strand-membership-writer.d.ts +106 -14
- package/dist/strand-membership-writer.js +180 -14
- package/dist/strand-membership-writer.js.map +1 -1
- package/dist/strand-solicitation.d.ts +3 -3
- package/dist/strand-solicitation.js +4 -5
- package/dist/strand-solicitation.js.map +1 -1
- package/dist/strand-wake-protocol.d.ts +47 -2
- package/dist/strand-wake-protocol.js +76 -6
- package/dist/strand-wake-protocol.js.map +1 -1
- package/dist/types.d.ts +74 -29
- package/dist/types.js.map +1 -1
- package/package.json +8 -8
- package/src/announce-addrs.ts +93 -0
- package/src/cadre-node.ts +5603 -5158
- package/src/control-database.ts +2584 -2406
- package/src/control-read-retry.ts +167 -0
- package/src/control-retry.ts +190 -0
- package/src/control-schema.ts +20 -4
- package/src/control-write-retry.ts +30 -130
- package/src/delegate-admission.ts +17 -15
- package/src/index.ts +435 -407
- package/src/membership-connection-gater.ts +533 -204
- package/src/peer-record.ts +33 -0
- package/src/relay-addrs.ts +218 -111
- package/src/relay-reservation.ts +828 -823
- package/src/strand-addr-protocol.ts +17 -0
- package/src/strand-backfill.ts +389 -366
- package/src/strand-formation-manager.ts +492 -491
- package/src/strand-formation-protocol.ts +8 -8
- package/src/strand-instance-manager.ts +636 -611
- package/src/strand-membership-writer.ts +209 -14
- package/src/strand-solicitation.ts +6 -7
- package/src/strand-wake-protocol.ts +94 -8
- package/src/types.ts +74 -29
|
@@ -347,6 +347,18 @@ export async function collectStrandAddrs(
|
|
|
347
347
|
* failure. Tries each dial target in order (peerId first to reuse an open control
|
|
348
348
|
* connection, then explicit addrs) until one answers; a total failure is logged
|
|
349
349
|
* and folded to `[]` so a single dead sibling never aborts the collection.
|
|
350
|
+
*
|
|
351
|
+
* A total failure logs ONE line naming every target and its cause. `[]` alone
|
|
352
|
+
* cannot tell the caller "this sibling was unreachable" apart from "this sibling
|
|
353
|
+
* answered and has no strand address" — and per-target lines scattered through a
|
|
354
|
+
* concurrent fan-out do not reassemble into that answer either. The return
|
|
355
|
+
* contract is unchanged: best-effort `[]`, never a throw.
|
|
356
|
+
*
|
|
357
|
+
* NOTE: cost is (targets × `timeoutMs`) with no whole-sibling budget, the same
|
|
358
|
+
* shape `dialWake` bounds with `DEFAULT_WAKE_DIAL_BUDGET_MS`. Fine today —
|
|
359
|
+
* `dialTargets` yields the peerId plus whatever `resolvePeerAddrs` returned,
|
|
360
|
+
* which for a cadre device is one or two addresses. If a sibling's record ever
|
|
361
|
+
* carries a long address list, give this the same whole-sibling budget.
|
|
350
362
|
*/
|
|
351
363
|
async function dialOneSibling(
|
|
352
364
|
node: Libp2p,
|
|
@@ -363,6 +375,7 @@ async function dialOneSibling(
|
|
|
363
375
|
return [];
|
|
364
376
|
}
|
|
365
377
|
|
|
378
|
+
const failures: string[] = [];
|
|
366
379
|
for (const target of targets) {
|
|
367
380
|
try {
|
|
368
381
|
// One deadline per attempt: its signal aborts the in-flight dialProtocol and
|
|
@@ -374,9 +387,13 @@ async function dialOneSibling(
|
|
|
374
387
|
);
|
|
375
388
|
return response.multiaddrs;
|
|
376
389
|
} catch (err) {
|
|
390
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
391
|
+
failures.push(`${describeTarget(target)} — ${error.message}`);
|
|
377
392
|
log('Strand-addr dial to %s via %s failed: %o', peer.peerId, describeTarget(target), err);
|
|
378
393
|
}
|
|
379
394
|
}
|
|
395
|
+
log('Strand-addr dial to %s failed on all %d target(s), contributing no addrs: %s',
|
|
396
|
+
peer.peerId, failures.length, failures.join('; '));
|
|
380
397
|
return [];
|
|
381
398
|
}
|
|
382
399
|
|