@serfab/cadre-core 1.23.0 → 1.24.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 +216 -294
- package/dist/arachnode-stub.d.ts +12 -4
- package/dist/arachnode-stub.js +15 -8
- package/dist/arachnode-stub.js.map +1 -1
- package/dist/cadre-invite-protocol.js +5 -4
- package/dist/cadre-invite-protocol.js.map +1 -1
- package/dist/cadre-node.d.ts +145 -44
- package/dist/cadre-node.js +239 -79
- package/dist/cadre-node.js.map +1 -1
- package/dist/control-authorization.d.ts +14 -2
- package/dist/control-authorization.js +8 -3
- package/dist/control-authorization.js.map +1 -1
- package/dist/control-cohort.d.ts +27 -13
- package/dist/control-cohort.js +21 -14
- package/dist/control-cohort.js.map +1 -1
- package/dist/control-database.d.ts +18 -16
- package/dist/control-database.js +57 -22
- package/dist/control-database.js.map +1 -1
- package/dist/control-protocol-guard.d.ts +1 -1
- package/dist/control-protocol-guard.js +7 -3
- package/dist/control-protocol-guard.js.map +1 -1
- package/dist/control-read-retry.d.ts +49 -11
- package/dist/control-read-retry.js +56 -15
- package/dist/control-read-retry.js.map +1 -1
- package/dist/control-retry.d.ts +32 -3
- package/dist/control-retry.js +35 -4
- package/dist/control-retry.js.map +1 -1
- package/dist/control-schema-version.d.ts +5 -5
- package/dist/control-schema-version.js +5 -5
- package/dist/control-schema-version.js.map +1 -1
- package/dist/control-schema.d.ts +5 -5
- package/dist/control-schema.js +1032 -1011
- package/dist/control-schema.js.map +1 -1
- package/dist/control-write-retry.d.ts +54 -65
- package/dist/control-write-retry.js +134 -158
- package/dist/control-write-retry.js.map +1 -1
- package/dist/delegate-admission.d.ts +1 -1
- package/dist/delegate-admission.js +1 -1
- package/dist/edge-node/config.d.ts +4 -3
- package/dist/edge-node/config.js +11 -9
- package/dist/edge-node/config.js.map +1 -1
- package/dist/edge-node/dissolve.d.ts +4 -4
- package/dist/edge-node/dissolve.js +4 -4
- package/dist/edge-node/edge-join.d.ts +1 -1
- package/dist/edge-node/edge-join.js +1 -1
- package/dist/edge-node/edge-node.js +2 -2
- package/dist/edge-node/edge-node.js.map +1 -1
- package/dist/edge-node/index.d.ts +1 -0
- package/dist/edge-node/index.js +1 -0
- package/dist/edge-node/index.js.map +1 -1
- package/dist/edge-node/join-credential.d.ts +1 -1
- package/dist/edge-node/join-credential.js +1 -1
- package/dist/edge-node/lazy-raw-storage.js +12 -0
- package/dist/edge-node/lazy-raw-storage.js.map +1 -1
- package/dist/edge-node/listen-addrs.d.ts +21 -0
- package/dist/edge-node/listen-addrs.js +25 -0
- package/dist/edge-node/listen-addrs.js.map +1 -0
- package/dist/edge-node/owner-grant.d.ts +1 -1
- package/dist/edge-node/owner-grant.js +1 -1
- package/dist/edge-node/platform.d.ts +5 -4
- package/dist/edge-node/platform.js.map +1 -1
- package/dist/edge-node/strand-move.d.ts +1 -1
- package/dist/edge-node/strand-move.js +1 -1
- package/dist/edge-node/strands.js +27 -11
- package/dist/edge-node/strands.js.map +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.js +18 -7
- package/dist/index.js.map +1 -1
- package/dist/invitation-bootstrap.d.ts +28 -5
- package/dist/invitation-bootstrap.js +41 -8
- package/dist/invitation-bootstrap.js.map +1 -1
- package/dist/link-budget.d.ts +53 -4
- package/dist/link-budget.js +58 -5
- package/dist/link-budget.js.map +1 -1
- package/dist/machine-removal.d.ts +2 -2
- package/dist/machine-removal.js +4 -3
- package/dist/machine-removal.js.map +1 -1
- package/dist/membership-connection-gater.d.ts +2 -2
- package/dist/membership-connection-gater.js +2 -2
- package/dist/membership-view.d.ts +2 -2
- package/dist/membership-view.js +2 -2
- package/dist/node-claim-payload.d.ts +15 -7
- package/dist/node-claim-payload.js +25 -9
- package/dist/node-claim-payload.js.map +1 -1
- package/dist/node-class.d.ts +36 -0
- package/dist/node-class.js +26 -0
- package/dist/node-class.js.map +1 -0
- package/dist/node-default-transports.d.ts +50 -3
- package/dist/node-default-transports.js +48 -3
- package/dist/node-default-transports.js.map +1 -1
- package/dist/node-roles.d.ts +118 -0
- package/dist/node-roles.js +142 -0
- package/dist/node-roles.js.map +1 -0
- package/dist/node-transports.d.ts +6 -2
- package/dist/node-transports.js +39 -7
- package/dist/node-transports.js.map +1 -1
- package/dist/owner-anchor-sync.js +1 -1
- package/dist/owner-key-export.js +1 -1
- package/dist/owner-key-flows.d.ts +1 -1
- package/dist/owner-key-store.js +1 -1
- package/dist/owner-signer.js +1 -1
- package/dist/peer-authorization.d.ts +3 -1
- package/dist/peer-authorization.js +3 -1
- package/dist/peer-authorization.js.map +1 -1
- package/dist/peer-dial.d.ts +74 -10
- package/dist/peer-dial.js +89 -17
- package/dist/peer-dial.js.map +1 -1
- package/dist/peer-join-backfill.js +4 -4
- package/dist/peer-join-backfill.js.map +1 -1
- package/dist/peer-record.d.ts +34 -9
- package/dist/peer-record.js +66 -13
- package/dist/peer-record.js.map +1 -1
- package/dist/pending-join-runner.d.ts +1 -1
- package/dist/pending-join-runner.js +1 -1
- package/dist/provider/client.d.ts +6 -5
- package/dist/provider/client.js +3 -3
- package/dist/provider/client.js.map +1 -1
- package/dist/provider/descriptor.d.ts +1 -1
- package/dist/provider/descriptor.js +1 -1
- package/dist/provider/oauth.d.ts +1 -1
- package/dist/provider/oauth.js +1 -1
- package/dist/provider/rent-node.d.ts +4 -3
- package/dist/provider/rent-node.js +3 -3
- package/dist/provider/rent-node.js.map +1 -1
- package/dist/relay-addrs.d.ts +62 -7
- package/dist/relay-addrs.js +74 -11
- package/dist/relay-addrs.js.map +1 -1
- package/dist/relay-reservation.d.ts +1 -1
- package/dist/relay-reservation.js +1 -1
- package/dist/relay-server.d.ts +6 -5
- package/dist/relay-server.js +5 -5
- package/dist/relay-server.js.map +1 -1
- package/dist/schema-verification.d.ts +13 -10
- package/dist/schema-verification.js +32 -24
- package/dist/schema-verification.js.map +1 -1
- package/dist/sealed-party-key.js +1 -1
- package/dist/seed-bootstrap.d.ts +4 -3
- package/dist/seed-bootstrap.js +6 -7
- package/dist/seed-bootstrap.js.map +1 -1
- package/dist/strand-addr-protocol.d.ts +8 -6
- package/dist/strand-addr-protocol.js +12 -10
- package/dist/strand-addr-protocol.js.map +1 -1
- package/dist/strand-app-schema-report.d.ts +16 -2
- package/dist/strand-app-schema-report.js +15 -0
- package/dist/strand-app-schema-report.js.map +1 -1
- package/dist/strand-cohort.d.ts +1 -4
- package/dist/strand-cohort.js.map +1 -1
- package/dist/strand-commit-durability.d.ts +1 -1
- package/dist/strand-database.d.ts +13 -6
- package/dist/strand-database.js +17 -9
- package/dist/strand-database.js.map +1 -1
- package/dist/strand-first-sync-gate.d.ts +3 -2
- package/dist/strand-first-sync-gate.js +3 -2
- package/dist/strand-first-sync-gate.js.map +1 -1
- package/dist/strand-formation-deadlines.d.ts +2 -2
- package/dist/strand-formation-deadlines.js +2 -2
- package/dist/strand-formation-protocol.d.ts +1 -1
- package/dist/strand-formation-protocol.js +51 -16
- package/dist/strand-formation-protocol.js.map +1 -1
- package/dist/strand-instance-manager.d.ts +67 -33
- package/dist/strand-instance-manager.js +164 -55
- package/dist/strand-instance-manager.js.map +1 -1
- package/dist/strand-membership-reconciler.d.ts +8 -3
- package/dist/strand-membership-reconciler.js +8 -3
- package/dist/strand-membership-reconciler.js.map +1 -1
- package/dist/strand-membership-writer.d.ts +2 -2
- package/dist/strand-membership-writer.js +41 -39
- package/dist/strand-membership-writer.js.map +1 -1
- package/dist/strand-move.js +1 -1
- package/dist/strand-network-config.d.ts +15 -5
- package/dist/strand-network-config.js +7 -6
- package/dist/strand-network-config.js.map +1 -1
- package/dist/strand-party-key-rotation.d.ts +7 -3
- package/dist/strand-party-key-rotation.js +7 -3
- package/dist/strand-party-key-rotation.js.map +1 -1
- package/dist/strand-party-machines.d.ts +19 -8
- package/dist/strand-party-machines.js +26 -11
- package/dist/strand-party-machines.js.map +1 -1
- package/dist/strand-party-peers.d.ts +36 -14
- package/dist/strand-party-peers.js +24 -15
- package/dist/strand-party-peers.js.map +1 -1
- package/dist/strand-peer-redial.d.ts +1 -1
- package/dist/strand-peer-redial.js +1 -1
- package/dist/strand-reactivity.d.ts +20 -17
- package/dist/strand-reactivity.js +31 -18
- package/dist/strand-reactivity.js.map +1 -1
- package/dist/strand-revocation-enforcer.d.ts +3 -3
- package/dist/strand-revocation-enforcer.js +3 -3
- package/dist/strand-wake-protocol.d.ts +19 -7
- package/dist/strand-wake-protocol.js +22 -10
- package/dist/strand-wake-protocol.js.map +1 -1
- package/dist/strand-watcher.d.ts +1 -1
- package/dist/strand-watcher.js +1 -1
- package/dist/table-change-watch.js +1 -1
- package/dist/types.d.ts +116 -55
- package/dist/types.js.map +1 -1
- package/dist/webrtc-upgrade.d.ts +254 -0
- package/dist/webrtc-upgrade.js +355 -0
- package/dist/webrtc-upgrade.js.map +1 -0
- package/package.json +9 -9
- package/src/announce-addrs.ts +93 -93
- package/src/arachnode-stub.ts +18 -10
- package/src/bootstrap-peer-store-file.ts +44 -44
- package/src/bootstrap-peer-store.ts +214 -214
- package/src/cadre-invite-protocol.ts +741 -740
- package/src/cadre-node.ts +12462 -12280
- package/src/claim-proof.ts +147 -147
- package/src/control-authorization.ts +290 -276
- package/src/control-cohort.ts +223 -204
- package/src/control-database.ts +72 -28
- package/src/control-formation-recorder.ts +359 -359
- package/src/control-protocol-guard.ts +370 -366
- package/src/control-read-retry.ts +222 -180
- package/src/control-retry.ts +36 -4
- package/src/control-schema-version.ts +301 -301
- package/src/control-schema.ts +1108 -1087
- package/src/control-write-retry.ts +639 -669
- package/src/delegate-admission.ts +351 -351
- package/src/describe-thrown.ts +60 -60
- package/src/ed25519-key.ts +185 -185
- package/src/edge-node/config.ts +13 -10
- package/src/edge-node/dissolve.ts +252 -252
- package/src/edge-node/edge-join.ts +320 -320
- package/src/edge-node/edge-node.ts +1095 -1095
- package/src/edge-node/index.ts +60 -59
- package/src/edge-node/join-credential.ts +16 -16
- package/src/edge-node/lazy-raw-storage.ts +194 -178
- package/src/edge-node/listen-addrs.ts +26 -0
- package/src/edge-node/node-local.ts +84 -84
- package/src/edge-node/options.ts +195 -195
- package/src/edge-node/owner-grant.ts +63 -63
- package/src/edge-node/platform.ts +5 -4
- package/src/edge-node/strand-move.ts +266 -266
- package/src/edge-node/strands.ts +27 -12
- package/src/enrolled-machine-store-file.ts +43 -43
- package/src/enrolled-machine-store.ts +280 -280
- package/src/fetch-impl.ts +23 -23
- package/src/file-durable-slot.ts +64 -64
- package/src/file-safe-name.ts +32 -32
- package/src/formation-approval.ts +604 -604
- package/src/formation-token.ts +63 -63
- package/src/fs-atomic.ts +92 -92
- package/src/index.ts +987 -957
- package/src/invitation-bootstrap.ts +152 -118
- package/src/joined-strand-store.ts +553 -553
- package/src/key-store-file.ts +142 -142
- package/src/link-budget.ts +61 -5
- package/src/machine-removal.ts +211 -210
- package/src/member-redemption.ts +643 -643
- package/src/membership-connection-gater.ts +650 -650
- package/src/membership-view.ts +147 -147
- package/src/node-claim-payload.ts +34 -12
- package/src/node-class.ts +47 -0
- package/src/node-default-transports.ts +65 -3
- package/src/node-roles.ts +220 -0
- package/src/node-transports.ts +86 -49
- package/src/owner-anchor-sync.ts +172 -172
- package/src/owner-grant-protocol.ts +547 -547
- package/src/owner-key-export.ts +348 -348
- package/src/owner-key-flows.ts +109 -109
- package/src/owner-key-store.ts +1 -1
- package/src/owner-keys.ts +179 -179
- package/src/owner-signer.ts +92 -92
- package/src/peer-addr-book.ts +252 -252
- package/src/peer-authorization.ts +584 -582
- package/src/peer-dial.ts +698 -605
- package/src/peer-join-backfill.ts +961 -961
- package/src/peer-record.ts +71 -16
- package/src/pending-join-runner.ts +798 -798
- package/src/primary-lan-address.ts +47 -47
- package/src/provider/client.ts +327 -326
- package/src/provider/descriptor.ts +129 -129
- package/src/provider/index.ts +59 -59
- package/src/provider/oauth.ts +285 -285
- package/src/provider/rent-node.ts +276 -275
- package/src/relay-addrs.ts +90 -12
- package/src/relay-reservation.ts +1 -1
- package/src/relay-server.ts +99 -98
- package/src/schema-verification.ts +38 -23
- package/src/sealed-party-key.ts +190 -190
- package/src/seed-bootstrap.ts +8 -11
- package/src/seed-trust-policy.ts +353 -353
- package/src/self-address-update.ts +19 -19
- package/src/strand-addr-protocol.ts +17 -14
- package/src/strand-app-schema-report.ts +147 -122
- package/src/strand-cohort.ts +1 -5
- package/src/strand-commit-durability.ts +165 -165
- package/src/strand-database.ts +522 -510
- package/src/strand-first-sync-gate.ts +3 -2
- package/src/strand-formation-deadlines.ts +227 -227
- package/src/strand-formation-manager.ts +731 -731
- package/src/strand-formation-protocol.ts +1174 -1138
- package/src/strand-fret-addrs.ts +179 -179
- package/src/strand-instance-manager.ts +188 -63
- package/src/strand-membership-reconciler.ts +1315 -1310
- package/src/strand-membership-writer.ts +2152 -2150
- package/src/strand-move.ts +1 -1
- package/src/strand-network-config.ts +16 -6
- package/src/strand-offline.ts +178 -178
- package/src/strand-party-key-rotation.ts +440 -436
- package/src/strand-party-machines.ts +308 -293
- package/src/strand-party-peers.ts +151 -129
- package/src/strand-peer-redial.ts +1 -1
- package/src/strand-reactivity.ts +36 -19
- package/src/strand-revocation-enforcer.ts +758 -758
- package/src/strand-wake-protocol.ts +406 -394
- package/src/strand-watcher.ts +1 -1
- package/src/table-change-watch.ts +285 -285
- package/src/timed-step.ts +28 -28
- package/src/timeout-scheduler.ts +29 -29
- package/src/trusted-owner-store.ts +242 -242
- package/src/types.ts +3182 -3121
- package/src/webrtc-upgrade.ts +439 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CoordinatorPartialCommitError, SyncRetryExhaustedError, TornActionError } from '@optimystic/db-core';
|
|
1
|
+
import { CoordinatorPartialCommitError, PeersIncompleteError, SyncRetryExhaustedError, TornActionError } from '@optimystic/db-core';
|
|
2
2
|
import { ConcurrentModificationError, PartialCommitError } from '@optimystic/quereus-plugin-optimystic';
|
|
3
|
-
import { causeChain, chainMessages, reportsUnreachableCohort, retryControlOperation } from './control-retry.js';
|
|
3
|
+
import { causeChain, chainMessages, reportsUnansweredShortfall, reportsUnreachableCohort, retryControlOperation } from './control-retry.js';
|
|
4
4
|
/**
|
|
5
5
|
* Bounded retry for TRANSIENT control-write failures — the classifier and loop behind
|
|
6
6
|
* `ControlDatabase.lockedWithRetry`, the single funnel every local control write passes
|
|
@@ -10,20 +10,21 @@ import { causeChain, chainMessages, reportsUnreachableCohort, retryControlOperat
|
|
|
10
10
|
* three-machine party commits control writes unanimously (`ceil(3 × 0.75) = 3` approvals) —
|
|
11
11
|
* and no `superMajorityThreshold` can lower that bar without violating Optimystic's
|
|
12
12
|
* partition-safety condition at the shipped admission fraction (the arithmetic lives in
|
|
13
|
-
* `docs/
|
|
13
|
+
* `docs/cadre/control-replication.md` → "Replication cluster size"). Cadre therefore accepts unanimity
|
|
14
14
|
* and absorbs the transient half of its cost here: a write that failed because the cohort
|
|
15
15
|
* did not ANSWER (a stream reset mid-connection-formation, zero approvals) is re-presented
|
|
16
16
|
* a moment later, which the degraded-cohort-member scenario measured as safe (a failed
|
|
17
17
|
* write rolls back, nothing half-commits) and effective (the next write commits in ~1 s).
|
|
18
18
|
*
|
|
19
19
|
* A write somebody actually REJECTED is never retried on the strength of the rejection itself —
|
|
20
|
-
*
|
|
21
|
-
* re-present a spent signature against a
|
|
22
|
-
* anyway when they arrive inside the
|
|
23
|
-
* {@link isUncommittedTransactorAggregate}
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* accepted-tradeoff `NOTE:` there for which, and why no
|
|
20
|
+
* nothing here claims a rejection, at any phase (the shortfall claim reads the vote count for
|
|
21
|
+
* exactly this reason), because re-presenting one would re-present a spent signature against a
|
|
22
|
+
* cohort that already said no. Rejections are re-presented anyway when they arrive inside the
|
|
23
|
+
* transactor's promise-phase aggregate, which {@link isUncommittedTransactorAggregate}
|
|
24
|
+
* claims on the PHASE alone, whatever the cause inside says. Safe because nothing has committed
|
|
25
|
+
* at that phase, and deliberately kept — one of the remaining promise-phase rejections is exactly
|
|
26
|
+
* the kind a re-presentation fixes. See the accepted-tradeoff `NOTE:` there for which, and why no
|
|
27
|
+
* blanket rejection veto is wanted.
|
|
27
28
|
*
|
|
28
29
|
* A failure that says some of the write may be STORED is a different matter, and never
|
|
29
30
|
* re-presented whatever text it carries: {@link reportsPossiblyStoredWrite} vetoes it by type
|
|
@@ -86,8 +87,8 @@ export const SCHEMA_INIT_ATTEMPTS = 5;
|
|
|
86
87
|
* (`cohortReadDeadlineMs` in `link-budget.ts`: 7 s at the default declared link, 5 s before it
|
|
87
88
|
* was derived, 1 s at Optimystic's own default), so it still gets one retry inside this budget
|
|
88
89
|
* where it once got two; an attempt that runs into the `ClusterClient` response deadline
|
|
89
|
-
* (10.5 s at the default declared link) still gets none. See `docs/
|
|
90
|
-
* "Deadlines
|
|
90
|
+
* (10.5 s at the default declared link) still gets none. See `docs/network/deadlines.md` →
|
|
91
|
+
* "Deadlines over Optimystic's reads and commits".
|
|
91
92
|
*
|
|
92
93
|
* NOTE: a failed commit attempt also pays a cancel discharge before its error returns
|
|
93
94
|
* (optimystic `TransactorSource.transact`'s catch) — bounded by six rounds and
|
|
@@ -105,7 +106,7 @@ export const SCHEMA_INIT_ATTEMPTS = 5;
|
|
|
105
106
|
* condition to watch, not work to do: if that case ever starts failing with
|
|
106
107
|
* `failed after 2/3 attempt(s)`, the cancel discharge is where the time went.
|
|
107
108
|
*/
|
|
108
|
-
// eslint-disable-next-line no-restricted-syntax -- cuts off by design: it ends the retries of slow attempts rather than waiting them out; see docs/
|
|
109
|
+
// eslint-disable-next-line no-restricted-syntax -- cuts off by design: it ends the retries of slow attempts rather than waiting them out; see docs/network/deadlines.md → "Deadlines over Optimystic's reads and commits"
|
|
109
110
|
export const CONTROL_WRITE_RETRY_BUDGET_MS = 10000;
|
|
110
111
|
/**
|
|
111
112
|
* Backoff before retry N, jittered ±50% (so the first sleep is 125–375 ms — the jitter can
|
|
@@ -135,51 +136,19 @@ const CONTROL_WRITE_RETRY_DELAYS_MS = [250, 1000];
|
|
|
135
136
|
* ceiling rather than stretching to cover the full 30 s window.
|
|
136
137
|
*/
|
|
137
138
|
const SCHEMA_INIT_RETRY_DELAYS_MS = [250, 500, 1000, 2000];
|
|
138
|
-
/** The network transactor's aggregate, raised when some cohort peers gave no usable answer. */
|
|
139
|
-
const TRANSACTOR_AGGREGATE = /Some peers did not complete:/;
|
|
140
139
|
/**
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*/
|
|
144
|
-
const SINGLE_BLOCK_BATCH_TOKEN = '[block:';
|
|
145
|
-
/**
|
|
146
|
-
* How the aggregate's per-batch details name a MULTI-block batch — the shape phase 2
|
|
147
|
-
* (`commitBlocks`) formats, and the marker of an outcome too indeterminate to retry.
|
|
148
|
-
*/
|
|
149
|
-
const COMMIT_BATCH_TOKEN = '[blocks:';
|
|
150
|
-
/**
|
|
151
|
-
* The cluster coordinator's super-majority shortfall (`PromiseShortfallError`, db-core), matched
|
|
152
|
-
* ONLY with a ZERO rejection count. The same message with a non-zero count means a member actually
|
|
153
|
-
* voted no (that branch carries `membership-not-admitted` rejections), and retrying it would
|
|
154
|
-
* re-present a spent signature to a cohort that already refused it. A pend's shortfall reaches this
|
|
155
|
-
* funnel as that error on its own, before any commit, so re-presenting it is safe; a commit's
|
|
156
|
-
* arrives inside the `[blocks:` aggregate, which {@link reportsIndeterminateCommit} vetoes (both
|
|
157
|
-
* seen live in `control-write-degraded-cohort-member`).
|
|
158
|
-
*
|
|
159
|
-
* NOTE: matched by TEXT although the error is typed. Upstream keeps this sentence byte for byte as a
|
|
160
|
-
* downstream contract, so the regex is stable; moving to `instanceof PromiseShortfallError` with
|
|
161
|
-
* `rejections === 0` is backlog `debt-control-write-retry-matches-the-shortfall-by-type`.
|
|
162
|
-
*
|
|
163
|
-
* This regex itself never matches a decisive rejection (`ValidatorRejectionError`, `Transaction
|
|
164
|
-
* rejected by validators`) — that text carries no `Failed to get super-majority:` prefix. But the
|
|
165
|
-
* composite classifier is not this matcher alone: a rejection raised while promises are still
|
|
166
|
-
* being collected reaches this repo wrapped in the transactor's `Some peers did not complete:
|
|
167
|
-
* …[block:…]` aggregate, and {@link isUncommittedTransactorAggregate} matches that wrapper on its
|
|
168
|
-
* own, whatever the cause inside it says — see the accepted-tradeoff `NOTE:` there.
|
|
169
|
-
*/
|
|
170
|
-
const SUPER_MAJORITY_SHORTFALL_UNANSWERED = /Failed to get super-majority: \d+\/\d+ approvals \(needed \d+, 0 rejections\)/;
|
|
171
|
-
/**
|
|
172
|
-
* Is this a transactor aggregate from a phase where nothing can have committed yet?
|
|
140
|
+
* Does any link of the `cause` chain report a transactor aggregate from a phase where nothing can
|
|
141
|
+
* have committed yet?
|
|
173
142
|
*
|
|
174
|
-
*
|
|
175
|
-
* (`db-core/src/transactor/
|
|
176
|
-
* re-present:
|
|
143
|
+
* `NetworkTransactor` composes one `PeersIncompleteError` for all four of its operations and says
|
|
144
|
+
* which in `phase` (`db-core/src/transactor/peers-incomplete-error.ts`). Only two of the four are
|
|
145
|
+
* safe to re-present:
|
|
177
146
|
*
|
|
178
147
|
* - `get` (a block read, which a write body also performs) and `pend` (phase 1) fail before
|
|
179
148
|
* anything commits, so the write is known not to have landed. `get` raises it only when a
|
|
180
149
|
* coordinator answered and left a block out; a block nobody answered for fails typed
|
|
181
150
|
* instead, which {@link matchesRetriableFailure} claims ({@link reportsUnreachableCohort});
|
|
182
|
-
* - `
|
|
151
|
+
* - `commit` (phase 2) is REACHABLE here and NOT safe. `commitBlock` throws the
|
|
183
152
|
* aggregate when a header/tail commit got NO response at all — precisely the transient
|
|
184
153
|
* class this retry targets — and that escapes `commit()`, survives `TransactorSource`'s
|
|
185
154
|
* cancel-and-rethrow (cancel reaches PENDING actions only; a peer that already committed
|
|
@@ -189,34 +158,23 @@ const SUPER_MAJORITY_SHORTFALL_UNANSWERED = /Failed to get super-majority: \d+\/
|
|
|
189
158
|
* the commit may have completed with only the response lost. Re-running the write body over
|
|
190
159
|
* a write that landed turns a success into a constraint failure (e.g.
|
|
191
160
|
* `UNIQUE constraint failed: CadrePeer.PeerId`). Surfacing the transient error instead lets
|
|
192
|
-
* the caller re-read committed state and decide.
|
|
193
|
-
* {@link reportsIndeterminateCommit}, not here
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
* is the first thing to check. NOTE: on Optimystic 1.20.0 none of its cases produced this form
|
|
207
|
-
* (2026-10-28: the injected reset failed the write's read typed, and a pend's shortfall arrives on
|
|
208
|
-
* its own), so the guard can pass without seeing it; if the form is ever needed live again, inject
|
|
209
|
-
* the reset at the pend's batch rather than the read's.
|
|
210
|
-
*
|
|
211
|
-
* NOTE: the discriminator is the prefix AND the token within ONE message — never relax it to
|
|
212
|
-
* "contains `[block:`". Beyond the `get` and `pend` sites above, Optimystic renders `[block:` in
|
|
213
|
-
* one further place — a third formatter, outside the aggregate's three sites — `dischargeCancel`
|
|
214
|
-
* (`Cancel of action <id> did not discharge <n> block(s): …`), which does not raise the
|
|
215
|
-
* `Some peers did not complete:` prefix; only the conjunction keeps a cancel fault from
|
|
216
|
-
* classifying as a retriable get/pend (checked against optimystic `c56c2bd4`, 2026-09-16).
|
|
161
|
+
* the caller re-read committed state and decide. The commit phase is vetoed by
|
|
162
|
+
* {@link reportsIndeterminateCommit}, not here;
|
|
163
|
+
* - `cancel` — a failed attempt's own cancel that could not discharge the pend it left behind —
|
|
164
|
+
* is neither claimed here nor vetoed there, so it falls through unmatched and is not retried.
|
|
165
|
+
* Per LINK, not per chain: a cancel aggregate carrying a `get`/`pend` one below it is still
|
|
166
|
+
* claimed on that lower link, which is right for the same reason the lower link alone is
|
|
167
|
+
* (nothing committed at either phase) and is what the text matcher this replaced also did.
|
|
168
|
+
*
|
|
169
|
+
* What still fails CLOSED is the error not arriving: a future wrapper that drops `cause` takes
|
|
170
|
+
* every link below it with it, so no typed claim matches and the write is simply not retried.
|
|
171
|
+
* `control-write-degraded-cohort-member.integration.ts` turns that into a red assertion on a live
|
|
172
|
+
* aggregate; NOTE: on Optimystic 1.20.0 none of its cases produced an aggregate at all (2026-10-28:
|
|
173
|
+
* the injected reset failed the write's read typed, and a pend's shortfall arrives on its own), so
|
|
174
|
+
* that guard can pass without ever seeing one.
|
|
217
175
|
*
|
|
218
176
|
* NOTE: accepted tradeoff — a REJECTION raised while promises are still being collected reaches
|
|
219
|
-
* this repo wrapped in this same aggregate, and this matcher claims it on the
|
|
177
|
+
* this repo wrapped in this same aggregate, and this matcher claims it on the phase alone,
|
|
220
178
|
* whatever the cause inside says. That re-presents such a rejection up to two more times inside
|
|
221
179
|
* the 10 s budget. Kept deliberately, and re-decided on 2026-09-17 against the current upstream
|
|
222
180
|
* behaviour rather than inherited:
|
|
@@ -242,35 +200,47 @@ const SUPER_MAJORITY_SHORTFALL_UNANSWERED = /Failed to get super-majority: \d+\/
|
|
|
242
200
|
*
|
|
243
201
|
* Revisit if a re-presentation ever becomes expensive relative to what it buys — a rejection class
|
|
244
202
|
* that costs a full cohort round-trip to re-present, or a write body whose reads are no longer
|
|
245
|
-
* cheap — or when upstream offers a typed refusal surface to classify
|
|
246
|
-
* (`../optimystic/tickets/backlog/debt-a-downstream-repo-classifies-retries-by-parsing-our-error-text`).
|
|
203
|
+
* cheap — or when upstream offers a typed refusal surface to classify the rejection itself on.
|
|
247
204
|
* Contention is no longer the reason to revisit.
|
|
248
205
|
*
|
|
249
|
-
* An aggregate whose details came out EMPTY (possible when `formatBatchStatuses` has no
|
|
250
|
-
* batches to format)
|
|
251
|
-
*
|
|
206
|
+
* An aggregate whose per-peer details came out EMPTY (possible when `formatBatchStatuses` has no
|
|
207
|
+
* batches to format) is claimed like any other: `phase` is on the error whether or not a batch
|
|
208
|
+
* formatted, and `get`/`pend` is itself the proof that nothing committed.
|
|
252
209
|
*
|
|
253
|
-
* Exported for the READ classifier (`control-read-retry.ts`), which reuses it verbatim
|
|
254
|
-
*
|
|
255
|
-
*
|
|
210
|
+
* Exported for the READ classifier (`control-read-retry.ts`), which reuses it verbatim, `pend`
|
|
211
|
+
* included: a control read presents no transaction, so it cannot produce a `pend` aggregate at
|
|
212
|
+
* all — claiming that phase there is unreachable rather than unsafe, and one shared predicate is
|
|
213
|
+
* one thing to keep correct instead of two.
|
|
256
214
|
*/
|
|
257
|
-
export function isUncommittedTransactorAggregate(
|
|
258
|
-
return
|
|
215
|
+
export function isUncommittedTransactorAggregate(links) {
|
|
216
|
+
return links.some(link => link instanceof PeersIncompleteError
|
|
217
|
+
&& (link.phase === 'get' || link.phase === 'pend'));
|
|
259
218
|
}
|
|
260
219
|
/**
|
|
261
|
-
* Does
|
|
262
|
-
* outcome nobody can call committed or not?
|
|
263
|
-
*
|
|
264
|
-
* Vetoes the whole chain rather than the one
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
*
|
|
220
|
+
* Does any link of the failure's `cause` chain report a COMMIT-phase transactor aggregate — i.e.
|
|
221
|
+
* an outcome nobody can call committed or not?
|
|
222
|
+
*
|
|
223
|
+
* Vetoes the whole chain rather than the one link carrying the phase, and vetoes it regardless of
|
|
224
|
+
* which claim would otherwise have taken it: an indeterminate commit anywhere in the chain costs a
|
|
225
|
+
* retry we could have had instead of risking a re-run over a write that landed.
|
|
226
|
+
*
|
|
227
|
+
* Fails CLOSED in the only direction that matters: this veto and every TYPED claim the write
|
|
228
|
+
* classifier makes rest on the same `instanceof`, so a chain this cannot see (a wrapper that
|
|
229
|
+
* dropped `cause`, a second loaded copy of `@optimystic/db-core`) is a chain no typed claim can
|
|
230
|
+
* see either, and nothing is retried for the veto to have to stop.
|
|
231
|
+
*
|
|
232
|
+
* NOTE: that symmetry holds for every claim matched by type, which is all of them in the default
|
|
233
|
+
* and lost-update policies. Schema init adds one matched by TEXT
|
|
234
|
+
* ({@link isSelfCoordinationGraceRefusal}), and a commit aggregate raised OVER that refusal embeds
|
|
235
|
+
* it as the aggregate's own `; root: …` tail — so a chain that kept the text and lost the typed
|
|
236
|
+
* link would be claimed with this veto blind, where the text veto this replaced declined it. Fine
|
|
237
|
+
* today: every wrapper between the transactor and `applyControlSchema` passes the inner error as
|
|
238
|
+
* `cause` (Quereus' DDL, module-create and failed-apply wrappers all do). Revisit if one stops, or
|
|
239
|
+
* if the default policy ever grows a text matcher of its own — either way the veto then needs a
|
|
240
|
+
* text arm beside the typed one.
|
|
271
241
|
*/
|
|
272
|
-
function reportsIndeterminateCommit(
|
|
273
|
-
return
|
|
242
|
+
function reportsIndeterminateCommit(links) {
|
|
243
|
+
return links.some(link => link instanceof PeersIncompleteError && link.phase === 'commit');
|
|
274
244
|
}
|
|
275
245
|
/**
|
|
276
246
|
* Does any link of the `cause` chain say some of this write may be stored, or may still be?
|
|
@@ -285,13 +255,13 @@ function reportsIndeterminateCommit(messages) {
|
|
|
285
255
|
* same transaction is already durable, and re-running the whole body would apply it twice.
|
|
286
256
|
*
|
|
287
257
|
* Every one of these embeds text from elsewhere in its message (a responder's refusal, the
|
|
288
|
-
* underlying failure),
|
|
289
|
-
*
|
|
258
|
+
* underlying failure), and upstream may chain that failure on `cause` besides — so this veto runs
|
|
259
|
+
* before any claim.
|
|
290
260
|
*
|
|
291
261
|
* Matched by TYPE: each survives the bridge's and Quereus' rewraps on `cause`. An error built by a
|
|
292
262
|
* second loaded copy of `@optimystic/db-core` (or of the plugin, for `PartialCommitError`) fails
|
|
293
|
-
* `instanceof`, and then this veto does not fire —
|
|
294
|
-
*
|
|
263
|
+
* `instanceof`, and then this veto does not fire — but neither does any claim against that same
|
|
264
|
+
* copy, so nothing is retried for it to have to stop. The asymmetry with
|
|
295
265
|
* {@link isFinalTornWrite} is deliberate: there, a missed `instanceof` means no retry, which is the
|
|
296
266
|
* safe side. No text fallback parses `TornActionError`'s closing sentence, since upstream says its
|
|
297
267
|
* wording is for log lines only.
|
|
@@ -333,10 +303,6 @@ function reportsPossiblyStoredWrite(links) {
|
|
|
333
303
|
function isFinalTornWrite(link) {
|
|
334
304
|
return link instanceof TornActionError && link.final === true;
|
|
335
305
|
}
|
|
336
|
-
/** The coordinator's shortfall, raised pre-commit, with nobody having voted no. */
|
|
337
|
-
function isUnansweredSuperMajorityShortfall(message) {
|
|
338
|
-
return SUPER_MAJORITY_SHORTFALL_UNANSWERED.test(message);
|
|
339
|
-
}
|
|
340
306
|
/**
|
|
341
307
|
* A LOST UPDATE: the optimystic bridge refusing a commit because another writer changed or
|
|
342
308
|
* removed a row this statement read (`TransactionBridge.mapCommitRefusal` over a
|
|
@@ -382,8 +348,8 @@ function isLostUpdate(link) {
|
|
|
382
348
|
* `cause`. It now rethrows through `rewrapAsQueryError`, which keeps `cause`
|
|
383
349
|
* (`quereus-plugin-optimystic/src/optimystic-module.ts`); whether every Quereus wrapper above it on
|
|
384
350
|
* the schema-init path keeps it too has not been checked, and the text still arrives either way.
|
|
385
|
-
*
|
|
386
|
-
* never makes it unsafe.
|
|
351
|
+
* This matcher — the module's only one — fails CLOSED: a rewording upstream stops the retry
|
|
352
|
+
* engaging, it never makes it unsafe.
|
|
387
353
|
*/
|
|
388
354
|
const SELF_COORDINATION_GRACE_REFUSAL = /Self-coordination blocked: grace-period-not-elapsed\. No coordinator available for key\./;
|
|
389
355
|
/** Self-coordination refused because the node's last connection dropped moments ago. */
|
|
@@ -391,34 +357,42 @@ function isSelfCoordinationGraceRefusal(message) {
|
|
|
391
357
|
return SELF_COORDINATION_GRACE_REFUSAL.test(message);
|
|
392
358
|
}
|
|
393
359
|
/**
|
|
394
|
-
* The error messages
|
|
395
|
-
*
|
|
396
|
-
*
|
|
397
|
-
*
|
|
398
|
-
*
|
|
399
|
-
*
|
|
400
|
-
*
|
|
360
|
+
* The error messages the DEFAULT write policy claims: none. Every failure it re-presents is now
|
|
361
|
+
* claimed by TYPE in {@link matchesRetriableFailure} — the transactor's get/pend aggregate
|
|
362
|
+
* ({@link isUncommittedTransactorAggregate}), a block read the cohort could not answer
|
|
363
|
+
* ({@link reportsUnreachableCohort}), an unanswered super-majority shortfall
|
|
364
|
+
* ({@link reportsUnansweredShortfall}) and a final torn write ({@link isFinalTornWrite}) — and so
|
|
365
|
+
* are both vetoes.
|
|
366
|
+
*
|
|
367
|
+
* Kept empty rather than deleted for two reasons: it is what {@link RETRIABLE_SCHEMA_INIT_MATCHERS}
|
|
368
|
+
* spreads, so the "widened, not replaced" relation between the two policies stays expressed in
|
|
369
|
+
* code; and a future text matcher has one obvious home. The only text matcher left in this module
|
|
370
|
+
* is the schema-init self-coordination refusal, which comes from `@optimystic/db-p2p`, not from the
|
|
371
|
+
* transactor.
|
|
372
|
+
*
|
|
373
|
+
* Deliberately NOT matched, here or anywhere: every constraint / authorization failure
|
|
401
374
|
* (`CHECK constraint failed:`, `UNIQUE constraint failed:`) — those reach the same funnel
|
|
402
375
|
* and must be retried zero times: the cohort REFUSED the write, so re-presenting it
|
|
403
376
|
* re-presents a spent signature and can never commit.
|
|
404
377
|
*/
|
|
405
|
-
const RETRIABLE_CONTROL_WRITE_MATCHERS = [
|
|
406
|
-
isUncommittedTransactorAggregate,
|
|
407
|
-
isUnansweredSuperMajorityShortfall,
|
|
408
|
-
];
|
|
378
|
+
const RETRIABLE_CONTROL_WRITE_MATCHERS = [];
|
|
409
379
|
/**
|
|
410
|
-
* The
|
|
411
|
-
* ({@link SCHEMA_INIT_RETRY_POLICY}), deliberately not folded into the list above.
|
|
380
|
+
* The (currently empty) default list PLUS the self-coordination grace refusal — the classifier for
|
|
381
|
+
* schema init ONLY ({@link SCHEMA_INIT_RETRY_POLICY}), deliberately not folded into the list above.
|
|
412
382
|
*
|
|
413
383
|
* Why this class is safe HERE and not everywhere: a write refused at coordinator SELECTION never
|
|
414
384
|
* reached a peer, so re-presenting it is a proven non-commit. But `findCoordinator` is also
|
|
415
385
|
* reached from `NetworkTransactor.commitBlock` during PHASE 2 (`resolveCoordinator`,
|
|
416
386
|
* `db-core/src/transactor/network-transactor.ts`), and `commit()` commits the header block before
|
|
417
387
|
* the rest — so a general control write refused there can be refused AFTER something already
|
|
418
|
-
* committed. Worse,
|
|
419
|
-
*
|
|
420
|
-
*
|
|
421
|
-
* to
|
|
388
|
+
* committed. Worse, it is thrown from the batch assembly OUTSIDE the `try` that composes the
|
|
389
|
+
* commit-phase aggregate (`batchesForPayload`, `db-core/src/transactor/network-transactor.ts`), so
|
|
390
|
+
* it normally arrives with no aggregate around it at all and
|
|
391
|
+
* {@link reportsIndeterminateCommit} has nothing to veto on — and re-running an insert body over a
|
|
392
|
+
* write that landed is exactly the `UNIQUE constraint failed: CadrePeer.PeerId` failure that veto
|
|
393
|
+
* exists to prevent. (The one path where the veto does fire is the per-block retry's
|
|
394
|
+
* re-resolution inside `processBatches`, where such a throw becomes the commit aggregate's root
|
|
395
|
+
* cause.)
|
|
422
396
|
*
|
|
423
397
|
* Schema init does not have that problem: `apply schema` is a diff rather than a replay, and a
|
|
424
398
|
* failed apply is taken back whole — Quereus unwinds every step it ran and verifies the catalog
|
|
@@ -450,25 +424,23 @@ const RETRIABLE_SCHEMA_INIT_MATCHERS = [
|
|
|
450
424
|
* Did this control write fail because the cluster cohort did not ANSWER — i.e. is
|
|
451
425
|
* re-presenting the SAME signed write a moment later the right response?
|
|
452
426
|
*
|
|
453
|
-
* Classifies
|
|
454
|
-
* {@link chainMessages} (Quereus' own `unwrapError` underneath) — the transactor and the
|
|
455
|
-
* coordinator both throw bare `Error`s, not recognisable by type. By the time one reaches
|
|
427
|
+
* Classifies entirely by TYPE, over the `cause` chain — by the time a failure reaches
|
|
456
428
|
* `ControlDatabase` it is wrapped in a `QuereusError` (the real chain is `QuereusError` → `Error`
|
|
457
|
-
* → `Error`), so
|
|
458
|
-
* retried.
|
|
459
|
-
*
|
|
460
|
-
* Two vetoes run over the whole chain before any
|
|
461
|
-
* (
|
|
462
|
-
* {@link reportsIndeterminateCommit} (
|
|
463
|
-
* at any level, is never retried on the strength of some other level looking transient.
|
|
464
|
-
* failures are claimed as retriable:
|
|
465
|
-
* ({@link
|
|
466
|
-
* ({@link
|
|
467
|
-
*
|
|
468
|
-
*
|
|
469
|
-
*
|
|
470
|
-
*
|
|
471
|
-
*
|
|
429
|
+
* → `Error`), so every claim and veto must work at any depth. Anything that is not an `Error` is
|
|
430
|
+
* never retried.
|
|
431
|
+
*
|
|
432
|
+
* Two vetoes run over the whole chain before any claim: {@link reportsPossiblyStoredWrite}
|
|
433
|
+
* (a spent sync budget, a non-final torn write, a partial commit) and
|
|
434
|
+
* {@link reportsIndeterminateCommit} (a commit-phase transactor aggregate). A chain either veto
|
|
435
|
+
* flags, at any level, is never retried on the strength of some other level looking transient.
|
|
436
|
+
* Four failures are claimed as retriable: the transactor's get/pend aggregate
|
|
437
|
+
* ({@link isUncommittedTransactorAggregate}, shared with the read classifier), a block read the
|
|
438
|
+
* cohort could not answer ({@link reportsUnreachableCohort}, also shared with it), an unanswered
|
|
439
|
+
* super-majority shortfall ({@link reportsUnansweredShortfall}, shared with the edge node's
|
|
440
|
+
* `retryAfterRestart`) and a final torn write ({@link isFinalTornWrite}).
|
|
441
|
+
*
|
|
442
|
+
* The RETRIABLE failures need a real multi-node cluster to produce, so the unit cases build the
|
|
443
|
+
* upstream classes directly; the degraded-cohort scenario
|
|
472
444
|
* (`control-write-degraded-cohort-member.integration.ts`) asserts this classifier against the
|
|
473
445
|
* super-majority shortfall from a real silent member, and absorbs a real stream reset end to end
|
|
474
446
|
* (on Optimystic 1.20.0 the reset fails the write's read as an unanswered block, claimed by type).
|
|
@@ -499,41 +471,45 @@ export function isRetriableLostUpdateFailure(error) {
|
|
|
499
471
|
/**
|
|
500
472
|
* Shared body of the three classifiers: walk the `cause` chain, let
|
|
501
473
|
* {@link reportsPossiblyStoredWrite} and then {@link reportsIndeterminateCommit} veto it, then claim
|
|
502
|
-
* a
|
|
474
|
+
* a get/pend transactor aggregate ({@link isUncommittedTransactorAggregate}), a block read the
|
|
475
|
+
* cohort could not answer ({@link reportsUnreachableCohort}), an unanswered
|
|
476
|
+
* super-majority shortfall ({@link reportsUnansweredShortfall}), a final torn write
|
|
503
477
|
* ({@link isFinalTornWrite}) or any link `claimsLink` names, then ask `matchers`. The vetoes run
|
|
504
478
|
* BEFORE any claim for every policy — a chain reporting a possibly-stored write or a commit-phase
|
|
505
479
|
* batch is never retried, however transient some other level looks, and a final torn write or a
|
|
506
480
|
* lost update carried by a partial commit is still declined because a sibling collection landed.
|
|
507
481
|
* `claimsLink` is the one typed claim a policy may add; it sits here beside the shared typed claims
|
|
508
482
|
* so the vetoes stay in one place above all of them.
|
|
483
|
+
*
|
|
484
|
+
* The three shared typed claims are predicates over the WHOLE chain and the policy's own is per
|
|
485
|
+
* link, which is why the one `some` below carries only the latter. The shortfall claim being shared
|
|
486
|
+
* with the edge node is what keeps the two write policies from drifting on it; where a shortfall
|
|
487
|
+
* leaves the write is still decided here, by the commit-phase veto above.
|
|
509
488
|
*/
|
|
510
489
|
function matchesRetriableFailure(error, matchers, claimsLink) {
|
|
511
490
|
if (!(error instanceof Error)) {
|
|
512
491
|
return false;
|
|
513
492
|
}
|
|
514
493
|
const links = causeChain(error);
|
|
515
|
-
if (reportsPossiblyStoredWrite(links)) {
|
|
516
|
-
return false;
|
|
517
|
-
}
|
|
518
|
-
const messages = chainMessages(error);
|
|
519
|
-
if (reportsIndeterminateCommit(messages)) {
|
|
494
|
+
if (reportsPossiblyStoredWrite(links) || reportsIndeterminateCommit(links)) {
|
|
520
495
|
return false;
|
|
521
496
|
}
|
|
522
497
|
// NOTE: an unanswered read can fail AFTER this write's log entry is stored: the refresh between
|
|
523
498
|
// commit attempts reads the collection's log ends, and finishing the write's own entry
|
|
524
499
|
// (`Collection.completeOwnEntry`) asks `getStatus` when no attempt is retained at the entry's
|
|
525
500
|
// revision (a forked lineage — both commit paths retain the failed attempt before refreshing).
|
|
526
|
-
// Either throw escapes the refresh loop unwrapped. Claimed anyway, because the
|
|
527
|
-
// aggregate those same reads raise is already claimed
|
|
528
|
-
//
|
|
529
|
-
//
|
|
530
|
-
//
|
|
531
|
-
//
|
|
532
|
-
if (reportsUnreachableCohort(links)
|
|
501
|
+
// Either throw escapes the refresh loop unwrapped. Claimed anyway, because the get/pend
|
|
502
|
+
// aggregate those same reads raise is already claimed beside it, so this adds no new case: the
|
|
503
|
+
// re-run is a new transaction whose body re-reads the blocks, so it diffs to nothing or fails on
|
|
504
|
+
// `UNIQUE` where the earlier write landed, and writes it once where it did not. A refresh that
|
|
505
|
+
// already saved a sibling collection arrives as `CoordinatorPartialCommitError`, which the veto
|
|
506
|
+
// above declines.
|
|
507
|
+
if (isUncommittedTransactorAggregate(links) || reportsUnreachableCohort(links)
|
|
508
|
+
|| reportsUnansweredShortfall(links)
|
|
533
509
|
|| links.some(link => isFinalTornWrite(link) || claimsLink?.(link) === true)) {
|
|
534
510
|
return true;
|
|
535
511
|
}
|
|
536
|
-
return
|
|
512
|
+
return chainMessages(error).some(message => matchers.some(matches => matches(message)));
|
|
537
513
|
}
|
|
538
514
|
/**
|
|
539
515
|
* The schema-init policy: `ControlDatabase.applyControlSchema`'s distributed DDL, which
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-write-retry.js","sourceRoot":"","sources":["../src/control-write-retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"control-write-retry.js","sourceRoot":"","sources":["../src/control-write-retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACpI,OAAO,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AACxG,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,C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3E,WAAW,EAAE,4BAA4B;CACzC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,iBAAiB,CAChC,OAAyB,EACzB,UAAoC,EAAE;IAEtC,OAAO,qBAAqB,CAAC,OAAO,EAAE;QACrC,QAAQ,EAAE,sBAAsB;QAChC,QAAQ,EAAE,6BAA6B;QACvC,QAAQ,EAAE,6BAA6B;QACvC,WAAW,EAAE,8BAA8B;QAC3C,4EAA4E;QAC5E,mDAAmD;QACnD,SAAS,EAAE,eAAe;KAC1B,EAAE,OAAO,CAAC,CAAC;AACb,CAAC"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* including a co-cadre relay — can recompute it: a sibling's relay sees an
|
|
9
9
|
* unknown peerId it has no way to place as a member.
|
|
10
10
|
*
|
|
11
|
-
* The resolution (docs/
|
|
11
|
+
* The resolution (docs/network/relay.md → "Who a relay is willing to serve"): a party control
|
|
12
12
|
* node running a relay is party-private infrastructure — it relays for its own
|
|
13
13
|
* party's nodes, including the extra transport identities its members' strand
|
|
14
14
|
* nodes run as. The mechanism is a **member-announced delegate grant**: before
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* including a co-cadre relay — can recompute it: a sibling's relay sees an
|
|
9
9
|
* unknown peerId it has no way to place as a member.
|
|
10
10
|
*
|
|
11
|
-
* The resolution (docs/
|
|
11
|
+
* The resolution (docs/network/relay.md → "Who a relay is willing to serve"): a party control
|
|
12
12
|
* node running a relay is party-private infrastructure — it relays for its own
|
|
13
13
|
* party's nodes, including the extra transport identities its members' strand
|
|
14
14
|
* nodes run as. The mechanism is a **member-announced delegate grant**: before
|
|
@@ -35,7 +35,8 @@ export interface EdgeNodeConfigInputs extends EdgeNodeOptions {
|
|
|
35
35
|
transports: Libp2pTransports;
|
|
36
36
|
/**
|
|
37
37
|
* Listen addresses besides the bare `/p2p-circuit` entry cadre-core adds for a named relay.
|
|
38
|
-
* Default `[]`: an edge device accepts no inbound connection
|
|
38
|
+
* Default `[]`: an edge device accepts no inbound connection over a socket-bound transport. An
|
|
39
|
+
* app carrying WebRTC names `/webrtc` here. See `EdgeNodePlatform.listenAddrs`.
|
|
39
40
|
*/
|
|
40
41
|
listenAddrs?: string[];
|
|
41
42
|
/** See `EdgeNodePlatform.allowPrivateDial`. */
|
|
@@ -46,7 +47,7 @@ export interface EdgeNodeConfigInputs extends EdgeNodeOptions {
|
|
|
46
47
|
strandNetworkStateStore: StrandNetworkStateStore;
|
|
47
48
|
}
|
|
48
49
|
/**
|
|
49
|
-
* The edge node's config:
|
|
50
|
+
* The edge node's config: the `'device'` node class (Ring Zulu only, intermittent connectivity), no
|
|
50
51
|
* listen address unless the platform names one, reachability through the configured relays (if
|
|
51
52
|
* any) but never a hard requirement for one, every strand the control network lists, and no
|
|
52
53
|
* automatic hibernation (the app's lifecycle runner hibernates on background), and offline mode
|
|
@@ -66,7 +67,7 @@ export type OwnerGenesisResult = 'enrolled' | 'member' | 'failed' | 'timed-out';
|
|
|
66
67
|
* Default bound on {@link runOwnerGenesis} and {@link wireJoinedOwnerKey}: what a start can wait
|
|
67
68
|
* for its owner step, which runs control reads and one control write, before it goes on without
|
|
68
69
|
* it. Not derived from the link, since a start that waited out a stalled write (about 84 s, see
|
|
69
|
-
* `docs/
|
|
70
|
+
* `docs/network/deadlines.md`) would be a start the user gave up on.
|
|
70
71
|
*/
|
|
71
72
|
export declare const DEFAULT_OWNER_GENESIS_TIMEOUT_MS = 60000;
|
|
72
73
|
/** Default `EdgeNodeOptions.ownerKeyLabel`: the founding owner key's name on its `OwnerKey` row. */
|
package/dist/edge-node/config.js
CHANGED
|
@@ -6,7 +6,7 @@ import { DEFAULT_IDENTITY_KEY_ID } from '../key-store.js';
|
|
|
6
6
|
import { createOwnerKey, loadOwnerSigner } from '../owner-key-store.js';
|
|
7
7
|
import { OWNER_KEY_MAX_LABEL } from '../owner-key-export.js';
|
|
8
8
|
/**
|
|
9
|
-
* The edge node's config:
|
|
9
|
+
* The edge node's config: the `'device'` node class (Ring Zulu only, intermittent connectivity), no
|
|
10
10
|
* listen address unless the platform names one, reachability through the configured relays (if
|
|
11
11
|
* any) but never a hard requirement for one, every strand the control network lists, and no
|
|
12
12
|
* automatic hibernation (the app's lifecycle runner hibernates on background), and offline mode
|
|
@@ -24,17 +24,19 @@ export function buildEdgeNodeConfig(inputs) {
|
|
|
24
24
|
partyId: inputs.partyId,
|
|
25
25
|
bootstrapNodes: inputs.bootstrapAddrs,
|
|
26
26
|
},
|
|
27
|
-
|
|
27
|
+
nodeClass: 'device',
|
|
28
28
|
storage: {
|
|
29
29
|
provider: inputs.storageProvider,
|
|
30
30
|
},
|
|
31
31
|
network: {
|
|
32
32
|
transports: inputs.transports,
|
|
33
|
-
// An edge device
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
// (`cadre-core/src/relay-addrs.ts` → `resolveListenAddrs`).
|
|
33
|
+
// An edge device binds no socket, so by default it listens on nothing: the only address
|
|
34
|
+
// it then has is the `/p2p-circuit` address a relay reservation earns it. An explicitly
|
|
35
|
+
// empty `listenAddrs` stays empty through cadre-core's derivation, and naming a relay
|
|
36
|
+
// adds the bare `/p2p-circuit` search entry to it
|
|
37
|
+
// (`cadre-core/src/relay-addrs.ts` → `resolveListenAddrs`). An app whose transports carry
|
|
38
|
+
// WebRTC — a browser tab or a phone — adds `/webrtc` when it has a relay
|
|
39
|
+
// (`webrtcListenAddrs`), so a peer can open a direct connection to it.
|
|
38
40
|
listenAddrs: inputs.listenAddrs ?? [],
|
|
39
41
|
// Through this config field rather than `CadreNode.reserveRelays()`, which reaches the
|
|
40
42
|
// control node only: formation has the invitee dial the control node and then the strand
|
|
@@ -77,9 +79,9 @@ export function buildEdgeNodeConfig(inputs) {
|
|
|
77
79
|
* Default bound on {@link runOwnerGenesis} and {@link wireJoinedOwnerKey}: what a start can wait
|
|
78
80
|
* for its owner step, which runs control reads and one control write, before it goes on without
|
|
79
81
|
* it. Not derived from the link, since a start that waited out a stalled write (about 84 s, see
|
|
80
|
-
* `docs/
|
|
82
|
+
* `docs/network/deadlines.md`) would be a start the user gave up on.
|
|
81
83
|
*/
|
|
82
|
-
// eslint-disable-next-line no-restricted-syntax -- cuts off by design: a start goes on without its owner step rather than wait out a stalled control write; see docs/
|
|
84
|
+
// eslint-disable-next-line no-restricted-syntax -- cuts off by design: a start goes on without its owner step rather than wait out a stalled control write; see docs/network/deadlines.md → "Deadlines over Optimystic's reads and commits"
|
|
83
85
|
export const DEFAULT_OWNER_GENESIS_TIMEOUT_MS = 60000;
|
|
84
86
|
/** Default `EdgeNodeOptions.ownerKeyLabel`: the founding owner key's name on its `OwnerKey` row. */
|
|
85
87
|
export const DEFAULT_OWNER_KEY_LABEL = 'phone';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/edge-node/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAiB,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/edge-node/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAiB,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AA+C7D;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAA4B;IAC/D,OAAO;QACN,2FAA2F;QAC3F,wFAAwF;QACxF,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,aAAa,EAAE,uBAAuB;QACtC,cAAc,EAAE;YACf,OAAO,EAAE,MAAM,CAAC,OAAO;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