@serfab/cadre-core 1.5.0 → 1.6.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/cadre-node.d.ts +2 -2
- package/dist/cadre-node.js +7 -3
- package/dist/cadre-node.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/link-budget.d.ts +95 -53
- package/dist/link-budget.js +97 -53
- package/dist/link-budget.js.map +1 -1
- package/dist/peer-dial.d.ts +3 -3
- package/dist/peer-dial.js +3 -3
- package/dist/peer-join-backfill.d.ts +2 -2
- package/dist/peer-join-backfill.js +8 -7
- package/dist/peer-join-backfill.js.map +1 -1
- package/dist/relay-reservation.d.ts +2 -2
- package/dist/relay-reservation.js +2 -2
- package/dist/seed-bootstrap.js +1 -1
- package/dist/strand-first-sync-gate.d.ts +88 -43
- package/dist/strand-first-sync-gate.js +92 -46
- package/dist/strand-first-sync-gate.js.map +1 -1
- package/dist/strand-instance-manager.js +6 -2
- package/dist/strand-instance-manager.js.map +1 -1
- package/dist/types.d.ts +26 -17
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -1
- package/package.json +7 -7
- package/src/cadre-node.ts +7 -3
- package/src/index.ts +1 -0
- package/src/link-budget.ts +100 -53
- package/src/peer-dial.ts +3 -3
- package/src/peer-join-backfill.ts +648 -647
- package/src/relay-reservation.ts +2 -2
- package/src/seed-bootstrap.ts +1 -1
- package/src/strand-first-sync-gate.ts +352 -306
- package/src/strand-instance-manager.ts +6 -2
- package/src/types.ts +26 -17
package/dist/cadre-node.d.ts
CHANGED
|
@@ -2390,7 +2390,7 @@ export declare class CadreNode implements SAppIdLookup {
|
|
|
2390
2390
|
* NOTE: against a relay that is DOWN this hook costs up to two strand-addr
|
|
2391
2391
|
* timeouts (10 s each: dial by peer id, then by addr) before the reservation drive even
|
|
2392
2392
|
* starts, so one failed re-drive holds the supervisor `driving` for those 20 s plus the
|
|
2393
|
-
* drive's own deadline —
|
|
2393
|
+
* drive's own deadline — 34 s at the default declared link round trip, and longer on a host
|
|
2394
2394
|
* that declared a slower one (`link-budget.ts`).
|
|
2395
2395
|
* Bounded and harmless while the relay is unreachable anyway; if recovery
|
|
2396
2396
|
* latency after a relay comes back ever matters, skip the announce when the
|
|
@@ -2613,7 +2613,7 @@ export declare class CadreNode implements SAppIdLookup {
|
|
|
2613
2613
|
*
|
|
2614
2614
|
* BUDGET: the supervisor's first attempt is what `start()` waits on — deliberately the drive's
|
|
2615
2615
|
* ordinary deadline rather than a boot-specific one. That deadline is now COUNTED, four link
|
|
2616
|
-
* round trips at the declared `network.linkRoundTripMs` (
|
|
2616
|
+
* round trips at the declared `network.linkRoundTripMs` (14 s at its default, where it was a
|
|
2617
2617
|
* fixed 10 s): a healthy dial-plus-reserve is sub-second even over a WAN, so this is slack for
|
|
2618
2618
|
* a slow link, while going much longer would make a dead relay indistinguishable from a hung
|
|
2619
2619
|
* start and much shorter would fail nodes on links that were merely slow. A host that declares
|
package/dist/cadre-node.js
CHANGED
|
@@ -28,7 +28,7 @@ import { PeerJoinBackfill } from './peer-join-backfill.js';
|
|
|
28
28
|
import { deriveCohortMembers } from './strand-cohort.js';
|
|
29
29
|
import { selectControlCohortDials, DEFAULT_CONTROL_COHORT_RECONCILE_MS, DEFAULT_CONTROL_COHORT_TARGET_DEGREE } from './control-cohort.js';
|
|
30
30
|
import { dialPeerAddrs, CONTROL_COHORT_DIAL_ADDRESS_ATTEMPTS } from './peer-dial.js';
|
|
31
|
-
import { peerJoinPushBudget, relayReservationBudgetMs, relayedDialBudgetMs, resolveLinkRoundTripMs } from './link-budget.js';
|
|
31
|
+
import { connectionManagerTimeouts, peerJoinPushBudget, relayReservationBudgetMs, relayedDialBudgetMs, resolveLinkRoundTripMs } from './link-budget.js';
|
|
32
32
|
import { EnrollmentService } from './enrollment.js';
|
|
33
33
|
import { HibernationManager } from './hibernation-manager.js';
|
|
34
34
|
import { ControlDatabase, isStrandIdConflict } from './control-database.js';
|
|
@@ -1425,6 +1425,10 @@ export class CadreNode {
|
|
|
1425
1425
|
// whose event loop is saturated by pure-JS Noise crypto. A configured value
|
|
1426
1426
|
// replaces the default whole (see DEFAULT_CONNECTION_MONITOR).
|
|
1427
1427
|
connectionMonitor: network?.connectionMonitor ?? DEFAULT_CONNECTION_MONITOR,
|
|
1428
|
+
// libp2p's own dial and inbound-upgrade limits, from the same declared link as every
|
|
1429
|
+
// cadre dial budget. Left to db-p2p, both stay at 10 s, which cannot open a relayed
|
|
1430
|
+
// connection above a 2.5 s round trip — and the listener's side of that fails silently.
|
|
1431
|
+
connectionManager: connectionManagerTimeouts(network?.linkRoundTripMs),
|
|
1428
1432
|
// `{ wsPort }` when a listen entry names WebSocket, otherwise `{}` — and always
|
|
1429
1433
|
// `{}` when `network.transports` is set, since the embedder owns transport policy
|
|
1430
1434
|
// then. Spread NEXT to `transports` because the two answer the same question.
|
|
@@ -5176,7 +5180,7 @@ export class CadreNode {
|
|
|
5176
5180
|
* NOTE: against a relay that is DOWN this hook costs up to two strand-addr
|
|
5177
5181
|
* timeouts (10 s each: dial by peer id, then by addr) before the reservation drive even
|
|
5178
5182
|
* starts, so one failed re-drive holds the supervisor `driving` for those 20 s plus the
|
|
5179
|
-
* drive's own deadline —
|
|
5183
|
+
* drive's own deadline — 34 s at the default declared link round trip, and longer on a host
|
|
5180
5184
|
* that declared a slower one (`link-budget.ts`).
|
|
5181
5185
|
* Bounded and harmless while the relay is unreachable anyway; if recovery
|
|
5182
5186
|
* latency after a relay comes back ever matters, skip the announce when the
|
|
@@ -5677,7 +5681,7 @@ export class CadreNode {
|
|
|
5677
5681
|
*
|
|
5678
5682
|
* BUDGET: the supervisor's first attempt is what `start()` waits on — deliberately the drive's
|
|
5679
5683
|
* ordinary deadline rather than a boot-specific one. That deadline is now COUNTED, four link
|
|
5680
|
-
* round trips at the declared `network.linkRoundTripMs` (
|
|
5684
|
+
* round trips at the declared `network.linkRoundTripMs` (14 s at its default, where it was a
|
|
5681
5685
|
* fixed 10 s): a healthy dial-plus-reserve is sub-second even over a WAN, so this is slack for
|
|
5682
5686
|
* a slow link, while going much longer would make a dead relay indistinguishable from a hung
|
|
5683
5687
|
* start and much shorter would fail nodes on links that were merely slow. A host that declares
|