@serfab/cadre-core 1.21.0 → 1.23.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/README.md +294 -294
- package/dist/cadre-node.d.ts +334 -53
- package/dist/cadre-node.js +794 -85
- package/dist/cadre-node.js.map +1 -1
- package/dist/control-authorization.d.ts +32 -2
- package/dist/control-authorization.js +19 -0
- package/dist/control-authorization.js.map +1 -1
- package/dist/control-database.d.ts +236 -23
- package/dist/control-database.js +587 -173
- package/dist/control-database.js.map +1 -1
- package/dist/control-schema.d.ts +3 -3
- package/dist/control-schema.js +71 -7
- package/dist/control-schema.js.map +1 -1
- package/dist/ed25519-key.d.ts +8 -0
- package/dist/ed25519-key.js +11 -1
- package/dist/ed25519-key.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/machine-removal.d.ts +51 -1
- package/dist/machine-removal.js +42 -1
- package/dist/machine-removal.js.map +1 -1
- package/dist/membership-connection-gater.d.ts +8 -0
- package/dist/membership-connection-gater.js +13 -1
- package/dist/membership-connection-gater.js.map +1 -1
- package/dist/membership-view.js +4 -1
- package/dist/membership-view.js.map +1 -1
- package/dist/owner-keys.js +2 -1
- package/dist/owner-keys.js.map +1 -1
- package/dist/owner-signer.js +3 -4
- package/dist/owner-signer.js.map +1 -1
- package/dist/peer-authorization.d.ts +14 -2
- package/dist/peer-authorization.js +24 -1
- package/dist/peer-authorization.js.map +1 -1
- package/dist/sealed-party-key.d.ts +32 -0
- package/dist/sealed-party-key.js +162 -0
- package/dist/sealed-party-key.js.map +1 -0
- package/dist/seed-bootstrap.d.ts +10 -3
- package/dist/seed-bootstrap.js +12 -0
- package/dist/seed-bootstrap.js.map +1 -1
- package/dist/strand-addr-protocol.d.ts +56 -6
- package/dist/strand-addr-protocol.js +57 -5
- package/dist/strand-addr-protocol.js.map +1 -1
- package/dist/strand-commit-durability.d.ts +33 -2
- package/dist/strand-commit-durability.js +44 -4
- package/dist/strand-commit-durability.js.map +1 -1
- package/dist/strand-database.d.ts +35 -5
- package/dist/strand-database.js +34 -10
- package/dist/strand-database.js.map +1 -1
- package/dist/strand-instance-manager.d.ts +200 -18
- package/dist/strand-instance-manager.js +434 -64
- package/dist/strand-instance-manager.js.map +1 -1
- package/dist/strand-membership-reconciler.d.ts +250 -51
- package/dist/strand-membership-reconciler.js +410 -66
- package/dist/strand-membership-reconciler.js.map +1 -1
- package/dist/strand-membership-writer.d.ts +7 -0
- package/dist/strand-membership-writer.js +9 -0
- package/dist/strand-membership-writer.js.map +1 -1
- package/dist/strand-party-key-rotation.d.ts +177 -0
- package/dist/strand-party-key-rotation.js +340 -0
- package/dist/strand-party-key-rotation.js.map +1 -0
- package/dist/strand-party-machines.d.ts +111 -0
- package/dist/strand-party-machines.js +258 -0
- package/dist/strand-party-machines.js.map +1 -0
- package/dist/strand-party-peers.d.ts +101 -0
- package/dist/strand-party-peers.js +49 -0
- package/dist/strand-party-peers.js.map +1 -0
- package/dist/strand-peer-redial.d.ts +34 -7
- package/dist/strand-peer-redial.js +46 -13
- package/dist/strand-peer-redial.js.map +1 -1
- package/dist/strand-revocation-enforcer.d.ts +15 -1
- package/dist/strand-revocation-enforcer.js +16 -9
- package/dist/strand-revocation-enforcer.js.map +1 -1
- package/dist/strand-transport-key.js +3 -0
- package/dist/strand-transport-key.js.map +1 -1
- package/dist/strand-watcher.d.ts +7 -4
- package/dist/strand-watcher.js +12 -7
- package/dist/strand-watcher.js.map +1 -1
- package/dist/types.d.ts +169 -13
- package/dist/types.js.map +1 -1
- package/package.json +9 -8
- package/src/cadre-node.ts +12280 -11528
- package/src/control-authorization.ts +41 -1
- package/src/control-database.ts +6123 -5603
- package/src/control-schema.ts +71 -7
- package/src/ed25519-key.ts +12 -1
- package/src/index.ts +957 -924
- package/src/machine-removal.ts +80 -1
- package/src/membership-connection-gater.ts +13 -1
- package/src/membership-view.ts +4 -1
- package/src/owner-keys.ts +2 -1
- package/src/owner-signer.ts +92 -94
- package/src/peer-authorization.ts +27 -3
- package/src/sealed-party-key.ts +190 -0
- package/src/seed-bootstrap.ts +17 -3
- package/src/strand-addr-protocol.ts +67 -6
- package/src/strand-commit-durability.ts +54 -5
- package/src/strand-database.ts +47 -11
- package/src/strand-instance-manager.ts +524 -65
- package/src/strand-membership-reconciler.ts +1310 -942
- package/src/strand-membership-writer.ts +10 -0
- package/src/strand-party-key-rotation.ts +436 -0
- package/src/strand-party-machines.ts +293 -0
- package/src/strand-party-peers.ts +129 -0
- package/src/strand-peer-redial.ts +61 -14
- package/src/strand-revocation-enforcer.ts +27 -9
- package/src/strand-transport-key.ts +3 -0
- package/src/strand-watcher.ts +12 -7
- package/src/types.ts +3121 -2963
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strand-peer-redial.js","sourceRoot":"","sources":["../src/strand-peer-redial.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"strand-peer-redial.js","sourceRoot":"","sources":["../src/strand-peer-redial.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,oCAAoC,EAAE,kBAAkB,EAAE,aAAa,EAAwC,MAAM,gBAAgB,CAAC;AAC/I,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAA0C,MAAM,wBAAwB,CAAC;AAC3H,OAAO,EAAE,uBAAuB,EAAyB,MAAM,wBAAwB,CAAC;AAExF,MAAM,GAAG,GAAG,KAAK,CAAC,4BAA4B,CAAC,CAAC;AAEhD;;;;GAIG;AACH,MAAM,CAAC,MAAM,sB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WAAW,CAAC,CAAC;IACpE,CAAC;IAEO,WAAW;QACjB,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACxB,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QACpB,CAAC;IACH,CAAC;CACF;AAED,2EAA2E;AAC3E,SAAS,UAAU,CAAC,OAA6B,EAAE,KAA2B;IAC5E,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC7D,OAAO,CAAC,GAAG,OAAO,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;AAC7E,CAAC"}
|
|
@@ -248,6 +248,17 @@ export interface StrandRevocationEnforcerDeps {
|
|
|
248
248
|
* logged and swallowed — an embedder's handler must not derail the sweep.
|
|
249
249
|
*/
|
|
250
250
|
onSelfRevoked?: () => void;
|
|
251
|
+
/**
|
|
252
|
+
* Called ONCE each time this node's own peer id LEAVES the deny set after
|
|
253
|
+
* {@link onSelfRevoked} reported it there — a manager re-admitted the party, or a
|
|
254
|
+
* sibling machine bound this node under the party's current key after a key rotation
|
|
255
|
+
* left its only binding orphaned (`strand-membership-reconciler.ts` → "Binding the
|
|
256
|
+
* party's other machines"). Not fired by a first refresh that finds this node clear.
|
|
257
|
+
* `StrandInstanceManager` wires it to the strand's membership reconciler, which stopped
|
|
258
|
+
* on the revocation and restarts here. A throw is logged and swallowed, as for
|
|
259
|
+
* {@link onSelfRevoked}.
|
|
260
|
+
*/
|
|
261
|
+
onSelfRestored?: () => void;
|
|
251
262
|
/**
|
|
252
263
|
* Subscribe `onChange` to changes in `Strand.Member` and `Strand.MemberPeer`
|
|
253
264
|
* (`StrandDatabase.watchTables`). Absent, or throwing: refreshes come from
|
|
@@ -419,9 +430,12 @@ export declare class StrandRevocationEnforcer {
|
|
|
419
430
|
* into the revoked state: fired once on entry, and re-armed the moment this
|
|
420
431
|
* node is out of the set again — a manager can re-admit a party it removed
|
|
421
432
|
* (a fresh `Member` row makes the orphaned bindings live again), and a second
|
|
422
|
-
* removal has to be reported like the first.
|
|
433
|
+
* removal has to be reported like the first. Leaving the set after a report is
|
|
434
|
+
* the other edge, {@link StrandRevocationEnforcerDeps.onSelfRestored}.
|
|
423
435
|
*/
|
|
424
436
|
private trackSelfRevoked;
|
|
437
|
+
/** Fire one of the self-state handlers; a throw is logged and must not derail the sweep. */
|
|
438
|
+
private signalSelf;
|
|
425
439
|
}
|
|
426
440
|
/** The one capability the gater composition needs from the enforcer. */
|
|
427
441
|
export type StrandRevocationJudge = Pick<StrandRevocationEnforcer, 'isRevoked'>;
|
|
@@ -453,23 +453,30 @@ export class StrandRevocationEnforcer {
|
|
|
453
453
|
* into the revoked state: fired once on entry, and re-armed the moment this
|
|
454
454
|
* node is out of the set again — a manager can re-admit a party it removed
|
|
455
455
|
* (a fresh `Member` row makes the orphaned bindings live again), and a second
|
|
456
|
-
* removal has to be reported like the first.
|
|
456
|
+
* removal has to be reported like the first. Leaving the set after a report is
|
|
457
|
+
* the other edge, {@link StrandRevocationEnforcerDeps.onSelfRestored}.
|
|
457
458
|
*/
|
|
458
459
|
trackSelfRevoked(selfRevoked) {
|
|
459
|
-
if (
|
|
460
|
-
this.selfRevokedSignaled = false;
|
|
460
|
+
if (selfRevoked === this.selfRevokedSignaled) {
|
|
461
461
|
return;
|
|
462
462
|
}
|
|
463
|
-
|
|
464
|
-
|
|
463
|
+
this.selfRevokedSignaled = selfRevoked;
|
|
464
|
+
if (selfRevoked) {
|
|
465
|
+
log('[%s] THIS node is revoked from the strand (removed or left) — signalling', this.deps.label);
|
|
466
|
+
this.signalSelf(this.deps.onSelfRevoked, 'onSelfRevoked');
|
|
467
|
+
}
|
|
468
|
+
else {
|
|
469
|
+
log('[%s] THIS node is no longer revoked from the strand — signalling', this.deps.label);
|
|
470
|
+
this.signalSelf(this.deps.onSelfRestored, 'onSelfRestored');
|
|
465
471
|
}
|
|
466
|
-
|
|
467
|
-
|
|
472
|
+
}
|
|
473
|
+
/** Fire one of the self-state handlers; a throw is logged and must not derail the sweep. */
|
|
474
|
+
signalSelf(handler, name) {
|
|
468
475
|
try {
|
|
469
|
-
|
|
476
|
+
handler?.();
|
|
470
477
|
}
|
|
471
478
|
catch (error) {
|
|
472
|
-
log('[%s]
|
|
479
|
+
log('[%s] %s handler threw: %o', this.deps.label, name, error);
|
|
473
480
|
}
|
|
474
481
|
}
|
|
475
482
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strand-revocation-enforcer.js","sourceRoot":"","sources":["../src/strand-revocation-enforcer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2IG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAuD,MAAM,yBAAyB,CAAC;AAG5G,MAAM,GAAG,GAAG,KAAK,CAAC,gCAAgC,CAAC,CAAC;AAEpD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,GAAG,KAAM,CAAC;AAEzD;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAM,CAAC;AAElD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iCAA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AAO,aAAa,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC;QAC9D,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -8,6 +8,9 @@ import { ed25519KeyPairFromLibp2p } from './ed25519-key.js';
|
|
|
8
8
|
* peerId churn — a strand node's transport peerId must stay stable across
|
|
9
9
|
* process restarts, or any peer-store entry or `MemberPeer` row that names it
|
|
10
10
|
* goes stale on every boot.
|
|
11
|
+
*
|
|
12
|
+
* NOTE: every `CadreControl.StrandPeer` row names a peer id derived under this tag, and those
|
|
13
|
+
* rows cannot be updated or deleted. If this is ever bumped to `.v2`, every row is stale at once.
|
|
11
14
|
*/
|
|
12
15
|
const STRAND_TRANSPORT_KEY_DOMAIN = 'sereus.strand-transport-key.v1';
|
|
13
16
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strand-transport-key.js","sourceRoot":"","sources":["../src/strand-transport-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAE5D
|
|
1
|
+
{"version":3,"file":"strand-transport-key.js","sourceRoot":"","sources":["../src/strand-transport-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAE5D;;;;;;;;;;GAUG;AACH,MAAM,2BAA2B,GAAG,gCAAgC,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,WAAuB,EAAE,QAAgB;IAChF,MAAM,EAAE,aAAa,EAAE,GAAG,wBAAwB,CAAC,WAAW,CAAC,CAAC;IAChE,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,2BAA2B,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAe,CAAC;IAC7G,OAAO,uBAAuB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAClD,CAAC"}
|
package/dist/strand-watcher.d.ts
CHANGED
|
@@ -164,11 +164,14 @@ export declare class StrandWatcher {
|
|
|
164
164
|
*/
|
|
165
165
|
sAppIdLearned(strandId: string): void;
|
|
166
166
|
/**
|
|
167
|
-
* Never offer this strand again this session.
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
* (`CadreNode.handleStrandAdded`),
|
|
167
|
+
* Never offer this strand again this session. Callers all mean "the retry ladder
|
|
168
|
+
* cannot help here": a deliberate local stop, and a launch that can never succeed as
|
|
169
|
+
* configured — a strand whose id is unusable as a storage scope key
|
|
170
|
+
* (`CadreNode.handleStrandAdded`), or one whose app schema can never apply to the
|
|
171
|
+
* tables it holds (`AppSchemaRefusedError`, from either `CadreNode.handleStrandAdded`
|
|
172
|
+
* or `CadreNode.addStrand`), which every later attempt would reject identically.
|
|
171
173
|
* A launch that merely FAILED is not one of them; that goes to {@link forgetStrand}.
|
|
174
|
+
* The caller logs its reason.
|
|
172
175
|
*
|
|
173
176
|
* Cleared when the strand's control row disappears, because a row that reappears is a
|
|
174
177
|
* strand the party re-published and the stop said nothing about it; also cleared by
|
package/dist/strand-watcher.js
CHANGED
|
@@ -4,8 +4,10 @@ const log = debug('sereus:cadre:strand-watcher');
|
|
|
4
4
|
/**
|
|
5
5
|
* Ceiling on the retry delay for a strand whose launch keeps failing. Attempts
|
|
6
6
|
* are never abandoned — the failure this backoff exists for (a transient network
|
|
7
|
-
* or storage fault) can last a long time — but a
|
|
8
|
-
*
|
|
7
|
+
* or storage fault) can last a long time — but a strand that keeps failing must
|
|
8
|
+
* not re-attempt on every run and storm the host app with `strand:error`. A launch
|
|
9
|
+
* that can never succeed is not retried at all: the host suppresses it instead
|
|
10
|
+
* (see {@link StrandWatcher.suppressStrand}).
|
|
9
11
|
*/
|
|
10
12
|
const MAX_RETRY_BACKOFF_MS = 5 * 60 * 1000;
|
|
11
13
|
/**
|
|
@@ -355,11 +357,14 @@ export class StrandWatcher {
|
|
|
355
357
|
}
|
|
356
358
|
}
|
|
357
359
|
/**
|
|
358
|
-
* Never offer this strand again this session.
|
|
359
|
-
*
|
|
360
|
-
*
|
|
361
|
-
* (`CadreNode.handleStrandAdded`),
|
|
360
|
+
* Never offer this strand again this session. Callers all mean "the retry ladder
|
|
361
|
+
* cannot help here": a deliberate local stop, and a launch that can never succeed as
|
|
362
|
+
* configured — a strand whose id is unusable as a storage scope key
|
|
363
|
+
* (`CadreNode.handleStrandAdded`), or one whose app schema can never apply to the
|
|
364
|
+
* tables it holds (`AppSchemaRefusedError`, from either `CadreNode.handleStrandAdded`
|
|
365
|
+
* or `CadreNode.addStrand`), which every later attempt would reject identically.
|
|
362
366
|
* A launch that merely FAILED is not one of them; that goes to {@link forgetStrand}.
|
|
367
|
+
* The caller logs its reason.
|
|
363
368
|
*
|
|
364
369
|
* Cleared when the strand's control row disappears, because a row that reappears is a
|
|
365
370
|
* strand the party re-published and the stop said nothing about it; also cleared by
|
|
@@ -367,7 +372,7 @@ export class StrandWatcher {
|
|
|
367
372
|
* {@link unsuppressStrand} when the caller claims the strand again.
|
|
368
373
|
*/
|
|
369
374
|
suppressStrand(strandId) {
|
|
370
|
-
log('Suppressing strand %s —
|
|
375
|
+
log('Suppressing strand %s — will not be re-offered until it is claimed again or its row is removed', strandId);
|
|
371
376
|
this.suppressed.add(strandId);
|
|
372
377
|
}
|
|
373
378
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strand-watcher.js","sourceRoot":"","sources":["../src/strand-watcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM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ED;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACpC,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,SAAS;QACb,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;CACF"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ConnectionGater, Libp2p, PeerId, PrivateKey } from '@libp2p/interface';
|
|
2
2
|
import type { CircuitRelayServerInit } from '@libp2p/circuit-relay-v2';
|
|
3
3
|
import type { IRawStorage, Libp2pConnectionMonitorInit, Libp2pTransports, NoiseCryptoInterface } from '@optimystic/db-p2p';
|
|
4
|
-
import type { CollectionChangeListener, IPeerNetwork, IRepo } from '@optimystic/db-core';
|
|
4
|
+
import type { CollectionChangeListener, ICohortReachability, IKeyNetwork, IPeerNetwork, IRepo } from '@optimystic/db-core';
|
|
5
5
|
import type { PeerJoinBackfillConfig } from './peer-join-backfill.js';
|
|
6
6
|
import type { StrandReactivityConfig } from './strand-reactivity.js';
|
|
7
7
|
import type { StrandRevocationEnforcementConfig } from './strand-revocation-enforcer.js';
|
|
@@ -38,9 +38,18 @@ export interface Libp2pNodeWithRepo extends Libp2p {
|
|
|
38
38
|
* `coordinatedRepo` (`libp2p-node-base.ts`). Optional deliberately: the base
|
|
39
39
|
* factory always assigns it, but it is not part of the upstream node type, so
|
|
40
40
|
* declaring it required would be a claim this repo cannot enforce. The strand
|
|
41
|
-
* backfill (`peer-join-backfill.ts`) logs once and stays inert when it is absent.
|
|
41
|
+
* backfill (`peer-join-backfill.ts`) logs once and stays inert when it is absent. Its
|
|
42
|
+
* `findCluster` is what the offline queue's party-machine gate (`strand-party-machines.ts`)
|
|
43
|
+
* reads a block's cohort from.
|
|
42
44
|
*/
|
|
43
|
-
keyNetwork?: IPeerNetwork
|
|
45
|
+
keyNetwork?: IPeerNetwork & Pick<IKeyNetwork, 'findCluster'>;
|
|
46
|
+
/**
|
|
47
|
+
* The node's reachability gate for its offline queue (Optimystic's
|
|
48
|
+
* `OptimysticNodeAttachments.cohortReachability`). Optional for the same reason as
|
|
49
|
+
* `keyNetwork`; a node offering offline mode composes its party-machine gate over it, and
|
|
50
|
+
* builds none when it is absent.
|
|
51
|
+
*/
|
|
52
|
+
cohortReachability?: ICohortReachability;
|
|
44
53
|
/**
|
|
45
54
|
* The node's block store, attached by the same factory (Optimystic's
|
|
46
55
|
* `OptimysticNodeAttachments.storageRepo`), narrowed to the storage-wide change feed: it
|
|
@@ -594,12 +603,13 @@ export interface NetworkConfig {
|
|
|
594
603
|
perAddressDialTimeoutMs?: number;
|
|
595
604
|
/**
|
|
596
605
|
* How long a running strand waits, after a sibling answers its strand-addr
|
|
597
|
-
* RPC, before asking that sibling again for its strand-network
|
|
598
|
-
* step of the reconcile pass, scheduled per (sibling, strand). A
|
|
599
|
-
*
|
|
600
|
-
*
|
|
601
|
-
* `
|
|
602
|
-
*
|
|
606
|
+
* RPC with addresses, before asking that sibling again for its strand-network
|
|
607
|
+
* addresses — a step of the reconcile pass, scheduled per (sibling, strand). A
|
|
608
|
+
* sibling that gave no address is retried sooner, on a wait that starts at
|
|
609
|
+
* `STRAND_PEER_ADDR_FIRST_RETRY_MS` and doubles up to this interval after an
|
|
610
|
+
* empty answer, or up to `STRAND_PEER_ADDR_RETRY_MS` (or this interval, when it
|
|
611
|
+
* is set shorter) after a failure. Defaults to `STRAND_PEER_ADDR_REFRESH_MS`
|
|
612
|
+
* (10 min); must stay well under the peerStore's one-hour address expiry.
|
|
603
613
|
*/
|
|
604
614
|
strandAddrRefreshMs?: number;
|
|
605
615
|
};
|
|
@@ -700,7 +710,11 @@ export declare const DEFAULT_CHECKIN_WINDOW_MS: number;
|
|
|
700
710
|
export interface ControlNetworkConfig {
|
|
701
711
|
partyId: string;
|
|
702
712
|
bootstrapNodes: string[];
|
|
703
|
-
/**
|
|
713
|
+
/**
|
|
714
|
+
* Optional path to the control schema file (defaults to the bundled schema), for tests that vary
|
|
715
|
+
* the schema. The file must declare every table of this build's control schema: the node watches
|
|
716
|
+
* and writes them, and `start` fails on a watched table the catalog does not hold.
|
|
717
|
+
*/
|
|
704
718
|
schemaPath?: string;
|
|
705
719
|
}
|
|
706
720
|
/**
|
|
@@ -1625,6 +1639,13 @@ export interface CadreNodeEvents {
|
|
|
1625
1639
|
'strand:stopped': {
|
|
1626
1640
|
strandId: string;
|
|
1627
1641
|
};
|
|
1642
|
+
/**
|
|
1643
|
+
* Emitted when a strand fails to launch, or a deferred app schema apply fails. A launch the
|
|
1644
|
+
* watcher retries emits this on every failed attempt. A launch that fails with an
|
|
1645
|
+
* `AppSchemaRefusedError` (found through wrapping errors by `appSchemaRefusalOf`), meaning the
|
|
1646
|
+
* app's schema can never apply to the tables the strand holds, is not retried until the app
|
|
1647
|
+
* claims the strand again with {@link CadreNode.addStrand}, so it emits this once.
|
|
1648
|
+
*/
|
|
1628
1649
|
'strand:error': {
|
|
1629
1650
|
strandId: string;
|
|
1630
1651
|
error: Error;
|
|
@@ -1743,6 +1764,29 @@ export interface CadreNodeEvents {
|
|
|
1743
1764
|
'strand:rejoin-blocked': {
|
|
1744
1765
|
strandId: string;
|
|
1745
1766
|
};
|
|
1767
|
+
/**
|
|
1768
|
+
* Emitted on the machine that replaced the party's membership key in a closed strand, once
|
|
1769
|
+
* the control record names the new key: a machine removed from the cadre is left holding a
|
|
1770
|
+
* key that is no longer a member there, and every machine's revoked-peer gate denies it on
|
|
1771
|
+
* the rows alone (docs/architecture.md → "Removing a machine"). Every other machine of the
|
|
1772
|
+
* party learns the new key from the replicated `StrandPartyKey` row and re-keys its running
|
|
1773
|
+
* strand without an event.
|
|
1774
|
+
*/
|
|
1775
|
+
'strand:party-key-rotated': {
|
|
1776
|
+
strandId: string;
|
|
1777
|
+
};
|
|
1778
|
+
/**
|
|
1779
|
+
* Emitted when a party key replacement cannot be finished here: the party's current key holds
|
|
1780
|
+
* no `Strand.Manager` row in the strand, so it cannot seat the new key, and the strand's host
|
|
1781
|
+
* has to re-invite the party, or its manager admit the new key by hand (docs/strands.md →
|
|
1782
|
+
* "Replacing the party's key"). Once per pending key; the `PendingStrandPartyKey` row stays,
|
|
1783
|
+
* the membership reconciler redeems the host's invitation under the new key when it arrives,
|
|
1784
|
+
* and `MachineRemovalResult.strands` reports the same strand as `needs-another-party`.
|
|
1785
|
+
*/
|
|
1786
|
+
'strand:party-key-rotation-blocked': {
|
|
1787
|
+
strandId: string;
|
|
1788
|
+
reason: 'needs-another-party';
|
|
1789
|
+
};
|
|
1746
1790
|
/**
|
|
1747
1791
|
* Emitted when the control network advertises a strand this node has no
|
|
1748
1792
|
* registered `sAppConfig` for — i.e. a strand created by another member, or
|
|
@@ -2110,14 +2154,91 @@ export interface MachineRemovalPlan {
|
|
|
2110
2154
|
refusal: MachineRemovalRefusal | null;
|
|
2111
2155
|
/** Live `CadreInvite` keys the machine could redeem to come back: targeted at it, or already redeemed by it with uses left. */
|
|
2112
2156
|
invitations: string[];
|
|
2157
|
+
/**
|
|
2158
|
+
* One entry per closed strand the party holds a membership key for, saying where the
|
|
2159
|
+
* party's key in that strand is replaced ({@link StrandKeyRotationPlan}). A closed strand
|
|
2160
|
+
* with no `StrandPartyKey` row is absent: the party holds no identity there for the removed
|
|
2161
|
+
* machine to keep. Empty when `machine` is null.
|
|
2162
|
+
*/
|
|
2163
|
+
strands: StrandKeyRotationPlan[];
|
|
2113
2164
|
}
|
|
2114
|
-
/**
|
|
2115
|
-
|
|
2165
|
+
/**
|
|
2166
|
+
* Where one closed strand's party key is replaced when a machine is removed
|
|
2167
|
+
* (docs/architecture.md → "Removing a machine").
|
|
2168
|
+
*/
|
|
2169
|
+
export interface StrandKeyRotationPlan {
|
|
2170
|
+
strandId: string;
|
|
2171
|
+
/**
|
|
2172
|
+
* - `here`: the strand runs on this node (live, or hibernating and resumable) and the party's
|
|
2173
|
+
* current key holds a `Strand.Manager` row, so the removal itself replaces the key. A
|
|
2174
|
+
* hibernating strand is reported `here` before its manager seat can be read; the removal
|
|
2175
|
+
* wakes it, and the outcome says what it found.
|
|
2176
|
+
* - `another-party`: the strand runs here, but the party holds no manager seat, so the strand's
|
|
2177
|
+
* host has to re-invite the party, or its manager admit the new key by hand (docs/strands.md →
|
|
2178
|
+
* "Replacing the party's key"); the replacement then finishes on an owner machine of this party.
|
|
2179
|
+
* - `later`: the strand does not run on this node (not launched here, excluded by its strand
|
|
2180
|
+
* filter, or still syncing), so the replacement waits for an owner machine that runs it.
|
|
2181
|
+
*/
|
|
2182
|
+
rotation: 'here' | 'later' | 'another-party';
|
|
2183
|
+
}
|
|
2184
|
+
/**
|
|
2185
|
+
* What `ControlDatabase.removeMachine` wrote. All false and empty when no live row named the
|
|
2186
|
+
* machine here. {@link MachineRemovalResult} adds what the node did about the party's strand
|
|
2187
|
+
* keys afterwards.
|
|
2188
|
+
*/
|
|
2189
|
+
export interface MachineRemovalWrites {
|
|
2116
2190
|
removedPeer: boolean;
|
|
2117
2191
|
removedDeviceToken: boolean;
|
|
2118
2192
|
/** `CadreInvite` keys whose withdrawal tombstone this call filed. */
|
|
2119
2193
|
withdrawnInvitations: string[];
|
|
2120
2194
|
}
|
|
2195
|
+
/** What `CadreNode.removeMachine` did: the control writes, and the party's key in each closed strand. */
|
|
2196
|
+
export interface MachineRemovalResult extends MachineRemovalWrites {
|
|
2197
|
+
/** One entry per closed strand the plan listed, in the plan's order ({@link StrandKeyRotationOutcome}). */
|
|
2198
|
+
strands: StrandKeyRotationOutcome[];
|
|
2199
|
+
}
|
|
2200
|
+
/**
|
|
2201
|
+
* What became of the party's key in one closed strand after a machine removal
|
|
2202
|
+
* (`strand-party-key-rotation.ts`).
|
|
2203
|
+
*/
|
|
2204
|
+
export interface StrandKeyRotationOutcome {
|
|
2205
|
+
strandId: string;
|
|
2206
|
+
/**
|
|
2207
|
+
* - `rotated`: the party is on its new key in the strand and the control record names it;
|
|
2208
|
+
* the removed machine's binding there is an orphan every machine's gate denies.
|
|
2209
|
+
* - `pending`: the intent is recorded (a `PendingStrandPartyKey` row) and the strand's side
|
|
2210
|
+
* is not finished: the strand does not run here, a step failed and will be retried, or the
|
|
2211
|
+
* control swap waits for a reachable sibling. Any owner machine running the strand finishes it.
|
|
2212
|
+
* - `needs-another-party`: the party holds no manager seat in the strand, so it cannot seat
|
|
2213
|
+
* its new key itself; the row stays pending until the strand's host re-invites the party, or
|
|
2214
|
+
* its manager admits the new key by hand (docs/strands.md → "Replacing the party's key").
|
|
2215
|
+
*/
|
|
2216
|
+
outcome: 'rotated' | 'pending' | 'needs-another-party';
|
|
2217
|
+
}
|
|
2218
|
+
/** One closed strand whose membership key replacement has not finished (docs/architecture.md → "Removing a machine"). */
|
|
2219
|
+
export interface PendingPartyKeyRotation {
|
|
2220
|
+
strandId: string;
|
|
2221
|
+
/** The key the party is moving to, public half (base64url): what another party's manager admits by hand. */
|
|
2222
|
+
publicKey: string;
|
|
2223
|
+
/** Earlier pending keys this one replaced, public halves. A seat one of them holds in a strand the party does not manage is for that strand's manager to revoke. */
|
|
2224
|
+
superseded: string[];
|
|
2225
|
+
/**
|
|
2226
|
+
* Who can move the replacement forward from here, judged from this machine's view of the strand.
|
|
2227
|
+
* - `another-party`: the strand runs here, the party holds no manager seat and `publicKey` is not a member, so another party's manager has to admit it: a fresh invitation to the strand redeemed on an owner device of this party the new key is sealed to (`sealedTo`), or the key admitted by hand.
|
|
2228
|
+
* - `sealed`: the strand has no managers at all and `publicKey` is not a member; nobody can admit it, and the removed machine stays a member until the strand is re-formed.
|
|
2229
|
+
* - `owner-machine`: an owner device of this party the new key is sealed to (`sealedTo`) that runs the strand finishes it (the strand does not run here, the party holds a manager seat, or `publicKey` is already a member), which this machine may or may not be. Also the answer when a read here fails.
|
|
2230
|
+
*/
|
|
2231
|
+
waitingOn: 'another-party' | 'sealed' | 'owner-machine';
|
|
2232
|
+
/**
|
|
2233
|
+
* The machines of this cadre the new key is sealed to: control peer ids, each a live machine
|
|
2234
|
+
* (`listMachines`) or this node, in no particular order. Only these can redeem the host's
|
|
2235
|
+
* invitation under the new key or finish the replacement, and only those of them that hold an
|
|
2236
|
+
* owner key. A machine admitted after the removal is never one. Empty when every machine it
|
|
2237
|
+
* was sealed to has left the cadre, or the row's envelope does not decode; removing a machine
|
|
2238
|
+
* then writes a replacement sealed to the machines present.
|
|
2239
|
+
*/
|
|
2240
|
+
sealedTo: string[];
|
|
2241
|
+
}
|
|
2121
2242
|
/** Why `CadreNode.removeOwner` refuses by name (`OwnerKeyRemovalRefusedError.code`). */
|
|
2122
2243
|
export type OwnerKeyRemovalRefusal =
|
|
2123
2244
|
/** This node holds no enrolled owner key, so it cannot sign the removal. */
|
|
@@ -2128,7 +2249,7 @@ export type OwnerKeyRemovalRefusal =
|
|
|
2128
2249
|
| 'last-owner'
|
|
2129
2250
|
/** The key is this node's own owner key: an owner cannot sign its own row's removal (`A.Key <> old.Key`), so ask another owner key. */
|
|
2130
2251
|
| 'self'
|
|
2131
|
-
/**
|
|
2252
|
+
/** The removal would re-vouch a row, this node's own included, while this node reaches no sibling and the party has other members: a re-added `OwnerKey` row has no re-issue path, and a re-vouched `CadrePeer` row can fork its collection. Decided at call time, so never planned. */
|
|
2132
2253
|
| 'alone';
|
|
2133
2254
|
/** The rows sharing the owner keys' voucher column that a removed owner key strands unless re-vouched first. */
|
|
2134
2255
|
export interface OwnerKeyDependents {
|
|
@@ -2227,6 +2348,41 @@ export interface OwnerGrantRedemptionResult {
|
|
|
2227
2348
|
alreadyOwner: boolean;
|
|
2228
2349
|
seatedStampId: string;
|
|
2229
2350
|
}
|
|
2351
|
+
/**
|
|
2352
|
+
* One `CadreControl.StrandPeer` row: a machine's own signed statement of the peer id it uses
|
|
2353
|
+
* in one strand. {@link ControlDatabase.queryStrandPeers} returns only rows whose `sig`
|
|
2354
|
+
* verifies; whether `peerId` is a live or removed machine is its caller's question.
|
|
2355
|
+
*/
|
|
2356
|
+
export interface StrandPeerRow {
|
|
2357
|
+
strandId: string;
|
|
2358
|
+
/** The machine's control peer id (`CadrePeer.PeerId`). */
|
|
2359
|
+
peerId: string;
|
|
2360
|
+
/** That machine's peer id in the strand's own network (`strandTransportKey`). */
|
|
2361
|
+
strandPeerId: string;
|
|
2362
|
+
/** The machine's signature over the `'add'` digest (`strandPeerAddDigest`). */
|
|
2363
|
+
sig: string;
|
|
2364
|
+
}
|
|
2365
|
+
/**
|
|
2366
|
+
* The key a party moves to in one closed strand as its `CadreControl.PendingStrandPartyKey` row
|
|
2367
|
+
* carries it: the public half in the clear, the private half sealed to the identity keys of the
|
|
2368
|
+
* machines that remain (`sealed-party-key.ts`), because the row reaches the removed machine too.
|
|
2369
|
+
*/
|
|
2370
|
+
export interface SealedPendingPartyKey {
|
|
2371
|
+
/** The key being moved to, public half (base64url): the `Strand.Member.Key` it is seated as. */
|
|
2372
|
+
publicKey: string;
|
|
2373
|
+
/** Its private half, encoded as `StrandPartyKey.PrivateKey`, sealed per recipient (`sealPartyKey`); `openPartyKey` reads it. */
|
|
2374
|
+
sealedKey: string;
|
|
2375
|
+
}
|
|
2376
|
+
/**
|
|
2377
|
+
* The key this party's membership in one closed strand is moving to, as
|
|
2378
|
+
* {@link ControlDatabase.queryPendingStrandPartyKey} reads a `CadreControl.PendingStrandPartyKey` row.
|
|
2379
|
+
*/
|
|
2380
|
+
export interface PendingStrandPartyKeyRow extends SealedPendingPartyKey {
|
|
2381
|
+
/** Public keys (base64url) of earlier pending keys this row replaced; a seat any of them holds must be revoked. */
|
|
2382
|
+
superseded: string[];
|
|
2383
|
+
/** The row's single-use nonce, bound into its remove digest. */
|
|
2384
|
+
stampId: string;
|
|
2385
|
+
}
|
|
2230
2386
|
/**
|
|
2231
2387
|
* One `CadreControl.Revocation` tombstone as read by
|
|
2232
2388
|
* `ControlDatabase.queryRevocations`: the identity triple plus the `ReissuedAt`
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[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,eAAe;KAC5D;CACF,CAAC;AA8eF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;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;AAgBnD;;;;;;;;;;;;;;;;;;;;;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.23.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",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"@libp2p/logger": "^6.2.13",
|
|
91
91
|
"@libp2p/peer-store": "^12.0.28",
|
|
92
92
|
"@libp2p/webrtc": "6.0.33",
|
|
93
|
-
"@optimystic/db-p2p-storage-fs": "^1.
|
|
93
|
+
"@optimystic/db-p2p-storage-fs": "^1.27.0",
|
|
94
94
|
"@types/debug": "^4.1.12",
|
|
95
95
|
"@types/node": "^25.0.10",
|
|
96
96
|
"@vitest/coverage-v8": "^4.0.17",
|
|
@@ -110,13 +110,14 @@
|
|
|
110
110
|
"@libp2p/websockets": "^10.1.21",
|
|
111
111
|
"@multiformats/multiaddr": "^13.0.3",
|
|
112
112
|
"@noble/ciphers": "^2.0.1",
|
|
113
|
+
"@noble/curves": "^2.0.1",
|
|
113
114
|
"@noble/hashes": "^2.0.0",
|
|
114
|
-
"@optimystic/db-core": "^1.
|
|
115
|
-
"@optimystic/db-p2p": "^1.
|
|
116
|
-
"@optimystic/quereus-plugin-crypto": "^1.
|
|
117
|
-
"@optimystic/quereus-plugin-optimystic": "^1.
|
|
118
|
-
"@quereus/quereus": "^4.
|
|
119
|
-
"@serfab/quereus-plugin-sereus": "^1.
|
|
115
|
+
"@optimystic/db-core": "^1.27.0",
|
|
116
|
+
"@optimystic/db-p2p": "^1.27.0",
|
|
117
|
+
"@optimystic/quereus-plugin-crypto": "^1.27.0",
|
|
118
|
+
"@optimystic/quereus-plugin-optimystic": "^1.27.0",
|
|
119
|
+
"@quereus/quereus": "^5.4.0",
|
|
120
|
+
"@serfab/quereus-plugin-sereus": "^1.23.0",
|
|
120
121
|
"debug": "^4.4.3",
|
|
121
122
|
"libp2p": "^3.3.11",
|
|
122
123
|
"uint8arrays": "^6.1.1"
|