@serfab/cadre-core 1.6.0 → 1.8.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 +8 -6
- package/dist/cadre-node.d.ts +548 -137
- package/dist/cadre-node.js +1208 -383
- 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 +6 -0
- package/dist/control-cohort.js +6 -0
- package/dist/control-cohort.js.map +1 -1
- package/dist/control-database.d.ts +46 -8
- package/dist/control-database.js +97 -18
- package/dist/control-database.js.map +1 -1
- package/dist/control-formation-recorder.d.ts +37 -14
- package/dist/control-formation-recorder.js +60 -10
- package/dist/control-formation-recorder.js.map +1 -1
- package/dist/control-read-retry.d.ts +13 -12
- package/dist/control-read-retry.js +14 -12
- package/dist/control-read-retry.js.map +1 -1
- package/dist/control-schema.d.ts +1 -1
- package/dist/control-schema.js +67 -5
- package/dist/control-schema.js.map +1 -1
- package/dist/control-stream.d.ts +9 -1
- package/dist/control-stream.js +24 -1
- package/dist/control-stream.js.map +1 -1
- package/dist/control-write-retry.d.ts +12 -2
- package/dist/control-write-retry.js +13 -2
- package/dist/control-write-retry.js.map +1 -1
- package/dist/delegate-admission.d.ts +11 -8
- package/dist/delegate-admission.js +19 -11
- package/dist/delegate-admission.js.map +1 -1
- package/dist/diagnostics/connection-path.d.ts +0 -7
- package/dist/diagnostics/connection-path.js +0 -7
- package/dist/diagnostics/connection-path.js.map +1 -1
- package/dist/formation-approval.d.ts +7 -0
- package/dist/formation-approval.js +9 -3
- package/dist/formation-approval.js.map +1 -1
- package/dist/fs-atomic.d.ts +11 -2
- package/dist/fs-atomic.js +13 -3
- package/dist/fs-atomic.js.map +1 -1
- package/dist/hibernation-manager.d.ts +111 -8
- package/dist/hibernation-manager.js +234 -49
- package/dist/hibernation-manager.js.map +1 -1
- package/dist/index.d.ts +13 -6
- package/dist/index.js +27 -5
- package/dist/index.js.map +1 -1
- package/dist/joined-strand-store.d.ts +177 -0
- package/dist/joined-strand-store.js +431 -0
- package/dist/joined-strand-store.js.map +1 -0
- package/dist/key-store-file.js +14 -5
- package/dist/key-store-file.js.map +1 -1
- package/dist/key-store.d.ts +6 -0
- package/dist/key-store.js.map +1 -1
- package/dist/link-budget.d.ts +367 -69
- package/dist/link-budget.js +375 -72
- package/dist/link-budget.js.map +1 -1
- package/dist/membership-connection-gater.d.ts +30 -43
- package/dist/membership-connection-gater.js +31 -42
- package/dist/membership-connection-gater.js.map +1 -1
- package/dist/node-local-snapshot.d.ts +5 -4
- package/dist/node-local-snapshot.js +6 -3
- package/dist/node-local-snapshot.js.map +1 -1
- package/dist/peer-dial.d.ts +24 -4
- package/dist/peer-dial.js +74 -5
- package/dist/peer-dial.js.map +1 -1
- package/dist/peer-join-backfill.d.ts +35 -15
- package/dist/peer-join-backfill.js +115 -55
- package/dist/peer-join-backfill.js.map +1 -1
- package/dist/push-fanout.d.ts +6 -0
- package/dist/push-fanout.js +6 -0
- package/dist/push-fanout.js.map +1 -1
- package/dist/relay-reservation.d.ts +3 -1
- package/dist/relay-reservation.js +3 -1
- package/dist/relay-reservation.js.map +1 -1
- package/dist/relay-server.d.ts +79 -0
- package/dist/relay-server.js +74 -0
- package/dist/relay-server.js.map +1 -0
- package/dist/seed-bootstrap.d.ts +57 -4
- package/dist/seed-bootstrap.js +107 -83
- package/dist/seed-bootstrap.js.map +1 -1
- package/dist/storage-scope.d.ts +33 -17
- package/dist/storage-scope.js +44 -23
- package/dist/storage-scope.js.map +1 -1
- package/dist/strand-addr-protocol.d.ts +58 -21
- package/dist/strand-addr-protocol.js +133 -85
- package/dist/strand-addr-protocol.js.map +1 -1
- package/dist/strand-database.d.ts +20 -2
- package/dist/strand-database.js +42 -5
- package/dist/strand-database.js.map +1 -1
- package/dist/strand-first-sync-gate.d.ts +59 -21
- package/dist/strand-first-sync-gate.js +58 -19
- package/dist/strand-first-sync-gate.js.map +1 -1
- package/dist/strand-formation-deadlines.d.ts +151 -0
- package/dist/strand-formation-deadlines.js +171 -0
- package/dist/strand-formation-deadlines.js.map +1 -0
- package/dist/strand-formation-manager.d.ts +63 -30
- package/dist/strand-formation-manager.js +67 -41
- package/dist/strand-formation-manager.js.map +1 -1
- package/dist/strand-formation-protocol.d.ts +45 -35
- package/dist/strand-formation-protocol.js +59 -122
- package/dist/strand-formation-protocol.js.map +1 -1
- package/dist/strand-instance-manager.d.ts +152 -6
- package/dist/strand-instance-manager.js +331 -42
- package/dist/strand-instance-manager.js.map +1 -1
- package/dist/strand-membership-writer.d.ts +6 -0
- package/dist/strand-membership-writer.js +11 -0
- package/dist/strand-membership-writer.js.map +1 -1
- package/dist/strand-peer-book-file.d.ts +12 -0
- package/dist/strand-peer-book-file.js +37 -0
- package/dist/strand-peer-book-file.js.map +1 -0
- package/dist/strand-peer-book-protocol.d.ts +168 -0
- package/dist/strand-peer-book-protocol.js +356 -0
- package/dist/strand-peer-book-protocol.js.map +1 -0
- package/dist/strand-peer-book-swap.d.ts +104 -0
- package/dist/strand-peer-book-swap.js +284 -0
- package/dist/strand-peer-book-swap.js.map +1 -0
- package/dist/strand-peer-book.d.ts +159 -0
- package/dist/strand-peer-book.js +361 -0
- package/dist/strand-peer-book.js.map +1 -0
- package/dist/strand-peer-observer.d.ts +88 -0
- package/dist/strand-peer-observer.js +180 -0
- package/dist/strand-peer-observer.js.map +1 -0
- package/dist/strand-revocation-enforcer.js +2 -1
- package/dist/strand-revocation-enforcer.js.map +1 -1
- package/dist/strand-solicitation.d.ts +36 -20
- package/dist/strand-solicitation.js +4 -4
- package/dist/strand-solicitation.js.map +1 -1
- package/dist/strand-wake-protocol.d.ts +80 -23
- package/dist/strand-wake-protocol.js +89 -64
- package/dist/strand-wake-protocol.js.map +1 -1
- package/dist/types.d.ts +181 -33
- package/dist/types.js +4 -3
- package/dist/types.js.map +1 -1
- package/package.json +11 -7
- package/src/cadre-node.ts +1316 -398
- package/src/control-authorization.ts +2 -1
- package/src/control-cohort.ts +6 -0
- package/src/control-database.ts +122 -18
- package/src/control-formation-recorder.ts +354 -305
- package/src/control-read-retry.ts +14 -12
- package/src/control-schema.ts +67 -5
- package/src/control-stream.ts +25 -1
- package/src/control-write-retry.ts +13 -2
- package/src/delegate-admission.ts +23 -13
- package/src/diagnostics/connection-path.ts +0 -7
- package/src/formation-approval.ts +610 -604
- package/src/fs-atomic.ts +14 -4
- package/src/hibernation-manager.ts +638 -437
- package/src/index.ts +91 -6
- package/src/joined-strand-store.ts +498 -0
- package/src/key-store-file.ts +14 -5
- package/src/key-store.ts +6 -0
- package/src/link-budget.ts +393 -74
- package/src/membership-connection-gater.ts +31 -45
- package/src/node-local-snapshot.ts +293 -289
- package/src/peer-dial.ts +81 -7
- package/src/peer-join-backfill.ts +120 -57
- package/src/push-fanout.ts +6 -0
- package/src/relay-reservation.ts +3 -1
- package/src/relay-server.ts +98 -0
- package/src/seed-bootstrap.ts +133 -91
- package/src/storage-scope.ts +44 -23
- package/src/strand-addr-protocol.ts +547 -458
- package/src/strand-database.ts +287 -242
- package/src/strand-first-sync-gate.ts +58 -19
- package/src/strand-formation-deadlines.ts +227 -0
- package/src/strand-formation-manager.ts +700 -647
- package/src/strand-formation-protocol.ts +103 -150
- package/src/strand-instance-manager.ts +387 -45
- package/src/strand-membership-writer.ts +12 -0
- package/src/strand-peer-book-file.ts +39 -0
- package/src/strand-peer-book-protocol.ts +466 -0
- package/src/strand-peer-book-swap.ts +338 -0
- package/src/strand-peer-book.ts +475 -0
- package/src/strand-peer-observer.ts +235 -0
- package/src/strand-revocation-enforcer.ts +2 -1
- package/src/strand-solicitation.ts +519 -500
- package/src/strand-wake-protocol.ts +401 -355
- package/src/types.ts +185 -33
|
@@ -14,12 +14,14 @@ export declare const MEMBERSHIP_INVITE_TTL_MS: number;
|
|
|
14
14
|
/**
|
|
15
15
|
* Rejection reason for a bound CLOSED-strand redemption whose responder could not issue
|
|
16
16
|
* the joiner's membership invitation — the host strand runtime not live on this
|
|
17
|
-
* responder,
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* a
|
|
17
|
+
* responder (never launched, mid-start, or a hibernating one that did not wake within the
|
|
18
|
+
* provisioning budget; a hibernating runtime is woken, not refused), no party identity key
|
|
19
|
+
* yet, or the strand DB refusing the `Strand.Invite` write. Retryable on purpose, and
|
|
20
|
+
* rejected BEFORE the consent row is recorded, so the formation token stays unspent:
|
|
21
|
+
* approving without an invitation would admit a joiner that looks joined but can never
|
|
22
|
+
* become a member, and a responder not running the strand cannot serve the joiner's sync
|
|
23
|
+
* anyway. The one permanent failure, a pre-split host strand, gets
|
|
24
|
+
* {@link HOST_STRAND_MUST_BE_RECREATED_REASON} instead.
|
|
23
25
|
*/
|
|
24
26
|
export declare const MEMBERSHIP_INVITE_UNAVAILABLE_REASON = "Strand membership invitation unavailable, retry";
|
|
25
27
|
/**
|
|
@@ -31,20 +33,36 @@ export declare const MEMBERSHIP_INVITE_UNAVAILABLE_REASON = "Strand membership i
|
|
|
31
33
|
* the formation token stays unspent.
|
|
32
34
|
*/
|
|
33
35
|
export declare const HOST_STRAND_MUST_BE_RECREATED_REASON = "Host strand must be recreated";
|
|
36
|
+
/**
|
|
37
|
+
* Responder-side seam that issues a bound joiner's membership invitation — see
|
|
38
|
+
* {@link StrandFormationManagerOptions.issueMembershipInvite} for the contract. `signal`
|
|
39
|
+
* is the responder's provisioning budget: the issuer stops waiting (and throws) once it
|
|
40
|
+
* aborts.
|
|
41
|
+
*/
|
|
42
|
+
export type MembershipInviteIssuer = (strandId: string, signal?: AbortSignal) => Promise<StrandMembershipInvite | null>;
|
|
34
43
|
/**
|
|
35
44
|
* Configuration for StrandFormationManager
|
|
36
45
|
*/
|
|
37
46
|
export interface StrandFormationManagerConfig {
|
|
38
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* This machine's declared link round trip (`NetworkConfig.linkRoundTripMs`), from which
|
|
49
|
+
* every formation deadline is derived (`formationDeadlines` in
|
|
50
|
+
* `strand-formation-deadlines.ts`). `CadreNode` fills it from its network config; the
|
|
51
|
+
* fields below override single rungs of that ladder.
|
|
52
|
+
*/
|
|
53
|
+
linkRoundTripMs?: number;
|
|
54
|
+
/** Whole-session budget, both roles, in milliseconds. */
|
|
39
55
|
sessionTimeoutMs?: number;
|
|
40
|
-
/**
|
|
56
|
+
/** The responder's contact-frame read, in milliseconds. */
|
|
41
57
|
stepTimeoutMs?: number;
|
|
58
|
+
/** The initiator's dial-connect (open the connection, negotiate the protocol), in milliseconds. */
|
|
59
|
+
dialTimeoutMs?: number;
|
|
42
60
|
/**
|
|
43
61
|
* Provisioning budget in milliseconds for the RESPONDER's `provisionStrand` hook call.
|
|
44
|
-
* The initiator's `await-response` wait is derived automatically from this value plus
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
62
|
+
* The initiator's `await-response` wait is derived automatically from this value plus the
|
|
63
|
+
* travel margin of the derived ladder (`responseTravelMarginMs`) — never set directly — so
|
|
64
|
+
* the ordering documented there (approval hook < responder provisioning < initiator
|
|
65
|
+
* await-response < session) cannot collapse when this is configured.
|
|
48
66
|
*/
|
|
49
67
|
provisionTimeoutMs?: number;
|
|
50
68
|
/** Maximum concurrent sessions */
|
|
@@ -97,11 +115,15 @@ export interface StrandFormationManagerOptions {
|
|
|
97
115
|
* `PreSplitStrandIdentityError` for a host strand that can never issue one; that maps
|
|
98
116
|
* to the non-retryable {@link HOST_STRAND_MUST_BE_RECREATED_REASON}.
|
|
99
117
|
*
|
|
118
|
+
* A hibernating host runtime is not a reason to throw: the issuer wakes it first,
|
|
119
|
+
* bounded by `signal` (the responder's provisioning budget), and throws only when the
|
|
120
|
+
* wake does not finish in time or fails.
|
|
121
|
+
*
|
|
100
122
|
* Left unwired — mock/transport tests — the bound path approves with no invitation,
|
|
101
123
|
* mirroring the unwired {@link resolveStrandAddrs} posture. Production
|
|
102
124
|
* (`CadreNode.initializeStrandSolicitation`) always wires it.
|
|
103
125
|
*/
|
|
104
|
-
issueMembershipInvite?:
|
|
126
|
+
issueMembershipInvite?: MembershipInviteIssuer;
|
|
105
127
|
/** Configuration options */
|
|
106
128
|
config?: StrandFormationManagerConfig;
|
|
107
129
|
}
|
|
@@ -136,11 +158,11 @@ export declare class StrandFormationManager {
|
|
|
136
158
|
* Register this manager as a protocol handler on a libp2p node.
|
|
137
159
|
* Call this on the control network node to handle incoming formation requests.
|
|
138
160
|
*/
|
|
139
|
-
registerResponder(node: Libp2p, protocolId?: string): void
|
|
161
|
+
registerResponder(node: Libp2p, protocolId?: string): Promise<void>;
|
|
140
162
|
/**
|
|
141
163
|
* Unregister the protocol handler from a libp2p node.
|
|
142
164
|
*/
|
|
143
|
-
unregisterResponder(node: Libp2p, protocolId?: string): void
|
|
165
|
+
unregisterResponder(node: Libp2p, protocolId?: string): Promise<void>;
|
|
144
166
|
/**
|
|
145
167
|
* Form a strand with a responder via an open invitation (initiator side).
|
|
146
168
|
*
|
|
@@ -171,12 +193,13 @@ export declare class StrandFormationManager {
|
|
|
171
193
|
private membershipInviteFrom;
|
|
172
194
|
/**
|
|
173
195
|
* Derive the initiator's await-response budget from the configured RESPONDER budget —
|
|
174
|
-
* never the same number (see `StrandFormationManagerConfig.provisionTimeoutMs`)
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
196
|
+
* never the same number (see `StrandFormationManagerConfig.provisionTimeoutMs`): the
|
|
197
|
+
* configured value plus the travel margin the ladder derives at this machine's link.
|
|
198
|
+
* Mirrors `resolveProvisionTimeoutMs`'s own "`0`/negative means unset" rule so an unset
|
|
199
|
+
* config still lets both sides fall back to their own derived defaults; must NOT
|
|
200
|
+
* reproduce the derived default here, or the per-role clamping downstream is defeated.
|
|
178
201
|
* A value too large for the session is clamped per role, and the responder's ceiling holds
|
|
179
|
-
* the
|
|
202
|
+
* the margin back, so the ordering survives there too.
|
|
180
203
|
*/
|
|
181
204
|
private initiatorProvisionTimeoutMs;
|
|
182
205
|
private validateToken;
|
|
@@ -187,14 +210,16 @@ export declare class StrandFormationManager {
|
|
|
187
210
|
* {@link ResponderProvisionOutcome} with `approved: false` — `runSession` turns that
|
|
188
211
|
* into a clean, non-disclosing reply instead of a dropped result frame.
|
|
189
212
|
*
|
|
190
|
-
* - **bound** (host strand present): provision-then-record
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
213
|
+
* - **bound** (host strand present): provision-then-record, in three steps —
|
|
214
|
+
* (1) authorize ({@link authorizeBoundUsage}: the outside approval when the invite
|
|
215
|
+
* demands one, and a seat pre-check), so a refused join writes nothing into the host
|
|
216
|
+
* strand; (2) issue the joiner's single-use strand membership invitation via the wired
|
|
217
|
+
* `issueMembershipInvite` seam ({@link issueBoundMembershipInvite}; a closed strand whose
|
|
218
|
+
* invitation cannot be issued rejects retryably HERE, before any consent row spends the
|
|
219
|
+
* token); (3) write the single `FormationUsage` consent row against the pre-existing
|
|
220
|
+
* strand (record-only) and return it + its membership key + the invitation (all
|
|
221
|
+
* read-gating secrets disclosed only here, behind the token + disclosure validation
|
|
222
|
+
* `runSession` already enforced).
|
|
198
223
|
* - **missing** (invite names a host strand absent on this responder, e.g. unconverged):
|
|
199
224
|
* reject cleanly + retryably, writing NO usage row — recording usage here would fail the
|
|
200
225
|
* deferred `StrandExists` CHECK at commit and drop the frame.
|
|
@@ -213,15 +238,23 @@ export declare class StrandFormationManager {
|
|
|
213
238
|
* not control-flow-by-exception.
|
|
214
239
|
*/
|
|
215
240
|
private provisionAsResponder;
|
|
241
|
+
/**
|
|
242
|
+
* Authorize a BOUND redemption without writing it, through the recorder's optional
|
|
243
|
+
* {@link FormationUsageRecorder.authorizeUsage}. A recorder without it has nothing to ask up
|
|
244
|
+
* front, so its handle defers everything to `recordUsage`.
|
|
245
|
+
*/
|
|
246
|
+
private authorizeBoundUsage;
|
|
216
247
|
/**
|
|
217
248
|
* Issue the joiner's membership invitation for a BOUND redemption via the wired
|
|
218
|
-
* {@link StrandFormationManagerOptions.issueMembershipInvite} seam.
|
|
249
|
+
* {@link StrandFormationManagerOptions.issueMembershipInvite} seam. Runs after the
|
|
250
|
+
* redemption is authorized ({@link authorizeBoundUsage}) and before consent is recorded.
|
|
219
251
|
*
|
|
220
252
|
* - Hook unwired (mock/transport tests): approve with no invitation, the same posture
|
|
221
253
|
* as an unwired `resolveStrandAddrs`.
|
|
222
254
|
* - Hook returns an invitation (closed host strand): carry it on the approval.
|
|
223
255
|
* - Hook returns `null` (open host strand): approve with no invitation.
|
|
224
|
-
* - Hook throws (runtime not live
|
|
256
|
+
* - Hook throws (runtime not live — including a hibernating one whose wake outran
|
|
257
|
+
* `signal` — no party key, strand-DB write rejected): report
|
|
225
258
|
* `ok: false` with {@link MEMBERSHIP_INVITE_UNAVAILABLE_REASON} — the caller rejects
|
|
226
259
|
* BEFORE any consent row is written, so the formation token stays unspent.
|
|
227
260
|
* - Hook throws `PreSplitStrandIdentityError` (the host strand was founded before the
|
|
@@ -6,7 +6,8 @@ import { FormationAbortedError, InvitationExhaustedError } from './control-datab
|
|
|
6
6
|
import { PreSplitStrandIdentityError } from './strand-membership-writer.js';
|
|
7
7
|
import { mintPlaceholderStrandId } from './strand-id.js';
|
|
8
8
|
import { canonicalJson } from './canonical-json.js';
|
|
9
|
-
import { FormationListener, INVALID_TOKEN_REASON,
|
|
9
|
+
import { FormationListener, INVALID_TOKEN_REASON, dialFormation, isValidResponderCreatesResult, isWellFormedMembershipInvite } from './strand-formation-protocol.js';
|
|
10
|
+
import { formationDeadlines } from './strand-formation-deadlines.js';
|
|
10
11
|
const log = debug('sereus:cadre:formation-manager');
|
|
11
12
|
/**
|
|
12
13
|
* Largest serialized disclosure a responder will accept (8 KiB). The disclosure is
|
|
@@ -28,12 +29,14 @@ export const MEMBERSHIP_INVITE_TTL_MS = 7 * 24 * 3600000;
|
|
|
28
29
|
/**
|
|
29
30
|
* Rejection reason for a bound CLOSED-strand redemption whose responder could not issue
|
|
30
31
|
* the joiner's membership invitation — the host strand runtime not live on this
|
|
31
|
-
* responder,
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* a
|
|
32
|
+
* responder (never launched, mid-start, or a hibernating one that did not wake within the
|
|
33
|
+
* provisioning budget; a hibernating runtime is woken, not refused), no party identity key
|
|
34
|
+
* yet, or the strand DB refusing the `Strand.Invite` write. Retryable on purpose, and
|
|
35
|
+
* rejected BEFORE the consent row is recorded, so the formation token stays unspent:
|
|
36
|
+
* approving without an invitation would admit a joiner that looks joined but can never
|
|
37
|
+
* become a member, and a responder not running the strand cannot serve the joiner's sync
|
|
38
|
+
* anyway. The one permanent failure, a pre-split host strand, gets
|
|
39
|
+
* {@link HOST_STRAND_MUST_BE_RECREATED_REASON} instead.
|
|
37
40
|
*/
|
|
38
41
|
export const MEMBERSHIP_INVITE_UNAVAILABLE_REASON = 'Strand membership invitation unavailable, retry';
|
|
39
42
|
/**
|
|
@@ -92,6 +95,7 @@ export class StrandFormationManager {
|
|
|
92
95
|
// Forwarded only when wired, so `FormationListenerOptions.resolveStrandAddrs`
|
|
93
96
|
// stays genuinely absent (and the listener short-circuits) for an unwired manager.
|
|
94
97
|
...(this.resolveStrandAddrs && { resolveStrandAddrs: this.resolveStrandAddrs }),
|
|
98
|
+
linkRoundTripMs: this.config.linkRoundTripMs,
|
|
95
99
|
sessionTimeoutMs: this.config.sessionTimeoutMs,
|
|
96
100
|
stepTimeoutMs: this.config.stepTimeoutMs,
|
|
97
101
|
provisionTimeoutMs: this.config.provisionTimeoutMs,
|
|
@@ -103,23 +107,23 @@ export class StrandFormationManager {
|
|
|
103
107
|
* Register this manager as a protocol handler on a libp2p node.
|
|
104
108
|
* Call this on the control network node to handle incoming formation requests.
|
|
105
109
|
*/
|
|
106
|
-
registerResponder(node, protocolId) {
|
|
110
|
+
async registerResponder(node, protocolId) {
|
|
107
111
|
if (this.registeredNodes.has(node)) {
|
|
108
112
|
log('Node already registered');
|
|
109
113
|
return;
|
|
110
114
|
}
|
|
111
|
-
this.listener.register(node, protocolId ?? this.config.protocolId);
|
|
115
|
+
await this.listener.register(node, protocolId ?? this.config.protocolId);
|
|
112
116
|
this.registeredNodes.add(node);
|
|
113
117
|
log('Registered as responder on node');
|
|
114
118
|
}
|
|
115
119
|
/**
|
|
116
120
|
* Unregister the protocol handler from a libp2p node.
|
|
117
121
|
*/
|
|
118
|
-
unregisterResponder(node, protocolId) {
|
|
122
|
+
async unregisterResponder(node, protocolId) {
|
|
119
123
|
if (!this.registeredNodes.has(node)) {
|
|
120
124
|
return;
|
|
121
125
|
}
|
|
122
|
-
this.listener.unregister(node, protocolId ?? this.config.protocolId);
|
|
126
|
+
await this.listener.unregister(node, protocolId ?? this.config.protocolId);
|
|
123
127
|
this.registeredNodes.delete(node);
|
|
124
128
|
log('Unregistered from node');
|
|
125
129
|
}
|
|
@@ -149,8 +153,9 @@ export class StrandFormationManager {
|
|
|
149
153
|
contact,
|
|
150
154
|
responderAddrs: invitation.bootstrap,
|
|
151
155
|
validateResponse: (response) => this.validateResponse(invitation, disclosure, response),
|
|
156
|
+
linkRoundTripMs: this.config.linkRoundTripMs,
|
|
152
157
|
sessionTimeoutMs: this.config.sessionTimeoutMs,
|
|
153
|
-
|
|
158
|
+
dialTimeoutMs: this.config.dialTimeoutMs,
|
|
154
159
|
provisionTimeoutMs: this.initiatorProvisionTimeoutMs(),
|
|
155
160
|
protocolId: this.config.protocolId
|
|
156
161
|
});
|
|
@@ -200,16 +205,19 @@ export class StrandFormationManager {
|
|
|
200
205
|
}
|
|
201
206
|
/**
|
|
202
207
|
* Derive the initiator's await-response budget from the configured RESPONDER budget —
|
|
203
|
-
* never the same number (see `StrandFormationManagerConfig.provisionTimeoutMs`)
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
208
|
+
* never the same number (see `StrandFormationManagerConfig.provisionTimeoutMs`): the
|
|
209
|
+
* configured value plus the travel margin the ladder derives at this machine's link.
|
|
210
|
+
* Mirrors `resolveProvisionTimeoutMs`'s own "`0`/negative means unset" rule so an unset
|
|
211
|
+
* config still lets both sides fall back to their own derived defaults; must NOT
|
|
212
|
+
* reproduce the derived default here, or the per-role clamping downstream is defeated.
|
|
207
213
|
* A value too large for the session is clamped per role, and the responder's ceiling holds
|
|
208
|
-
* the
|
|
214
|
+
* the margin back, so the ordering survives there too.
|
|
209
215
|
*/
|
|
210
216
|
initiatorProvisionTimeoutMs() {
|
|
211
217
|
const host = this.config.provisionTimeoutMs;
|
|
212
|
-
return host && host > 0
|
|
218
|
+
return host && host > 0
|
|
219
|
+
? host + formationDeadlines(this.config.linkRoundTripMs).responseTravelMarginMs
|
|
220
|
+
: undefined;
|
|
213
221
|
}
|
|
214
222
|
// ── Responder-side hooks ─────────────────────────────────────────────────────
|
|
215
223
|
async validateToken(token) {
|
|
@@ -241,14 +249,16 @@ export class StrandFormationManager {
|
|
|
241
249
|
* {@link ResponderProvisionOutcome} with `approved: false` — `runSession` turns that
|
|
242
250
|
* into a clean, non-disclosing reply instead of a dropped result frame.
|
|
243
251
|
*
|
|
244
|
-
* - **bound** (host strand present): provision-then-record
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
+
* - **bound** (host strand present): provision-then-record, in three steps —
|
|
253
|
+
* (1) authorize ({@link authorizeBoundUsage}: the outside approval when the invite
|
|
254
|
+
* demands one, and a seat pre-check), so a refused join writes nothing into the host
|
|
255
|
+
* strand; (2) issue the joiner's single-use strand membership invitation via the wired
|
|
256
|
+
* `issueMembershipInvite` seam ({@link issueBoundMembershipInvite}; a closed strand whose
|
|
257
|
+
* invitation cannot be issued rejects retryably HERE, before any consent row spends the
|
|
258
|
+
* token); (3) write the single `FormationUsage` consent row against the pre-existing
|
|
259
|
+
* strand (record-only) and return it + its membership key + the invitation (all
|
|
260
|
+
* read-gating secrets disclosed only here, behind the token + disclosure validation
|
|
261
|
+
* `runSession` already enforced).
|
|
252
262
|
* - **missing** (invite names a host strand absent on this responder, e.g. unconverged):
|
|
253
263
|
* reject cleanly + retryably, writing NO usage row — recording usage here would fail the
|
|
254
264
|
* deferred `StrandExists` CHECK at commit and drop the frame.
|
|
@@ -284,18 +294,8 @@ export class StrandFormationManager {
|
|
|
284
294
|
try {
|
|
285
295
|
switch (resolved.kind) {
|
|
286
296
|
case 'bound': {
|
|
287
|
-
// Issued BEFORE the consent row is recorded, so an issue failure rejects with
|
|
288
|
-
// the formation token still unspent (retryable). The inverse window — invite
|
|
289
|
-
// issued, then recordUsage fails/aborts — orphans a live `Strand.Invite` no
|
|
290
|
-
// joiner ever received; bounded deliberately by its expiry
|
|
291
|
-
// ({@link MEMBERSHIP_INVITE_TTL_MS}) rather than compensated, since nothing
|
|
292
|
-
// here can atomically un-issue a strand-DB row.
|
|
293
|
-
const issued = await this.issueBoundMembershipInvite(token, resolved.strandId);
|
|
294
|
-
if (!issued.ok) {
|
|
295
|
-
return { approved: false, reason: issued.reason };
|
|
296
|
-
}
|
|
297
297
|
// recorder is guaranteed non-null here: only resolveStrand can yield 'bound'.
|
|
298
|
-
await
|
|
298
|
+
const authorized = await this.authorizeBoundUsage(recorder, {
|
|
299
299
|
token,
|
|
300
300
|
peerKey: contact.peerKey,
|
|
301
301
|
peerSignature: contact.peerSignature,
|
|
@@ -304,6 +304,19 @@ export class StrandFormationManager {
|
|
|
304
304
|
disclosure: disclosureText,
|
|
305
305
|
signal
|
|
306
306
|
});
|
|
307
|
+
// Issued only once authorized (a refused join writes nothing into the strand) and
|
|
308
|
+
// BEFORE consent is recorded (an issue failure leaves the token unspent, retryable).
|
|
309
|
+
// The remaining window — invite issued, then record() fails or aborts (a write that
|
|
310
|
+
// exhausted its retries, an abort, or the same-node seat race noted at
|
|
311
|
+
// `ControlFormationUsageRecorder.assertSeatFree`) — orphans a
|
|
312
|
+
// live `Strand.Invite` no joiner ever received; bounded deliberately by its expiry
|
|
313
|
+
// ({@link MEMBERSHIP_INVITE_TTL_MS}) rather than compensated, since nothing
|
|
314
|
+
// here can atomically un-issue a strand-DB row.
|
|
315
|
+
const issued = await this.issueBoundMembershipInvite(token, resolved.strandId, signal);
|
|
316
|
+
if (!issued.ok) {
|
|
317
|
+
return { approved: false, reason: issued.reason };
|
|
318
|
+
}
|
|
319
|
+
await authorized.record();
|
|
307
320
|
return this.approve({
|
|
308
321
|
strand: { strandId: resolved.strandId, createdBy: 'responder' },
|
|
309
322
|
memberPrivateKey: resolved.memberPrivateKey ?? undefined,
|
|
@@ -349,15 +362,28 @@ export class StrandFormationManager {
|
|
|
349
362
|
return { approved: false, reason: 'Formation conflict, retry' };
|
|
350
363
|
}
|
|
351
364
|
}
|
|
365
|
+
/**
|
|
366
|
+
* Authorize a BOUND redemption without writing it, through the recorder's optional
|
|
367
|
+
* {@link FormationUsageRecorder.authorizeUsage}. A recorder without it has nothing to ask up
|
|
368
|
+
* front, so its handle defers everything to `recordUsage`.
|
|
369
|
+
*/
|
|
370
|
+
async authorizeBoundUsage(recorder, params) {
|
|
371
|
+
if (recorder.authorizeUsage) {
|
|
372
|
+
return await recorder.authorizeUsage(params);
|
|
373
|
+
}
|
|
374
|
+
return { record: () => recorder.recordUsage(params) };
|
|
375
|
+
}
|
|
352
376
|
/**
|
|
353
377
|
* Issue the joiner's membership invitation for a BOUND redemption via the wired
|
|
354
|
-
* {@link StrandFormationManagerOptions.issueMembershipInvite} seam.
|
|
378
|
+
* {@link StrandFormationManagerOptions.issueMembershipInvite} seam. Runs after the
|
|
379
|
+
* redemption is authorized ({@link authorizeBoundUsage}) and before consent is recorded.
|
|
355
380
|
*
|
|
356
381
|
* - Hook unwired (mock/transport tests): approve with no invitation, the same posture
|
|
357
382
|
* as an unwired `resolveStrandAddrs`.
|
|
358
383
|
* - Hook returns an invitation (closed host strand): carry it on the approval.
|
|
359
384
|
* - Hook returns `null` (open host strand): approve with no invitation.
|
|
360
|
-
* - Hook throws (runtime not live
|
|
385
|
+
* - Hook throws (runtime not live — including a hibernating one whose wake outran
|
|
386
|
+
* `signal` — no party key, strand-DB write rejected): report
|
|
361
387
|
* `ok: false` with {@link MEMBERSHIP_INVITE_UNAVAILABLE_REASON} — the caller rejects
|
|
362
388
|
* BEFORE any consent row is written, so the formation token stays unspent.
|
|
363
389
|
* - Hook throws `PreSplitStrandIdentityError` (the host strand was founded before the
|
|
@@ -367,12 +393,12 @@ export class StrandFormationManager {
|
|
|
367
393
|
* The LOG-before-reject keeps both a deliberate internal-error→protocol-rejection
|
|
368
394
|
* conversion, same as the catch-all in {@link provisionAsResponder}.
|
|
369
395
|
*/
|
|
370
|
-
async issueBoundMembershipInvite(token, strandId) {
|
|
396
|
+
async issueBoundMembershipInvite(token, strandId, signal) {
|
|
371
397
|
if (!this.issueMembershipInvite) {
|
|
372
398
|
return { ok: true };
|
|
373
399
|
}
|
|
374
400
|
try {
|
|
375
|
-
const invite = await this.issueMembershipInvite(strandId);
|
|
401
|
+
const invite = await this.issueMembershipInvite(strandId, signal);
|
|
376
402
|
return { ok: true, invite: invite ?? undefined };
|
|
377
403
|
}
|
|
378
404
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strand-formation-manager.js","sourceRoot":"","sources":["../src/strand-formation-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAQjE,OAAO,EACL,sBAAsB,EAEvB,MAAM,yBAAyB,CAAC;AACjC,qFAAqF;AACrF,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB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C;YAClB,MAAM,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE;YAC5C,gBAAgB,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE;SAC5D,CAAC,CAAC;IACL,CAAC;IAED,iFAAiF;IACzE,OAAO,CAAC,MAAgC;QAC9C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACpC,CAAC;IAED;;;;OAIG;IACK,KAAK,CAAC,mBAAmB,CAAC,KAAa;QAC7C,IAAI,CAAC,IAAI,CAAC,sBAAsB;YAAE,OAAO,EAAE,CAAC;QAC5C,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QACpE,OAAO,KAAK,CAAC,UAAU,EAAE,MAAM,IAAI,EAAE,CAAC;IACxC,CAAC;IAED,gFAAgF;IAExE,KAAK,CAAC,gBAAgB,CAC5B,UAA0B,EAC1B,UAAqC,EACrC,QAAgC;QAEhC,IAAI,IAAI,CAAC,0BAA0B,EAAE,CAAC;YACpC,OAAO,IAAI,CAAC,0BAA0B,CAAC,gBAAgB,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC;QAChG,CAAC;QACD,OAAO,6BAA6B,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B,CAC1C,OAAsC;IAEtC,OAAO,IAAI,sBAAsB,CAAC,OAAO,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -29,22 +29,6 @@ export declare const FORMATION_PROTOCOL = "/sereus/formation/1.0.0";
|
|
|
29
29
|
* from a non-racing latecomer, so the two sites must never drift apart.
|
|
30
30
|
*/
|
|
31
31
|
export declare const INVALID_TOKEN_REASON = "Invalid token";
|
|
32
|
-
/**
|
|
33
|
-
* Wire-latency margin (ms) added to the responder's provisioning budget to get the
|
|
34
|
-
* initiator's await-response budget — the travel time for the result frame to come back
|
|
35
|
-
* after the responder finishes (see {@link DEFAULT_PROVISION_TIMEOUT_MS}).
|
|
36
|
-
* `StrandFormationManager` reuses this constant so a CONFIGURED budget preserves the same
|
|
37
|
-
* margin the defaults do, instead of applying the same number to both sides and racing the
|
|
38
|
-
* initiator's own timeout against the responder's clean rejection reply. The responder's
|
|
39
|
-
* clamp ({@link provisionCeilingMs}) holds the same margin back, so the ordering survives a
|
|
40
|
-
* budget large enough that BOTH roles get clamped.
|
|
41
|
-
*
|
|
42
|
-
* NOTE: 3 s is a fixed assumption about how long the result frame takes to travel back. If
|
|
43
|
-
* formation ever runs over paths where that frame can take longer (a slow circuit relay, a
|
|
44
|
-
* congested mobile link), the margin is too thin and the initiator's timeout races the
|
|
45
|
-
* responder's reply again — raise it, or derive it from an observed round-trip.
|
|
46
|
-
*/
|
|
47
|
-
export declare const PROVISION_RESPONSE_TRAVEL_MARGIN_MS = 3000;
|
|
48
32
|
/**
|
|
49
33
|
* Cap on the strand-network addresses a formation result carries
|
|
50
34
|
* ({@link FormationResultMessage.strandAddrs}). A node's own strand multiaddrs are a
|
|
@@ -226,14 +210,22 @@ export interface FormationListenerOptions {
|
|
|
226
210
|
* per-strand address lookup.
|
|
227
211
|
*/
|
|
228
212
|
resolveStrandAddrs?(strandId: string): string[];
|
|
213
|
+
/**
|
|
214
|
+
* This machine's declared link round trip (`NetworkConfig.linkRoundTripMs`), from which
|
|
215
|
+
* every deadline below takes its default ({@link formationDeadlines}). The default
|
|
216
|
+
* declaration when omitted.
|
|
217
|
+
*/
|
|
218
|
+
linkRoundTripMs?: number;
|
|
219
|
+
/** Whole-session budget; default `sessionMs` of the derived ladder. */
|
|
229
220
|
sessionTimeoutMs?: number;
|
|
221
|
+
/** Budget for the contact-frame read; default `awaitContactMs` of the derived ladder. */
|
|
230
222
|
stepTimeoutMs?: number;
|
|
231
223
|
/**
|
|
232
|
-
* Budget for the `provisionStrand` hook call — distinct from
|
|
233
|
-
* provisioning is real work, not a bare wire read
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
224
|
+
* Budget for the `provisionStrand` hook call, work plus settle grace — distinct from
|
|
225
|
+
* `stepTimeoutMs` because provisioning is real work, not a bare wire read. Default
|
|
226
|
+
* `provisionWorkMs + provisionGraceMs` of the derived ladder (171 s at the default
|
|
227
|
+
* declaration); `0`/unset uses the default; a value that would outlive the session is
|
|
228
|
+
* clamped ({@link resolveProvisionTimeoutMs}). See {@link formationDeadlines} for the ordering.
|
|
237
229
|
*/
|
|
238
230
|
provisionTimeoutMs?: number;
|
|
239
231
|
maxConcurrentSessions?: number;
|
|
@@ -247,7 +239,7 @@ export interface FormationListenerOptions {
|
|
|
247
239
|
export declare class FormationListener {
|
|
248
240
|
private readonly options;
|
|
249
241
|
private readonly sessionTimeoutMs;
|
|
250
|
-
private readonly
|
|
242
|
+
private readonly awaitContactMs;
|
|
251
243
|
private readonly provisionWorkMs;
|
|
252
244
|
private readonly provisionGraceMs;
|
|
253
245
|
private readonly maxConcurrentSessions;
|
|
@@ -257,12 +249,13 @@ export declare class FormationListener {
|
|
|
257
249
|
constructor(options: FormationListenerOptions);
|
|
258
250
|
/** Number of in-flight inbound sessions. */
|
|
259
251
|
get activeCount(): number;
|
|
260
|
-
|
|
261
|
-
|
|
252
|
+
/** Register the formation handler on `node`. Rejects when libp2p refuses the registration. */
|
|
253
|
+
register(node: Libp2p, protocolId?: string): Promise<void>;
|
|
254
|
+
unregister(node: Libp2p, protocolId?: string): Promise<void>;
|
|
262
255
|
private handleStream;
|
|
263
256
|
/**
|
|
264
|
-
* Run the provisioning hook under its WORK budget — the
|
|
265
|
-
*
|
|
257
|
+
* Run the provisioning hook under its WORK budget — the provisioning budget minus the
|
|
258
|
+
* trailing settle grace ({@link splitProvisionBudget}).
|
|
266
259
|
*
|
|
267
260
|
* When the work budget expires the hook's signal is aborted, then
|
|
268
261
|
* {@link settleWithinGrace} waits out the grace for the aborted work to settle anyway.
|
|
@@ -282,11 +275,16 @@ export declare class FormationListener {
|
|
|
282
275
|
* inside the grace its outcome is ADOPTED — the joiner is told the truth (approved, or the
|
|
283
276
|
* hook's own rejection reason) rather than "timed out" over a spent invite.
|
|
284
277
|
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
*
|
|
278
|
+
* The grace is derived to contain one seat read plus one commit at the declared link
|
|
279
|
+
* ({@link formationDeadlines}), which is exactly what runs after the insert attempt passes
|
|
280
|
+
* its abort check, so at that link the late outcome lands inside it.
|
|
281
|
+
*
|
|
282
|
+
* NOTE: a commit that outlasts even the derived grace (a link slower than declared, or a
|
|
283
|
+
* configured `provisionTimeoutMs` whose half-cap shrank the grace) still tells the joiner
|
|
284
|
+
* 'timed out' while its one-time invite is in fact spent, and since every retry mints a
|
|
285
|
+
* fresh keypair no recovery path can match it. Nothing can un-spend an append-only row, so
|
|
286
|
+
* the late-settle logging below is the observability for it; if it is seen in the wild,
|
|
287
|
+
* raise the declared link rather than this grace.
|
|
290
288
|
*/
|
|
291
289
|
private settleWithinGrace;
|
|
292
290
|
/**
|
|
@@ -319,12 +317,24 @@ export interface FormationDialOptions {
|
|
|
319
317
|
responderAddrs: string[];
|
|
320
318
|
/** Validate the responder's result; a false return aborts the formation. */
|
|
321
319
|
validateResponse(response: FormationResultMessage): Promise<boolean>;
|
|
320
|
+
/**
|
|
321
|
+
* This machine's declared link round trip (`NetworkConfig.linkRoundTripMs`), from which
|
|
322
|
+
* every deadline below takes its default ({@link formationDeadlines}). The default
|
|
323
|
+
* declaration when omitted.
|
|
324
|
+
*/
|
|
325
|
+
linkRoundTripMs?: number;
|
|
326
|
+
/** Whole-session budget; default `sessionMs` of the derived ladder. */
|
|
322
327
|
sessionTimeoutMs?: number;
|
|
323
|
-
stepTimeoutMs?: number;
|
|
324
328
|
/**
|
|
325
|
-
* Budget for
|
|
326
|
-
*
|
|
327
|
-
|
|
329
|
+
* Budget for `dial-connect`: opening the connection, through a relay if need be, and
|
|
330
|
+
* negotiating the formation protocol. Default `dialMs` of the derived ladder.
|
|
331
|
+
*/
|
|
332
|
+
dialTimeoutMs?: number;
|
|
333
|
+
/**
|
|
334
|
+
* Budget for the `await-response` read only (the responder's provisioning plus the reply's
|
|
335
|
+
* travel time). Default `initiatorAwaitResponseMs` of the derived ladder; `0`/unset uses
|
|
336
|
+
* the default; a value that would outlive the session is clamped. See
|
|
337
|
+
* {@link formationDeadlines} for the ordering.
|
|
328
338
|
*/
|
|
329
339
|
provisionTimeoutMs?: number;
|
|
330
340
|
protocolId?: string;
|