@serfab/cadre-core 1.13.0 → 1.15.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 +293 -274
- package/dist/cadre-invite-protocol.d.ts +383 -0
- package/dist/cadre-invite-protocol.js +774 -0
- package/dist/cadre-invite-protocol.js.map +1 -0
- package/dist/cadre-join-request.d.ts +42 -0
- package/dist/cadre-join-request.js +144 -0
- package/dist/cadre-join-request.js.map +1 -0
- package/dist/cadre-node.d.ts +849 -210
- package/dist/cadre-node.js +1574 -374
- package/dist/cadre-node.js.map +1 -1
- package/dist/claim-proof.d.ts +45 -0
- package/dist/claim-proof.js +132 -0
- package/dist/claim-proof.js.map +1 -0
- package/dist/control-authorization.d.ts +80 -19
- package/dist/control-authorization.js +55 -13
- package/dist/control-authorization.js.map +1 -1
- package/dist/control-cohort.js +1 -1
- package/dist/control-cohort.js.map +1 -1
- package/dist/control-database.d.ts +605 -108
- package/dist/control-database.js +1299 -280
- package/dist/control-database.js.map +1 -1
- package/dist/control-protocol-guard.d.ts +142 -0
- package/dist/control-protocol-guard.js +293 -0
- package/dist/control-protocol-guard.js.map +1 -0
- package/dist/control-schema.d.ts +1 -1
- package/dist/control-schema.js +817 -1067
- package/dist/control-schema.js.map +1 -1
- package/dist/control-stream.d.ts +4 -0
- package/dist/control-stream.js +22 -7
- package/dist/control-stream.js.map +1 -1
- package/dist/delegate-admission.d.ts +1 -1
- package/dist/delegate-admission.js +1 -1
- package/dist/device-token.d.ts +11 -9
- package/dist/device-token.js +14 -12
- package/dist/device-token.js.map +1 -1
- package/dist/ed25519-key.d.ts +22 -9
- package/dist/ed25519-key.js +47 -10
- package/dist/ed25519-key.js.map +1 -1
- package/dist/fetch-impl.d.ts +12 -0
- package/dist/fetch-impl.js +23 -0
- package/dist/fetch-impl.js.map +1 -0
- package/dist/file-durable-slot.js +2 -1
- package/dist/file-durable-slot.js.map +1 -1
- package/dist/file-safe-name.d.ts +25 -0
- package/dist/file-safe-name.js +29 -0
- package/dist/file-safe-name.js.map +1 -0
- package/dist/formation-approval.js +5 -11
- package/dist/formation-approval.js.map +1 -1
- package/dist/fs-atomic.d.ts +0 -19
- package/dist/fs-atomic.js +3 -24
- package/dist/fs-atomic.js.map +1 -1
- package/dist/index.d.ts +22 -10
- package/dist/index.js +54 -11
- package/dist/index.js.map +1 -1
- package/dist/invitation-bootstrap.d.ts +50 -12
- package/dist/invitation-bootstrap.js +76 -13
- package/dist/invitation-bootstrap.js.map +1 -1
- package/dist/joined-strand-store.d.ts +7 -0
- package/dist/joined-strand-store.js +9 -0
- package/dist/joined-strand-store.js.map +1 -1
- package/dist/key-store-file.js +2 -1
- package/dist/key-store-file.js.map +1 -1
- package/dist/link-budget.d.ts +25 -33
- package/dist/link-budget.js +25 -35
- package/dist/link-budget.js.map +1 -1
- package/dist/machine-removal.d.ts +78 -0
- package/dist/machine-removal.js +166 -0
- package/dist/machine-removal.js.map +1 -0
- package/dist/membership-connection-gater.d.ts +191 -151
- package/dist/membership-connection-gater.js +236 -173
- package/dist/membership-connection-gater.js.map +1 -1
- package/dist/node-claim-payload.d.ts +74 -0
- package/dist/node-claim-payload.js +224 -0
- package/dist/node-claim-payload.js.map +1 -0
- package/dist/node-default-transports.d.ts +27 -0
- package/dist/node-default-transports.js +35 -0
- package/dist/node-default-transports.js.map +1 -0
- package/dist/node-transports.d.ts +30 -0
- package/dist/node-transports.js +40 -0
- package/dist/node-transports.js.map +1 -0
- package/dist/owner-anchor-sync.d.ts +22 -0
- package/dist/owner-anchor-sync.js +143 -0
- package/dist/owner-anchor-sync.js.map +1 -0
- package/dist/peer-authorization.d.ts +113 -18
- package/dist/peer-authorization.js +225 -29
- package/dist/peer-authorization.js.map +1 -1
- package/dist/peer-dial.d.ts +143 -27
- package/dist/peer-dial.js +276 -31
- package/dist/peer-dial.js.map +1 -1
- package/dist/peer-join-backfill.d.ts +26 -2
- package/dist/peer-join-backfill.js +60 -12
- package/dist/peer-join-backfill.js.map +1 -1
- package/dist/peer-record.d.ts +17 -52
- package/dist/peer-record.js +20 -58
- package/dist/peer-record.js.map +1 -1
- package/dist/pending-join-runner.d.ts +66 -58
- package/dist/pending-join-runner.js +136 -145
- package/dist/pending-join-runner.js.map +1 -1
- package/dist/primary-lan-address.d.ts +8 -0
- package/dist/primary-lan-address.js +46 -0
- package/dist/primary-lan-address.js.map +1 -0
- package/dist/provider/client.d.ts +131 -0
- package/dist/provider/client.js +226 -0
- package/dist/provider/client.js.map +1 -0
- package/dist/provider/descriptor.d.ts +41 -0
- package/dist/provider/descriptor.js +103 -0
- package/dist/provider/descriptor.js.map +1 -0
- package/dist/provider/index.d.ts +9 -0
- package/dist/provider/index.js +10 -0
- package/dist/provider/index.js.map +1 -0
- package/dist/provider/oauth.d.ts +125 -0
- package/dist/provider/oauth.js +199 -0
- package/dist/provider/oauth.js.map +1 -0
- package/dist/provider/rent-node.d.ts +101 -0
- package/dist/provider/rent-node.js +220 -0
- package/dist/provider/rent-node.js.map +1 -0
- package/dist/push-fanout.d.ts +8 -2
- package/dist/push-fanout.js +8 -2
- package/dist/push-fanout.js.map +1 -1
- package/dist/relay-addrs.d.ts +9 -4
- package/dist/relay-addrs.js +9 -4
- package/dist/relay-addrs.js.map +1 -1
- package/dist/relay-reservation.d.ts +51 -16
- package/dist/relay-reservation.js +107 -24
- package/dist/relay-reservation.js.map +1 -1
- package/dist/seed-bootstrap.d.ts +165 -123
- package/dist/seed-bootstrap.js +313 -275
- package/dist/seed-bootstrap.js.map +1 -1
- package/dist/seed-trust-policy.d.ts +98 -37
- package/dist/seed-trust-policy.js +188 -2
- package/dist/seed-trust-policy.js.map +1 -1
- package/dist/strand-addr-protocol.d.ts +24 -26
- package/dist/strand-addr-protocol.js +19 -26
- package/dist/strand-addr-protocol.js.map +1 -1
- package/dist/strand-commit-durability.d.ts +54 -0
- package/dist/strand-commit-durability.js +74 -0
- package/dist/strand-commit-durability.js.map +1 -0
- package/dist/strand-database.d.ts +23 -8
- package/dist/strand-database.js +41 -13
- package/dist/strand-database.js.map +1 -1
- package/dist/strand-first-sync-gate.d.ts +7 -1
- package/dist/strand-first-sync-gate.js +7 -1
- package/dist/strand-first-sync-gate.js.map +1 -1
- package/dist/strand-formation-protocol.js +5 -2
- package/dist/strand-formation-protocol.js.map +1 -1
- package/dist/strand-fret-addrs.d.ts +19 -1
- package/dist/strand-fret-addrs.js +27 -9
- package/dist/strand-fret-addrs.js.map +1 -1
- package/dist/strand-instance-manager.d.ts +81 -19
- package/dist/strand-instance-manager.js +216 -105
- package/dist/strand-instance-manager.js.map +1 -1
- package/dist/strand-move.d.ts +124 -0
- package/dist/strand-move.js +438 -0
- package/dist/strand-move.js.map +1 -0
- package/dist/strand-network-config.js +7 -6
- package/dist/strand-network-config.js.map +1 -1
- package/dist/strand-peer-redial.d.ts +113 -0
- package/dist/strand-peer-redial.js +236 -0
- package/dist/strand-peer-redial.js.map +1 -0
- package/dist/strand-revocation-enforcer.d.ts +11 -11
- package/dist/strand-revocation-enforcer.js +11 -11
- package/dist/strand-wake-protocol.d.ts +13 -16
- package/dist/strand-wake-protocol.js +23 -27
- package/dist/strand-wake-protocol.js.map +1 -1
- package/dist/trusted-owner-store.d.ts +35 -5
- package/dist/trusted-owner-store.js +50 -8
- package/dist/trusted-owner-store.js.map +1 -1
- package/dist/types.d.ts +512 -89
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -1
- package/package.json +19 -10
- package/src/cadre-invite-protocol.ts +1052 -0
- package/src/cadre-join-request.ts +167 -0
- package/src/cadre-node.ts +1703 -386
- package/src/claim-proof.ts +147 -0
- package/src/control-authorization.ts +203 -117
- package/src/control-cohort.ts +1 -1
- package/src/control-database.ts +4663 -3453
- package/src/control-protocol-guard.ts +348 -0
- package/src/control-schema.ts +828 -1078
- package/src/control-stream.ts +26 -7
- package/src/delegate-admission.ts +1 -1
- package/src/device-token.ts +14 -10
- package/src/ed25519-key.ts +47 -10
- package/src/fetch-impl.ts +23 -0
- package/src/file-durable-slot.ts +64 -63
- package/src/file-safe-name.ts +32 -0
- package/src/formation-approval.ts +604 -610
- package/src/fs-atomic.ts +92 -117
- package/src/index.ts +789 -648
- package/src/invitation-bootstrap.ts +91 -13
- package/src/joined-strand-store.ts +508 -498
- package/src/key-store-file.ts +142 -141
- package/src/link-budget.ts +25 -36
- package/src/machine-removal.ts +216 -0
- package/src/membership-connection-gater.ts +259 -191
- package/src/node-claim-payload.ts +259 -0
- package/src/node-default-transports.ts +38 -0
- package/src/node-transports.ts +49 -0
- package/src/owner-anchor-sync.ts +171 -0
- package/src/peer-authorization.ts +258 -29
- package/src/peer-dial.ts +604 -315
- package/src/peer-join-backfill.ts +62 -11
- package/src/peer-record.ts +159 -197
- package/src/pending-join-runner.ts +729 -735
- package/src/primary-lan-address.ts +47 -0
- package/src/provider/client.ts +326 -0
- package/src/provider/descriptor.ts +129 -0
- package/src/provider/index.ts +59 -0
- package/src/provider/oauth.ts +285 -0
- package/src/provider/rent-node.ts +275 -0
- package/src/push-fanout.ts +8 -2
- package/src/relay-addrs.ts +9 -4
- package/src/relay-reservation.ts +1211 -1121
- package/src/seed-bootstrap.ts +1502 -1448
- package/src/seed-trust-policy.ts +353 -140
- package/src/strand-addr-protocol.ts +26 -35
- package/src/strand-commit-durability.ts +116 -0
- package/src/strand-database.ts +46 -14
- package/src/strand-first-sync-gate.ts +7 -1
- package/src/strand-formation-protocol.ts +1039 -1036
- package/src/strand-fret-addrs.ts +179 -145
- package/src/strand-instance-manager.ts +2026 -1883
- package/src/strand-move.ts +585 -0
- package/src/strand-network-config.ts +7 -6
- package/src/strand-peer-redial.ts +307 -0
- package/src/strand-revocation-enforcer.ts +11 -11
- package/src/strand-wake-protocol.ts +23 -30
- package/src/trusted-owner-store.ts +242 -171
- package/src/types.ts +2687 -2242
|
@@ -118,9 +118,15 @@ export declare class PeerJoinBackfill {
|
|
|
118
118
|
private readonly createPushClient;
|
|
119
119
|
private started;
|
|
120
120
|
private stopped;
|
|
121
|
-
/**
|
|
121
|
+
/**
|
|
122
|
+
* Peers fully caught up this runtime (never rescheduled until the runtime is rebuilt; only
|
|
123
|
+
* {@link forceCatchUpPeer} pushes to one again).
|
|
124
|
+
*/
|
|
122
125
|
private readonly done;
|
|
123
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* Peers with a catch-up currently running, each with that run (suppresses concurrent
|
|
128
|
+
* duplicates; {@link forceCatchUpPeer} waits on the run).
|
|
129
|
+
*/
|
|
124
130
|
private readonly inFlight;
|
|
125
131
|
/**
|
|
126
132
|
* Peers whose (re-)schedule arrived while their OWN run was in flight, replayed once
|
|
@@ -179,6 +185,24 @@ export declare class PeerJoinBackfill {
|
|
|
179
185
|
* caught up, or this backfill is stopped.
|
|
180
186
|
*/
|
|
181
187
|
catchUpPeer(peerId: PeerId): Promise<PeerJoinBackfillResult>;
|
|
188
|
+
/**
|
|
189
|
+
* Run one peer's catch-up now and wait for it, whatever this instance remembers about the
|
|
190
|
+
* peer: wait out a run already in flight for it, then push the whole store again even when
|
|
191
|
+
* the peer is memoized as caught up. Never rejects; an all-zero result only when stopped.
|
|
192
|
+
*
|
|
193
|
+
* For a caller that must know the peer holds this store before it proceeds, where
|
|
194
|
+
* {@link catchUpPeer}'s empty answer would hide a run that was denied (a `peer:identify`
|
|
195
|
+
* run can pass the gate a moment before the caller authorized the peer) or a memo older
|
|
196
|
+
* than the commits since.
|
|
197
|
+
*/
|
|
198
|
+
forceCatchUpPeer(peerId: PeerId): Promise<PeerJoinBackfillResult>;
|
|
199
|
+
/**
|
|
200
|
+
* Register one run in {@link inFlight} before its first await, so no second run for the
|
|
201
|
+
* peer can start beside it, and replay a schedule that arrived while it ran.
|
|
202
|
+
*/
|
|
203
|
+
private trackRun;
|
|
204
|
+
/** One run and what follows from its outcome: the memo, or a backoff re-arm. Never rejects. */
|
|
205
|
+
private settleRun;
|
|
182
206
|
/** Whether this network's libp2p node still holds a connection to that peer. */
|
|
183
207
|
private isConnected;
|
|
184
208
|
/**
|
|
@@ -31,6 +31,12 @@ import { peerJoinPushBudget } from './link-budget.js';
|
|
|
31
31
|
// If Optimystic ever grows a cohort-join catch-up of its own, delete this module rather
|
|
32
32
|
// than running two.
|
|
33
33
|
//
|
|
34
|
+
// NOTE: strand nodes pass db-p2p no `kvStore`, so Optimystic's under-replication ledger (the
|
|
35
|
+
// copies a node owes peers) dies at every restart. This module's whole-store push on connect is
|
|
36
|
+
// what delivers a write a machine made alone after it restarts (`joiner-first-commit-over-slow-relay`,
|
|
37
|
+
// restart arm). If this module is narrowed (the cohort filter above) or deleted, give strand
|
|
38
|
+
// nodes a persistent kvStore first.
|
|
39
|
+
//
|
|
34
40
|
// Membership — the one place the two networks differ, expressed as the optional
|
|
35
41
|
// `authorizePeer` dep:
|
|
36
42
|
//
|
|
@@ -195,10 +201,16 @@ export class PeerJoinBackfill {
|
|
|
195
201
|
this.deps = deps;
|
|
196
202
|
this.started = false;
|
|
197
203
|
this.stopped = false;
|
|
198
|
-
/**
|
|
204
|
+
/**
|
|
205
|
+
* Peers fully caught up this runtime (never rescheduled until the runtime is rebuilt; only
|
|
206
|
+
* {@link forceCatchUpPeer} pushes to one again).
|
|
207
|
+
*/
|
|
199
208
|
this.done = new Set();
|
|
200
|
-
/**
|
|
201
|
-
|
|
209
|
+
/**
|
|
210
|
+
* Peers with a catch-up currently running, each with that run (suppresses concurrent
|
|
211
|
+
* duplicates; {@link forceCatchUpPeer} waits on the run).
|
|
212
|
+
*/
|
|
213
|
+
this.inFlight = new Map();
|
|
202
214
|
/**
|
|
203
215
|
* Peers whose (re-)schedule arrived while their OWN run was in flight, replayed once
|
|
204
216
|
* that run finishes. Load-bearing for the gated path: the gate's authorization check is
|
|
@@ -342,7 +354,51 @@ export class PeerJoinBackfill {
|
|
|
342
354
|
if (this.stopped || this.done.has(key) || this.inFlight.has(key)) {
|
|
343
355
|
return emptyResult();
|
|
344
356
|
}
|
|
345
|
-
this.
|
|
357
|
+
return await this.trackRun(peerId);
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Run one peer's catch-up now and wait for it, whatever this instance remembers about the
|
|
361
|
+
* peer: wait out a run already in flight for it, then push the whole store again even when
|
|
362
|
+
* the peer is memoized as caught up. Never rejects; an all-zero result only when stopped.
|
|
363
|
+
*
|
|
364
|
+
* For a caller that must know the peer holds this store before it proceeds, where
|
|
365
|
+
* {@link catchUpPeer}'s empty answer would hide a run that was denied (a `peer:identify`
|
|
366
|
+
* run can pass the gate a moment before the caller authorized the peer) or a memo older
|
|
367
|
+
* than the commits since.
|
|
368
|
+
*/
|
|
369
|
+
async forceCatchUpPeer(peerId) {
|
|
370
|
+
const key = peerId.toString();
|
|
371
|
+
for (let pending = this.inFlight.get(key); pending; pending = this.inFlight.get(key)) {
|
|
372
|
+
await pending;
|
|
373
|
+
}
|
|
374
|
+
if (this.stopped) {
|
|
375
|
+
return emptyResult();
|
|
376
|
+
}
|
|
377
|
+
return await this.trackRun(peerId);
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Register one run in {@link inFlight} before its first await, so no second run for the
|
|
381
|
+
* peer can start beside it, and replay a schedule that arrived while it ran.
|
|
382
|
+
*/
|
|
383
|
+
async trackRun(peerId) {
|
|
384
|
+
const key = peerId.toString();
|
|
385
|
+
const run = this.settleRun(peerId);
|
|
386
|
+
this.inFlight.set(key, run);
|
|
387
|
+
try {
|
|
388
|
+
return await run;
|
|
389
|
+
}
|
|
390
|
+
finally {
|
|
391
|
+
this.inFlight.delete(key);
|
|
392
|
+
// Replay a schedule that arrived mid-run. `schedulePeer` re-checks `done`, so a run
|
|
393
|
+
// that finished clean re-arms nothing; a denied or failed one gets its retry.
|
|
394
|
+
if (this.rearmAfterFlight.delete(key)) {
|
|
395
|
+
this.schedulePeer(peerId);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
/** One run and what follows from its outcome: the memo, or a backoff re-arm. Never rejects. */
|
|
400
|
+
async settleRun(peerId) {
|
|
401
|
+
const key = peerId.toString();
|
|
346
402
|
try {
|
|
347
403
|
const { result, clean, pushFailed } = await this.runCatchUp(peerId);
|
|
348
404
|
// NOTE: a run that hit `maxBlocks` is still "clean" and still memoizes the peer, so
|
|
@@ -375,14 +431,6 @@ export class PeerJoinBackfill {
|
|
|
375
431
|
log('[%s] catch-up peer=%s failed: %o', this.deps.label, key, error);
|
|
376
432
|
return emptyResult();
|
|
377
433
|
}
|
|
378
|
-
finally {
|
|
379
|
-
this.inFlight.delete(key);
|
|
380
|
-
// Replay a schedule that arrived mid-run. `schedulePeer` re-checks `done`, so a run
|
|
381
|
-
// that finished clean re-arms nothing; a denied or failed one gets its retry.
|
|
382
|
-
if (this.rearmAfterFlight.delete(key)) {
|
|
383
|
-
this.schedulePeer(peerId);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
434
|
}
|
|
387
435
|
/** Whether this network's libp2p node still holds a connection to that peer. */
|
|
388
436
|
isConnected(peerId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peer-join-backfill.js","sourceRoot":"","sources":["../src/peer-join-backfill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAA2C,MAAM,oBAAoB,CAAC;AAC9H,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,sFAAsF;AACtF,6FAA6F;AAC7F,uFAAuF;AACvF,0FAA0F;AAC1F,wFAAwF;AACxF,0FAA0F;AAC1F,0FAA0F;AAC1F,yFAAyF;AACzF,yFAAyF;AACzF,EAAE;AACF,6FAA6F;AAC7F,yFAAyF;AACzF,8FAA8F;AAC9F,sFAAsF;AACtF,8FAA8F;AAC9F,2FAA2F;AAC3F,wFAAwF;AACxF,+BAA+B;AAC/B,EAAE;AACF,wFAAwF;AACxF,iFAAiF;AACjF,0FAA0F;AAC1F,uFAAuF;AACvF,0FAA0F;AAC1F,sBAAsB;AACtB,EAAE;A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|
package/dist/peer-record.d.ts
CHANGED
|
@@ -8,22 +8,24 @@
|
|
|
8
8
|
* multi-field encoding, so no field split is ambiguous. It is intentionally NOT
|
|
9
9
|
* JSON-canonicalized (deterministic across node/browser/RN, no key ordering)
|
|
10
10
|
* and — crucially — is reconstructable inside the `CadrePeer.AuthorizedUpdate`
|
|
11
|
-
* SQL constraint from the row's own columns
|
|
11
|
+
* SQL constraint from the row's own columns and the node-local `party_id()`:
|
|
12
12
|
*
|
|
13
|
-
* digest('CadreControl.CadrePeer', 'publish',
|
|
14
|
-
* new.PeerId, new.Multiaddr, cast(new.UpdatedAt as text)
|
|
13
|
+
* digest('CadreControl.CadrePeer', 'publish', party_id(),
|
|
14
|
+
* new.PeerId, new.Multiaddr, cast(new.UpdatedAt as text),
|
|
15
|
+
* coalesce(new.Profile, ''))
|
|
15
16
|
*
|
|
16
17
|
* Keep {@link peerRecordSignedPayload} and that constraint byte-for-byte in
|
|
17
18
|
* sync. The `'publish'` action tag marks this as a peer's SELF-signed record
|
|
18
19
|
* (signed with the peer's own key, not an owner key) and keeps it disjoint from
|
|
19
|
-
* every owner-signed digest
|
|
20
|
+
* every owner-signed digest; the party id keeps a record published into one
|
|
21
|
+
* party's table from verifying in another's. A node signs and verifies with its
|
|
22
|
+
* own party: these records come only from its own party's control database.
|
|
20
23
|
*
|
|
21
24
|
* `publicKey` is deliberately excluded from the payload — it is the key the
|
|
22
25
|
* signature is verified *with* (so a signature already commits to exactly one
|
|
23
26
|
* key), and its binding to `peerId` is checked separately at resolve time.
|
|
24
27
|
*/
|
|
25
|
-
import type {
|
|
26
|
-
import type { PeerAddressRecord, PeerResolveTrustPolicy } from './types.js';
|
|
28
|
+
import type { NodeProfile, PeerAddressRecord, PeerResolveTrustPolicy } from './types.js';
|
|
27
29
|
/**
|
|
28
30
|
* Default freshness ceiling for resolved peer-address records (15 minutes).
|
|
29
31
|
* A record older than this is treated as stale and filtered out, so a resolver
|
|
@@ -42,31 +44,29 @@ export declare const DEFAULT_PEER_RECORD_HEARTBEAT_MS: number;
|
|
|
42
44
|
* base64url output of a single `digest(...)`, which round-trips cleanly (unlike
|
|
43
45
|
* concatenating several base64url digests).
|
|
44
46
|
*
|
|
47
|
+
* @param partyId - the party whose `CadrePeer` table the record is published into
|
|
45
48
|
* @param peerId - base58btc libp2p peer id (the row key)
|
|
46
49
|
* @param multiaddr - the comma-joined `Multiaddr` string EXACTLY as stored
|
|
47
50
|
* @param updatedAt - epoch-ms freshness stamp
|
|
51
|
+
* @param profile - the publisher's node profile; null signs as `''`, as the constraint coalesces it
|
|
48
52
|
*/
|
|
49
|
-
export declare function peerRecordSignedPayload(peerId: string, multiaddr: string, updatedAt: number): string;
|
|
53
|
+
export declare function peerRecordSignedPayload(partyId: string, peerId: string, multiaddr: string, updatedAt: number, profile: NodeProfile | null): string;
|
|
50
54
|
/**
|
|
51
55
|
* Sign a peer-address record with the ed25519 private key behind its `peerId`.
|
|
52
56
|
* Returns a fully-populated {@link PeerAddressRecord} (the `addrs` order is
|
|
53
57
|
* preserved and is the order signed over).
|
|
54
58
|
*
|
|
59
|
+
* @param partyId - the party whose `CadrePeer` table the record is published into
|
|
55
60
|
* @param fields - the record fields to sign (signaling addr first by convention)
|
|
56
61
|
* @param privateKeyB64 - base64url ed25519 seed (see `ed25519KeyPairFromLibp2p`)
|
|
57
62
|
*/
|
|
58
|
-
export declare function signPeerRecord(fields:
|
|
59
|
-
peerId: string;
|
|
60
|
-
publicKey: string;
|
|
61
|
-
addrs: string[];
|
|
62
|
-
updatedAt: number;
|
|
63
|
-
}, privateKeyB64: string): PeerAddressRecord;
|
|
63
|
+
export declare function signPeerRecord(partyId: string, fields: Omit<PeerAddressRecord, 'sig'>, privateKeyB64: string): PeerAddressRecord;
|
|
64
64
|
/**
|
|
65
|
-
* Verify a record's self-signature against its own `publicKey
|
|
66
|
-
* signed bytes from the record exactly as {@link signPeerRecord}
|
|
67
|
-
* Returns false on a missing key/sig or any verification failure.
|
|
65
|
+
* Verify a record's self-signature against its own `publicKey`, for `partyId`.
|
|
66
|
+
* Reconstructs the signed bytes from the record exactly as {@link signPeerRecord}
|
|
67
|
+
* produced them. Returns false on a missing key/sig or any verification failure.
|
|
68
68
|
*/
|
|
69
|
-
export declare function verifyPeerRecordSignature(record: PeerAddressRecord): boolean;
|
|
69
|
+
export declare function verifyPeerRecordSignature(partyId: string, record: PeerAddressRecord): boolean;
|
|
70
70
|
/**
|
|
71
71
|
* Freshness predicate: true when `updatedAt` is a positive stamp within
|
|
72
72
|
* `maxAgeMs` of `now`. A non-positive `updatedAt` (never self-published) is
|
|
@@ -75,41 +75,6 @@ export declare function verifyPeerRecordSignature(record: PeerAddressRecord): bo
|
|
|
75
75
|
export declare function isPeerRecordFresh(updatedAt: number, maxAgeMs: number, now: number): boolean;
|
|
76
76
|
/** True if `addr` is a `/p2p-circuit` signaling/relay multiaddr. */
|
|
77
77
|
export declare function isSignalingAddr(addr: string): boolean;
|
|
78
|
-
/**
|
|
79
|
-
* The peer id a multiaddr terminates in, or `null` when it names none.
|
|
80
|
-
*
|
|
81
|
-
* The LAST `/p2p/` component is the dial target: a circuit address
|
|
82
|
-
* (`…/p2p/<relay>/p2p-circuit/p2p/<target>`) names the relay first and the peer
|
|
83
|
-
* being reached last. Replaces the deprecated `Multiaddr.getPeerId()`, which
|
|
84
|
-
* cannot express that distinction.
|
|
85
|
-
*/
|
|
86
|
-
export declare function trailingPeerId(addr: Multiaddr): string | null;
|
|
87
|
-
/**
|
|
88
|
-
* `addr` guaranteed to terminate in `/p2p/<peerId>` — the shape every dial path
|
|
89
|
-
* needs — or `null` when it cannot, because the address already terminates in a
|
|
90
|
-
* DIFFERENT peer id and therefore does not reach `peerId` at all.
|
|
91
|
-
*
|
|
92
|
-
* Three input shapes, matching what a `CadrePeer` record can legitimately carry:
|
|
93
|
-
*
|
|
94
|
-
* - no `/p2p/` component (`/ip4/1.2.3.4/tcp/4001`) — the suffix is appended;
|
|
95
|
-
* - a relay hop with the destination missing (`…/p2p/<relay>/p2p-circuit`) — the
|
|
96
|
-
* last component is the circuit, not a peer id, so the suffix is appended and
|
|
97
|
-
* the address becomes the full `…/p2p/<relay>/p2p-circuit/p2p/<peerId>`;
|
|
98
|
-
* - already terminating in `/p2p/<X>` — returned untouched when `X` is `peerId`,
|
|
99
|
-
* dropped otherwise.
|
|
100
|
-
*
|
|
101
|
-
* This is deliberately the same rule libp2p applies internally in
|
|
102
|
-
* `calculateMultiaddrs` (append when the LAST component is not `p2p`) followed by
|
|
103
|
-
* its wrong-peer-id filter, so a normalized list matches what libp2p would have
|
|
104
|
-
* built anyway. Normalizing before the dial is what keeps a list from mixing
|
|
105
|
-
* suffixed and unsuffixed entries, which `getPeerAddress` rejects outright
|
|
106
|
-
* ("Multiaddrs must all have the same peer id or have no peer id") — taking the
|
|
107
|
-
* whole peer down with it, not just the odd address.
|
|
108
|
-
*
|
|
109
|
-
* Never use before signature verification: verification runs against the
|
|
110
|
-
* original on-record strings.
|
|
111
|
-
*/
|
|
112
|
-
export declare function withTrailingPeerId(addr: Multiaddr, peerId: string): Multiaddr | null;
|
|
113
78
|
/**
|
|
114
79
|
* Return `addrs` with signaling (`/p2p-circuit`) addrs first, otherwise stable.
|
|
115
80
|
* Used to present the WebRTC dial input ahead of direct addrs. Does NOT mutate
|
package/dist/peer-record.js
CHANGED
|
@@ -8,15 +8,18 @@
|
|
|
8
8
|
* multi-field encoding, so no field split is ambiguous. It is intentionally NOT
|
|
9
9
|
* JSON-canonicalized (deterministic across node/browser/RN, no key ordering)
|
|
10
10
|
* and — crucially — is reconstructable inside the `CadrePeer.AuthorizedUpdate`
|
|
11
|
-
* SQL constraint from the row's own columns
|
|
11
|
+
* SQL constraint from the row's own columns and the node-local `party_id()`:
|
|
12
12
|
*
|
|
13
|
-
* digest('CadreControl.CadrePeer', 'publish',
|
|
14
|
-
* new.PeerId, new.Multiaddr, cast(new.UpdatedAt as text)
|
|
13
|
+
* digest('CadreControl.CadrePeer', 'publish', party_id(),
|
|
14
|
+
* new.PeerId, new.Multiaddr, cast(new.UpdatedAt as text),
|
|
15
|
+
* coalesce(new.Profile, ''))
|
|
15
16
|
*
|
|
16
17
|
* Keep {@link peerRecordSignedPayload} and that constraint byte-for-byte in
|
|
17
18
|
* sync. The `'publish'` action tag marks this as a peer's SELF-signed record
|
|
18
19
|
* (signed with the peer's own key, not an owner key) and keeps it disjoint from
|
|
19
|
-
* every owner-signed digest
|
|
20
|
+
* every owner-signed digest; the party id keeps a record published into one
|
|
21
|
+
* party's table from verifying in another's. A node signs and verifies with its
|
|
22
|
+
* own party: these records come only from its own party's control database.
|
|
20
23
|
*
|
|
21
24
|
* `publicKey` is deliberately excluded from the payload — it is the key the
|
|
22
25
|
* signature is verified *with* (so a signature already commits to exactly one
|
|
@@ -44,12 +47,14 @@ const SIGNALING_PREFIX = '/p2p-circuit';
|
|
|
44
47
|
* base64url output of a single `digest(...)`, which round-trips cleanly (unlike
|
|
45
48
|
* concatenating several base64url digests).
|
|
46
49
|
*
|
|
50
|
+
* @param partyId - the party whose `CadrePeer` table the record is published into
|
|
47
51
|
* @param peerId - base58btc libp2p peer id (the row key)
|
|
48
52
|
* @param multiaddr - the comma-joined `Multiaddr` string EXACTLY as stored
|
|
49
53
|
* @param updatedAt - epoch-ms freshness stamp
|
|
54
|
+
* @param profile - the publisher's node profile; null signs as `''`, as the constraint coalesces it
|
|
50
55
|
*/
|
|
51
|
-
export function peerRecordSignedPayload(peerId, multiaddr, updatedAt) {
|
|
52
|
-
const fields = controlAuthorizationFields('CadreControl.CadrePeer', 'publish', [peerId, multiaddr, String(updatedAt)]);
|
|
56
|
+
export function peerRecordSignedPayload(partyId, peerId, multiaddr, updatedAt, profile) {
|
|
57
|
+
const fields = controlAuthorizationFields('CadreControl.CadrePeer', 'publish', partyId, [peerId, multiaddr, String(updatedAt), profile ?? '']);
|
|
53
58
|
return digest(fields, 'sha256', 'base64url');
|
|
54
59
|
}
|
|
55
60
|
/**
|
|
@@ -57,24 +62,25 @@ export function peerRecordSignedPayload(peerId, multiaddr, updatedAt) {
|
|
|
57
62
|
* Returns a fully-populated {@link PeerAddressRecord} (the `addrs` order is
|
|
58
63
|
* preserved and is the order signed over).
|
|
59
64
|
*
|
|
65
|
+
* @param partyId - the party whose `CadrePeer` table the record is published into
|
|
60
66
|
* @param fields - the record fields to sign (signaling addr first by convention)
|
|
61
67
|
* @param privateKeyB64 - base64url ed25519 seed (see `ed25519KeyPairFromLibp2p`)
|
|
62
68
|
*/
|
|
63
|
-
export function signPeerRecord(fields, privateKeyB64) {
|
|
64
|
-
const payloadDigest = peerRecordSignedPayload(fields.peerId, fields.addrs.join(','), fields.updatedAt);
|
|
69
|
+
export function signPeerRecord(partyId, fields, privateKeyB64) {
|
|
70
|
+
const payloadDigest = peerRecordSignedPayload(partyId, fields.peerId, fields.addrs.join(','), fields.updatedAt, fields.profile);
|
|
65
71
|
const sig = sign(payloadDigest, privateKeyB64, 'ed25519', 'base64url', 'base64url', 'base64url');
|
|
66
|
-
return { peerId: fields.peerId, publicKey: fields.publicKey, addrs: [...fields.addrs], updatedAt: fields.updatedAt, sig };
|
|
72
|
+
return { peerId: fields.peerId, publicKey: fields.publicKey, addrs: [...fields.addrs], updatedAt: fields.updatedAt, profile: fields.profile, sig };
|
|
67
73
|
}
|
|
68
74
|
/**
|
|
69
|
-
* Verify a record's self-signature against its own `publicKey
|
|
70
|
-
* signed bytes from the record exactly as {@link signPeerRecord}
|
|
71
|
-
* Returns false on a missing key/sig or any verification failure.
|
|
75
|
+
* Verify a record's self-signature against its own `publicKey`, for `partyId`.
|
|
76
|
+
* Reconstructs the signed bytes from the record exactly as {@link signPeerRecord}
|
|
77
|
+
* produced them. Returns false on a missing key/sig or any verification failure.
|
|
72
78
|
*/
|
|
73
|
-
export function verifyPeerRecordSignature(record) {
|
|
79
|
+
export function verifyPeerRecordSignature(partyId, record) {
|
|
74
80
|
if (!record.publicKey || !record.sig) {
|
|
75
81
|
return false;
|
|
76
82
|
}
|
|
77
|
-
const payloadDigest = peerRecordSignedPayload(record.peerId, record.addrs.join(','), record.updatedAt);
|
|
83
|
+
const payloadDigest = peerRecordSignedPayload(partyId, record.peerId, record.addrs.join(','), record.updatedAt, record.profile);
|
|
78
84
|
return verify(payloadDigest, record.sig, record.publicKey, 'ed25519', 'base64url', 'base64url', 'base64url');
|
|
79
85
|
}
|
|
80
86
|
/**
|
|
@@ -92,50 +98,6 @@ export function isPeerRecordFresh(updatedAt, maxAgeMs, now) {
|
|
|
92
98
|
export function isSignalingAddr(addr) {
|
|
93
99
|
return addr.includes(SIGNALING_PREFIX);
|
|
94
100
|
}
|
|
95
|
-
/**
|
|
96
|
-
* The peer id a multiaddr terminates in, or `null` when it names none.
|
|
97
|
-
*
|
|
98
|
-
* The LAST `/p2p/` component is the dial target: a circuit address
|
|
99
|
-
* (`…/p2p/<relay>/p2p-circuit/p2p/<target>`) names the relay first and the peer
|
|
100
|
-
* being reached last. Replaces the deprecated `Multiaddr.getPeerId()`, which
|
|
101
|
-
* cannot express that distinction.
|
|
102
|
-
*/
|
|
103
|
-
export function trailingPeerId(addr) {
|
|
104
|
-
const p2p = addr.getComponents().filter((c) => c.name === 'p2p');
|
|
105
|
-
return p2p.length > 0 ? (p2p[p2p.length - 1].value ?? null) : null;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* `addr` guaranteed to terminate in `/p2p/<peerId>` — the shape every dial path
|
|
109
|
-
* needs — or `null` when it cannot, because the address already terminates in a
|
|
110
|
-
* DIFFERENT peer id and therefore does not reach `peerId` at all.
|
|
111
|
-
*
|
|
112
|
-
* Three input shapes, matching what a `CadrePeer` record can legitimately carry:
|
|
113
|
-
*
|
|
114
|
-
* - no `/p2p/` component (`/ip4/1.2.3.4/tcp/4001`) — the suffix is appended;
|
|
115
|
-
* - a relay hop with the destination missing (`…/p2p/<relay>/p2p-circuit`) — the
|
|
116
|
-
* last component is the circuit, not a peer id, so the suffix is appended and
|
|
117
|
-
* the address becomes the full `…/p2p/<relay>/p2p-circuit/p2p/<peerId>`;
|
|
118
|
-
* - already terminating in `/p2p/<X>` — returned untouched when `X` is `peerId`,
|
|
119
|
-
* dropped otherwise.
|
|
120
|
-
*
|
|
121
|
-
* This is deliberately the same rule libp2p applies internally in
|
|
122
|
-
* `calculateMultiaddrs` (append when the LAST component is not `p2p`) followed by
|
|
123
|
-
* its wrong-peer-id filter, so a normalized list matches what libp2p would have
|
|
124
|
-
* built anyway. Normalizing before the dial is what keeps a list from mixing
|
|
125
|
-
* suffixed and unsuffixed entries, which `getPeerAddress` rejects outright
|
|
126
|
-
* ("Multiaddrs must all have the same peer id or have no peer id") — taking the
|
|
127
|
-
* whole peer down with it, not just the odd address.
|
|
128
|
-
*
|
|
129
|
-
* Never use before signature verification: verification runs against the
|
|
130
|
-
* original on-record strings.
|
|
131
|
-
*/
|
|
132
|
-
export function withTrailingPeerId(addr, peerId) {
|
|
133
|
-
const components = addr.getComponents();
|
|
134
|
-
if (components[components.length - 1]?.name !== 'p2p') {
|
|
135
|
-
return addr.encapsulate(`/p2p/${peerId}`);
|
|
136
|
-
}
|
|
137
|
-
return trailingPeerId(addr) === peerId ? addr : null;
|
|
138
|
-
}
|
|
139
101
|
/**
|
|
140
102
|
* Return `addrs` with signaling (`/p2p-circuit`) addrs first, otherwise stable.
|
|
141
103
|
* Used to present the WebRTC dial input ahead of direct addrs. Does NOT mutate
|
package/dist/peer-record.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peer-record.js","sourceRoot":"","sources":["../src/peer-record.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"peer-record.js","sourceRoot":"","sources":["../src/peer-record.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAGxE;;;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