@serfab/cadre-core 1.8.0 → 1.10.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 +301 -121
- package/dist/cadre-node.js +588 -244
- package/dist/cadre-node.js.map +1 -1
- package/dist/control-authorization.d.ts +2 -2
- package/dist/control-authorization.js +1 -0
- package/dist/control-authorization.js.map +1 -1
- package/dist/control-cohort.d.ts +1 -1
- package/dist/control-cohort.js +1 -1
- package/dist/control-database.d.ts +105 -14
- package/dist/control-database.js +242 -73
- package/dist/control-database.js.map +1 -1
- package/dist/control-formation-recorder.d.ts +6 -6
- package/dist/control-formation-recorder.js +7 -8
- package/dist/control-formation-recorder.js.map +1 -1
- package/dist/control-schema.d.ts +1 -1
- package/dist/control-schema.js +90 -3
- package/dist/control-schema.js.map +1 -1
- package/dist/control-write-retry.d.ts +21 -15
- package/dist/control-write-retry.js +21 -15
- package/dist/control-write-retry.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +16 -13
- package/dist/index.js.map +1 -1
- package/dist/invitation-bootstrap.d.ts +32 -0
- package/dist/invitation-bootstrap.js +30 -0
- package/dist/invitation-bootstrap.js.map +1 -0
- package/dist/link-budget.d.ts +204 -119
- package/dist/link-budget.js +208 -120
- package/dist/link-budget.js.map +1 -1
- package/dist/membership-connection-gater.d.ts +3 -3
- package/dist/membership-connection-gater.js +3 -3
- package/dist/node-local-snapshot.d.ts +6 -4
- package/dist/node-local-snapshot.js +7 -3
- package/dist/node-local-snapshot.js.map +1 -1
- package/dist/peer-dial.d.ts +18 -14
- package/dist/peer-dial.js +18 -14
- package/dist/peer-dial.js.map +1 -1
- package/dist/peer-join-backfill.d.ts +3 -12
- package/dist/peer-join-backfill.js +2 -3
- package/dist/peer-join-backfill.js.map +1 -1
- package/dist/pending-join-runner.d.ts +186 -0
- package/dist/pending-join-runner.js +649 -0
- package/dist/pending-join-runner.js.map +1 -0
- package/dist/push-fanout.d.ts +1 -1
- package/dist/push-fanout.js +1 -1
- package/dist/seed-bootstrap.d.ts +2 -2
- package/dist/seed-bootstrap.js +1 -1
- package/dist/strand-addr-protocol.js +2 -2
- package/dist/strand-formation-deadlines.d.ts +5 -5
- package/dist/strand-formation-deadlines.js +5 -5
- package/dist/strand-formation-manager.d.ts +18 -4
- package/dist/strand-formation-manager.js +48 -33
- package/dist/strand-formation-manager.js.map +1 -1
- package/dist/strand-formation-protocol.d.ts +71 -25
- package/dist/strand-formation-protocol.js +225 -51
- package/dist/strand-formation-protocol.js.map +1 -1
- package/dist/strand-formation-rejection.d.ts +94 -0
- package/dist/strand-formation-rejection.js +77 -0
- package/dist/strand-formation-rejection.js.map +1 -0
- package/dist/strand-fret-addrs.d.ts +54 -0
- package/dist/strand-fret-addrs.js +108 -0
- package/dist/strand-fret-addrs.js.map +1 -0
- package/dist/strand-instance-manager.d.ts +9 -38
- package/dist/strand-instance-manager.js +17 -74
- package/dist/strand-instance-manager.js.map +1 -1
- package/dist/strand-network-state-file.d.ts +12 -0
- package/dist/strand-network-state-file.js +38 -0
- package/dist/strand-network-state-file.js.map +1 -0
- package/dist/strand-network-state.d.ts +111 -0
- package/dist/strand-network-state.js +191 -0
- package/dist/strand-network-state.js.map +1 -0
- package/dist/strand-solicitation.d.ts +11 -3
- package/dist/strand-solicitation.js +9 -0
- package/dist/strand-solicitation.js.map +1 -1
- package/dist/types.d.ts +123 -40
- package/dist/types.js +5 -9
- package/dist/types.js.map +1 -1
- package/package.json +25 -24
- package/src/cadre-node.ts +637 -251
- package/src/control-authorization.ts +117 -116
- package/src/control-cohort.ts +1 -1
- package/src/control-database.ts +303 -82
- package/src/control-formation-recorder.ts +8 -9
- package/src/control-schema.ts +90 -3
- package/src/control-write-retry.ts +21 -15
- package/src/index.ts +36 -56
- package/src/invitation-bootstrap.ts +40 -0
- package/src/link-budget.ts +221 -120
- package/src/membership-connection-gater.ts +3 -3
- package/src/node-local-snapshot.ts +12 -7
- package/src/peer-dial.ts +18 -14
- package/src/peer-join-backfill.ts +5 -6
- package/src/pending-join-runner.ts +735 -0
- package/src/push-fanout.ts +1 -1
- package/src/seed-bootstrap.ts +2 -2
- package/src/strand-addr-protocol.ts +2 -2
- package/src/strand-formation-deadlines.ts +5 -5
- package/src/strand-formation-manager.ts +62 -37
- package/src/strand-formation-protocol.ts +1036 -803
- package/src/strand-formation-rejection.ts +129 -0
- package/src/strand-fret-addrs.ts +145 -0
- package/src/strand-instance-manager.ts +24 -97
- package/src/strand-network-state-file.ts +40 -0
- package/src/strand-network-state.ts +243 -0
- package/src/strand-solicitation.ts +17 -4
- package/src/types.ts +119 -40
- package/dist/strand-peer-book-file.d.ts +0 -12
- package/dist/strand-peer-book-file.js +0 -37
- package/dist/strand-peer-book-file.js.map +0 -1
- package/dist/strand-peer-book-protocol.d.ts +0 -168
- package/dist/strand-peer-book-protocol.js +0 -356
- package/dist/strand-peer-book-protocol.js.map +0 -1
- package/dist/strand-peer-book-swap.d.ts +0 -104
- package/dist/strand-peer-book-swap.js +0 -284
- package/dist/strand-peer-book-swap.js.map +0 -1
- package/dist/strand-peer-book.d.ts +0 -159
- package/dist/strand-peer-book.js +0 -361
- package/dist/strand-peer-book.js.map +0 -1
- package/dist/strand-peer-observer.d.ts +0 -88
- package/dist/strand-peer-observer.js +0 -180
- package/dist/strand-peer-observer.js.map +0 -1
- package/src/strand-peer-book-file.ts +0 -39
- package/src/strand-peer-book-protocol.ts +0 -466
- package/src/strand-peer-book-swap.ts +0 -338
- package/src/strand-peer-book.ts +0 -475
- package/src/strand-peer-observer.ts +0 -235
package/dist/types.d.ts
CHANGED
|
@@ -11,12 +11,13 @@ import type { SeedTrustPolicy } from './seed-trust-policy.js';
|
|
|
11
11
|
import type { KeyStore, KeyId } from './key-store.js';
|
|
12
12
|
import type { TrustedOwnerStore, TrustSource } from './trusted-owner-store.js';
|
|
13
13
|
import type { BootstrapPeerStore } from './bootstrap-peer-store.js';
|
|
14
|
-
import type {
|
|
14
|
+
import type { StrandNetworkStateStore } from './strand-network-state.js';
|
|
15
15
|
import type { EnrolledMachineStore } from './enrolled-machine-store.js';
|
|
16
16
|
import type { JoinedStrandStore } from './joined-strand-store.js';
|
|
17
17
|
import type { PushNotifier } from './push-notifier.js';
|
|
18
18
|
import type { RevocableTable } from './control-authorization.js';
|
|
19
19
|
import type { ControlRetryAbandonment } from './control-retry.js';
|
|
20
|
+
import type { FormationRejectionCode } from './strand-formation-rejection.js';
|
|
20
21
|
/**
|
|
21
22
|
* Extended Libp2p node with the coordinatedRepo attached by db-p2p's
|
|
22
23
|
* createLibp2pNode after node creation (not surfaced on the base Libp2p type).
|
|
@@ -446,8 +447,9 @@ export interface NetworkConfig {
|
|
|
446
447
|
* reservation drive, the control-cohort dial budgets, and the per-peer cohort read deadline
|
|
447
448
|
* ({@link cohortQueryTimeoutMs}, unless set explicitly). It is also handed to Optimystic
|
|
448
449
|
* (`NodeOptions.linkRoundTripMs`), default included, which derives its own deadlines from it:
|
|
449
|
-
* its request dials and responses, its block pushes, and libp2p's `
|
|
450
|
-
* `inboundUpgradeTimeout` on every node
|
|
450
|
+
* its request dials and responses, its block pushes, and libp2p's `addressDialTimeout`,
|
|
451
|
+
* `dialTimeout` and `inboundUpgradeTimeout` on every node, cadre adding its admission decisions
|
|
452
|
+
* to the three that open a connection. Reaching another machine through a
|
|
451
453
|
* relay costs a fixed number of exchanges, so a deadline written as milliseconds has a link
|
|
452
454
|
* speed above which it can never open a connection — which is the defect this declaration
|
|
453
455
|
* exists to make impossible to reintroduce one budget at a time. The counts, the measurement behind them,
|
|
@@ -464,8 +466,12 @@ export interface NetworkConfig {
|
|
|
464
466
|
* Refused where the libp2p node is built — inside `CadreNode.start()` for the control
|
|
465
467
|
* network, inside `CadreNode.addStrand` for a strand — if it is not a finite number above
|
|
466
468
|
* zero, because every consumer multiplies it into a deadline where a zero means "give up at
|
|
467
|
-
* once" and a `NaN` means "never".
|
|
468
|
-
*
|
|
469
|
+
* once" and a `NaN` means "never". A value above about 10.8 hours is refused in the same place,
|
|
470
|
+
* by Optimystic: the request dial cadre states from it (eleven round trips plus two admission
|
|
471
|
+
* decisions, `optimysticDialLimits` in `link-budget.ts`) then exceeds its
|
|
472
|
+
* `MAX_RPC_DIAL_TIMEOUT_MS` (about 4.97 days), and its error names `rpcDeadlines.dialTimeoutMs`.
|
|
473
|
+
* That is below Optimystic's own `MAX_LINK_ROUND_TRIP_MS` (about 13.3 hours) and far above any
|
|
474
|
+
* real link, so cadre adds no check of its own.
|
|
469
475
|
*/
|
|
470
476
|
linkRoundTripMs?: number;
|
|
471
477
|
/**
|
|
@@ -537,8 +543,8 @@ export interface NetworkConfig {
|
|
|
537
543
|
* so an address that never answers cannot use up the time the peer's other
|
|
538
544
|
* addresses needed. Defaults to
|
|
539
545
|
* {@link DEFAULT_CONTROL_COHORT_PER_ADDRESS_DIAL_TIMEOUT_MS}. A value given
|
|
540
|
-
* here replaces that whole derived budget, including its
|
|
541
|
-
* called machine's admission
|
|
546
|
+
* here replaces that whole derived budget, including its allowances for the
|
|
547
|
+
* relay's and the called machine's admission decisions (`relayedDialBudgetMs`).
|
|
542
548
|
*/
|
|
543
549
|
perAddressDialTimeoutMs?: number;
|
|
544
550
|
/**
|
|
@@ -598,15 +604,11 @@ export interface NetworkConfig {
|
|
|
598
604
|
*
|
|
599
605
|
* WHY THE DEADLINE IS PINNED rather than given room to adapt. `pingTimeout` is an
|
|
600
606
|
* adaptive-timeout init, and equal `minTimeout`/`maxTimeout` clamp it to one value on
|
|
601
|
-
* every libp2p version.
|
|
602
|
-
*
|
|
603
|
-
*
|
|
604
|
-
*
|
|
605
|
-
*
|
|
606
|
-
* the overlapping-ping abort above straight back. Pinning both ends keeps the interval's
|
|
607
|
-
* margin true on the version bump instead of making it something to remember. It also
|
|
608
|
-
* sidesteps 3.3's other surprise: the monitor keeps one `AdaptiveTimeout` for all of a
|
|
609
|
-
* node's connections, so one slow peer would otherwise lengthen the deadline for every
|
|
607
|
+
* every libp2p version. libp2p 3.3 reports each ping's duration back to the monitor's
|
|
608
|
+
* `AdaptiveTimeout`, so a ceiling above `pingInterval` would let the deadline grow past the
|
|
609
|
+
* interval and put the overlapping-ping abort above straight back. Pinning both ends keeps
|
|
610
|
+
* the interval's margin true. It also sidesteps the monitor keeping one `AdaptiveTimeout`
|
|
611
|
+
* for all of a node's connections, so one slow peer cannot lengthen the deadline for every
|
|
610
612
|
* connection on that node.
|
|
611
613
|
*/
|
|
612
614
|
export declare const DEFAULT_CONNECTION_MONITOR: Readonly<{
|
|
@@ -955,32 +957,29 @@ export interface CadreNodeConfig {
|
|
|
955
957
|
store?: JoinedStrandStore;
|
|
956
958
|
};
|
|
957
959
|
/**
|
|
958
|
-
* Node-local strand
|
|
959
|
-
*
|
|
960
|
-
*
|
|
961
|
-
*
|
|
962
|
-
*
|
|
963
|
-
*
|
|
964
|
-
*
|
|
965
|
-
*
|
|
966
|
-
*
|
|
967
|
-
*
|
|
968
|
-
*
|
|
969
|
-
*
|
|
970
|
-
*
|
|
971
|
-
*
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
* `DurableSlot` and inject `PersistentStrandPeerBookStore.open(slot, partyId)`.
|
|
975
|
-
*/
|
|
976
|
-
strandPeers?: {
|
|
960
|
+
* Node-local strand network state (see `strand-network-state.ts`): per strand, the
|
|
961
|
+
* state Optimystic's db-p2p saves for the strand's libp2p node — its FRET routing
|
|
962
|
+
* table, each entry carrying the peer's signed address record. A strand node reads
|
|
963
|
+
* it back when it is built and re-imports the table, so a restarted machine already
|
|
964
|
+
* holds addresses for the strand peers it was talking to (gotchoices/sereus#18).
|
|
965
|
+
* Sibling of {@link bootstrapPeers} — same NON-replicated, per-party,
|
|
966
|
+
* injected-backend shape — and, like it, nothing here is trust-bearing: FRET
|
|
967
|
+
* verifies every record at import.
|
|
968
|
+
*
|
|
969
|
+
* Absent ⇒ an in-memory store is created at start() (ephemeral: a restarted process
|
|
970
|
+
* starts every strand with an empty routing table). Every reference embedder
|
|
971
|
+
* injects a durable backend over the same slot kind as its bootstrap-peer store. A
|
|
972
|
+
* new platform needs no new store class: supply a `DurableSlot` and inject
|
|
973
|
+
* `PersistentStrandNetworkStateStore.open(slot, partyId)`.
|
|
974
|
+
*/
|
|
975
|
+
strandNetworkState?: {
|
|
977
976
|
/**
|
|
978
|
-
* Injected store instance — e.g. a `
|
|
979
|
-
* Node-only subpath `@serfab/cadre-core/strand-
|
|
977
|
+
* Injected store instance — e.g. a `FileStrandNetworkStateStore` from the
|
|
978
|
+
* Node-only subpath `@serfab/cadre-core/strand-network-state-file`, persisted in
|
|
980
979
|
* the node's state directory. Its `partyId` must match
|
|
981
980
|
* `controlNetwork.partyId`; start() fails closed on a mismatch.
|
|
982
981
|
*/
|
|
983
|
-
store?:
|
|
982
|
+
store?: StrandNetworkStateStore;
|
|
984
983
|
};
|
|
985
984
|
/**
|
|
986
985
|
* Platform push-delivery for suspended mobile peers. When present, the node's
|
|
@@ -1105,6 +1104,73 @@ export interface StrandRow {
|
|
|
1105
1104
|
*/
|
|
1106
1105
|
FounderOwnerKey: string | null;
|
|
1107
1106
|
}
|
|
1107
|
+
/**
|
|
1108
|
+
* A `CadreControl.PendingJoin` row: a join this party asked for through another party's
|
|
1109
|
+
* invitation, readable by every machine of the party. Each outcome carries only its own
|
|
1110
|
+
* columns (the schema's `OutcomeShape` check): `'joined'` sets `StrandId` (and, for a
|
|
1111
|
+
* closed strand, `MembershipInvite`), `'failed'` sets `FailureCode`, and a pending row
|
|
1112
|
+
* (`Outcome: null`) sets neither.
|
|
1113
|
+
*/
|
|
1114
|
+
export interface PendingJoinRow {
|
|
1115
|
+
/** base64url sha256 of the invitation token (`pendingJoinId`). */
|
|
1116
|
+
Id: string;
|
|
1117
|
+
/** `CadreNode.encodeInvitation` of the invitation. A bearer credential. */
|
|
1118
|
+
Invitation: string;
|
|
1119
|
+
/** `canonicalJson` of the disclosure the requester gave. */
|
|
1120
|
+
Disclosure: string;
|
|
1121
|
+
/** Epoch ms. */
|
|
1122
|
+
RequestedAt: number;
|
|
1123
|
+
/** Epoch ms; no attempt starts at or after it. */
|
|
1124
|
+
ExpiresAt: number;
|
|
1125
|
+
Outcome: null | 'joined' | 'failed';
|
|
1126
|
+
/** Epoch ms the outcome was recorded; null while pending. */
|
|
1127
|
+
OutcomeAt: number | null;
|
|
1128
|
+
/** `'joined'`: the strand the formation returned. */
|
|
1129
|
+
StrandId: string | null;
|
|
1130
|
+
/** `'joined'`, closed strand: JSON of the {@link StrandMembershipInvite} the formation delivered. */
|
|
1131
|
+
MembershipInvite: string | null;
|
|
1132
|
+
/** `'failed'`: a `FormationRejectionCode`, `'expired'` or `'local'`. Not constrained by the schema. */
|
|
1133
|
+
FailureCode: string | null;
|
|
1134
|
+
/** `'failed'`: human-readable text. */
|
|
1135
|
+
FailureReason: string | null;
|
|
1136
|
+
/** Single-use nonce of this row incarnation; `ControlDatabase.replacePendingJoin` names it as the row it replaces. */
|
|
1137
|
+
StampId: string;
|
|
1138
|
+
}
|
|
1139
|
+
/**
|
|
1140
|
+
* A join this party asked for through `CadreNode.requestJoin`, as one machine sees it.
|
|
1141
|
+
*
|
|
1142
|
+
* `pending`, `joined` and `failed` come from the party-wide `PendingJoin` row and read the same
|
|
1143
|
+
* on every machine. `trying` (an attempt is running on this machine) and `waiting` (this
|
|
1144
|
+
* machine's last attempt failed in a way worth retrying) are this machine's own view of a
|
|
1145
|
+
* pending row, so two machines can report different states for it.
|
|
1146
|
+
*/
|
|
1147
|
+
export interface PendingJoinStatus {
|
|
1148
|
+
/** `PendingJoin.Id`: the sha256 of the invitation token. */
|
|
1149
|
+
id: string;
|
|
1150
|
+
sAppId: string;
|
|
1151
|
+
/** Epoch ms. */
|
|
1152
|
+
requestedAt: number;
|
|
1153
|
+
/** Epoch ms; no attempt starts at or after it. */
|
|
1154
|
+
expiresAt: number;
|
|
1155
|
+
state: 'pending' | 'trying' | 'waiting' | 'joined' | 'failed';
|
|
1156
|
+
/** `'waiting'`: when this machine tries again, epoch ms. */
|
|
1157
|
+
nextAttemptAt?: number;
|
|
1158
|
+
/**
|
|
1159
|
+
* `'waiting'`: why this machine's last attempt failed. `'unreachable'` means no answer came
|
|
1160
|
+
* back; `'local'` means the attempt failed on this machine before an answer.
|
|
1161
|
+
*/
|
|
1162
|
+
lastError?: {
|
|
1163
|
+
code: FormationRejectionCode | 'unrecognized' | 'unreachable' | 'local';
|
|
1164
|
+
reason: string;
|
|
1165
|
+
};
|
|
1166
|
+
/** `'joined'`: the strand the join produced. */
|
|
1167
|
+
strandId?: string;
|
|
1168
|
+
/** `'failed'`: a `FormationRejectionCode`, `'expired'`, or `'local'` (approved, then a step on the joining machine failed). */
|
|
1169
|
+
failure?: {
|
|
1170
|
+
code: string;
|
|
1171
|
+
reason: string;
|
|
1172
|
+
};
|
|
1173
|
+
}
|
|
1108
1174
|
/**
|
|
1109
1175
|
* sApp configuration provided by the hosting application when creating a strand.
|
|
1110
1176
|
* This is what the app developer provides - NOT loaded from the network.
|
|
@@ -1266,7 +1332,13 @@ export interface OpenInvitation {
|
|
|
1266
1332
|
sAppId: string;
|
|
1267
1333
|
/** When this invitation expires */
|
|
1268
1334
|
expiration: Date;
|
|
1269
|
-
/**
|
|
1335
|
+
/**
|
|
1336
|
+
* Addresses of the inviting party's machines, each ending in `/p2p/<peerId>`: the minting
|
|
1337
|
+
* machine's own first, then up to three of its siblings with up to four addresses each
|
|
1338
|
+
* (`CadreNode.createOpenInvitation`). A joiner tries the machines in order, one formation
|
|
1339
|
+
* session each, so an entry may be dead by the time it is used; one that names no machine
|
|
1340
|
+
* is ignored.
|
|
1341
|
+
*/
|
|
1270
1342
|
bootstrap: string[];
|
|
1271
1343
|
}
|
|
1272
1344
|
/**
|
|
@@ -1285,7 +1357,11 @@ export interface StrandMembershipInvite {
|
|
|
1285
1357
|
* The invite ed25519 PRIVATE seed (base64url). A single-use bearer credential:
|
|
1286
1358
|
* whoever holds it can `consumeInvite` exactly once. Same sensitivity class and
|
|
1287
1359
|
* handling as `memberPrivateKey` — delivered only inside the validated,
|
|
1288
|
-
* post-approval formation result
|
|
1360
|
+
* post-approval formation result. The inviting side never writes it to its control
|
|
1361
|
+
* DB. The joining side may copy it into its own `PendingJoin` row
|
|
1362
|
+
* (`MembershipInvite`), owner-signed and party-private like
|
|
1363
|
+
* `JoinedStrand.MemberPrivateKey`, so a join finished on one machine of the party
|
|
1364
|
+
* can be seated by whichever machine launches the strand first.
|
|
1289
1365
|
*/
|
|
1290
1366
|
invitePrivateKey: string;
|
|
1291
1367
|
}
|
|
@@ -1510,6 +1586,13 @@ export interface CadreNodeEvents {
|
|
|
1510
1586
|
* or connection state change.
|
|
1511
1587
|
*/
|
|
1512
1588
|
'control:write-abandoned': ControlRetryAbandonment;
|
|
1589
|
+
/**
|
|
1590
|
+
* Emitted when this machine's view of a join asked for with `CadreNode.requestJoin` changes:
|
|
1591
|
+
* its own attempt started or ended, or a pass read an outcome another owner machine wrote.
|
|
1592
|
+
* Owner machines only, since only they run the retry loop. A dismissed join emits nothing
|
|
1593
|
+
* further; `listPendingJoins` no longer names it.
|
|
1594
|
+
*/
|
|
1595
|
+
'pendingJoin:changed': PendingJoinStatus;
|
|
1513
1596
|
/** Emitted when a seed is received via the seed protocol */
|
|
1514
1597
|
'seed:received': {
|
|
1515
1598
|
partyId: string;
|
package/dist/types.js
CHANGED
|
@@ -80,15 +80,11 @@ export const HIBERNATION_TIMEOUTS = {
|
|
|
80
80
|
*
|
|
81
81
|
* WHY THE DEADLINE IS PINNED rather than given room to adapt. `pingTimeout` is an
|
|
82
82
|
* adaptive-timeout init, and equal `minTimeout`/`maxTimeout` clamp it to one value on
|
|
83
|
-
* every libp2p version.
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* the overlapping-ping abort above straight back. Pinning both ends keeps the interval's
|
|
89
|
-
* margin true on the version bump instead of making it something to remember. It also
|
|
90
|
-
* sidesteps 3.3's other surprise: the monitor keeps one `AdaptiveTimeout` for all of a
|
|
91
|
-
* node's connections, so one slow peer would otherwise lengthen the deadline for every
|
|
83
|
+
* every libp2p version. libp2p 3.3 reports each ping's duration back to the monitor's
|
|
84
|
+
* `AdaptiveTimeout`, so a ceiling above `pingInterval` would let the deadline grow past the
|
|
85
|
+
* interval and put the overlapping-ping abort above straight back. Pinning both ends keeps
|
|
86
|
+
* the interval's margin true. It also sidesteps the monitor keeping one `AdaptiveTimeout`
|
|
87
|
+
* for all of a node's connections, so one slow peer cannot lengthen the deadline for every
|
|
92
88
|
* connection on that node.
|
|
93
89
|
*/
|
|
94
90
|
export const DEFAULT_CONNECTION_MONITOR = Object.freeze({
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAoFA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAA6C;IAC5E,QAAQ,EAAE;QACR,WAAW,EAAE,QAAQ,EAAS,aAAa;QAC3C,gBAAgB,EAAE,QAAQ,EAAI,kBAAkB;QAChD,eAAe,EAAE,QAAQ,EAAK,MAAM;QACpC,oBAAoB,EAAE,CAAC;QACvB,kBAAkB,EAAE,QAAQ,CAAE,MAAM;KACrC;IACD,WAAW,EAAE;QACX,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAI,YAAY;QAC1C,gBAAgB,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,wBAAwB;QAC1D,eAAe,EAAE,EAAE,GAAG,IAAI,EAAI,mBAAmB;QACjD,oBAAoB,EAAE,CAAC;QACvB,kBAAkB,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,eAAe;KACnD;IACD,UAAU,EAAE;QACV,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAI,WAAW;QACzC,gBAAgB,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAG,uBAAuB;QACzD,eAAe,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAI,kBAAkB;QACpD,oBAAoB,EAAE,CAAC;QACvB,kBAAkB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,gBAAgB;KACxD;IACD,OAAO,EAAE;QACP,WAAW,EAAE,EAAE,GAAG,IAAI,EAAQ,aAAa;QAC3C,gBAAgB,EAAE,EAAE,GAAG,IAAI,EAAG,wBAAwB;QACtD,eAAe,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAG,eAAe;QACjD,oBAAoB,EAAE,CAAC;QACvB,kBAAkB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,eAAe;KAC5D;CACF,CAAC;AA0dF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAAC;IACtD,uFAAuF;IACvF,mFAAmF;IACnF,YAAY,EAAE,KAAM;IACpB,kFAAkF;IAClF,kFAAkF;IAClF,mBAAmB;IACnB,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,KAAM,EAAE,UAAU,EAAE,KAAM,EAAE,CAAC;CACjC,CAAC,CAAC;AAmBzC;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,GAAG,IAAI,CAAC;AAYnD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,2BAA2B,EAC3B,sBAAsB,EACtB,2BAA2B,EAC3B,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,+BAA+B,CAAC;AAEvC;;;;;GAKG;AACH,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serfab/cadre-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Core library for Sereus cadre nodes - manages control networks and strand participation",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"types": "./dist/enrolled-machine-store-file.d.ts",
|
|
37
37
|
"import": "./dist/enrolled-machine-store-file.js"
|
|
38
38
|
},
|
|
39
|
-
"./strand-
|
|
40
|
-
"types": "./dist/strand-
|
|
41
|
-
"import": "./dist/strand-
|
|
39
|
+
"./strand-network-state-file": {
|
|
40
|
+
"types": "./dist/strand-network-state-file.d.ts",
|
|
41
|
+
"import": "./dist/strand-network-state-file.js"
|
|
42
42
|
},
|
|
43
43
|
"./push-node": {
|
|
44
44
|
"types": "./dist/push-node.d.ts",
|
|
@@ -70,36 +70,37 @@
|
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@chainsafe/libp2p-noise": "^17.0.0",
|
|
72
72
|
"@chainsafe/libp2p-yamux": "^8.0.1",
|
|
73
|
-
"@libp2p/circuit-relay-v2": "^4.
|
|
74
|
-
"@libp2p/identify": "4.
|
|
75
|
-
"@libp2p/logger": "^6.2.
|
|
76
|
-
"@libp2p/peer-store": "^12.0.
|
|
77
|
-
"@libp2p/tcp": "^11.0.
|
|
78
|
-
"@libp2p/webrtc": "6.0.
|
|
79
|
-
"@libp2p/websockets": "^10.1.
|
|
80
|
-
"@optimystic/db-p2p-storage-fs": "^1.
|
|
73
|
+
"@libp2p/circuit-relay-v2": "^4.2.13",
|
|
74
|
+
"@libp2p/identify": "4.1.14",
|
|
75
|
+
"@libp2p/logger": "^6.2.13",
|
|
76
|
+
"@libp2p/peer-store": "^12.0.28",
|
|
77
|
+
"@libp2p/tcp": "^11.0.28",
|
|
78
|
+
"@libp2p/webrtc": "6.0.33",
|
|
79
|
+
"@libp2p/websockets": "^10.1.21",
|
|
80
|
+
"@optimystic/db-p2p-storage-fs": "^1.9.0",
|
|
81
81
|
"@types/debug": "^4.1.12",
|
|
82
82
|
"@types/node": "^25.0.10",
|
|
83
83
|
"@vitest/coverage-v8": "^4.0.17",
|
|
84
|
-
"datastore-core": "^
|
|
84
|
+
"datastore-core": "^12.0.1",
|
|
85
85
|
"main-event": "^1.0.1",
|
|
86
86
|
"rimraf": "^6.1.2",
|
|
87
87
|
"typescript": "^5.9.3",
|
|
88
88
|
"vitest": "^4.0.17"
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {
|
|
91
|
-
"@libp2p/crypto": "^5.1.
|
|
92
|
-
"@libp2p/interface": "^3.
|
|
93
|
-
"@libp2p/peer-id": "^6.0.
|
|
94
|
-
"@
|
|
95
|
-
"@
|
|
96
|
-
"@optimystic/db-
|
|
97
|
-
"@optimystic/
|
|
98
|
-
"@optimystic/quereus-plugin-
|
|
91
|
+
"@libp2p/crypto": "^5.1.23",
|
|
92
|
+
"@libp2p/interface": "^3.3.0",
|
|
93
|
+
"@libp2p/peer-id": "^6.0.15",
|
|
94
|
+
"@libp2p/peer-record": "^9.0.16",
|
|
95
|
+
"@multiformats/multiaddr": "^13.0.3",
|
|
96
|
+
"@optimystic/db-core": "^1.9.0",
|
|
97
|
+
"@optimystic/db-p2p": "^1.9.0",
|
|
98
|
+
"@optimystic/quereus-plugin-crypto": "^1.9.0",
|
|
99
|
+
"@optimystic/quereus-plugin-optimystic": "^1.9.0",
|
|
99
100
|
"@quereus/quereus": "^4.20.0",
|
|
100
|
-
"@serfab/quereus-plugin-sereus": "^1.
|
|
101
|
+
"@serfab/quereus-plugin-sereus": "^1.10.0",
|
|
101
102
|
"debug": "^4.4.3",
|
|
102
|
-
"libp2p": "^3.
|
|
103
|
-
"uint8arrays": "^
|
|
103
|
+
"libp2p": "^3.3.11",
|
|
104
|
+
"uint8arrays": "^6.1.1"
|
|
104
105
|
}
|
|
105
106
|
}
|