@optimystic/db-p2p 0.17.0 → 0.18.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.
Files changed (66) hide show
  1. package/dist/src/cluster/block-transfer-service.d.ts +10 -0
  2. package/dist/src/cluster/block-transfer-service.d.ts.map +1 -1
  3. package/dist/src/cluster/block-transfer-service.js +2 -1
  4. package/dist/src/cluster/block-transfer-service.js.map +1 -1
  5. package/dist/src/cluster/cluster-policy.d.ts +112 -0
  6. package/dist/src/cluster/cluster-policy.d.ts.map +1 -0
  7. package/dist/src/cluster/cluster-policy.js +88 -0
  8. package/dist/src/cluster/cluster-policy.js.map +1 -0
  9. package/dist/src/cluster/cluster-repo.d.ts +35 -11
  10. package/dist/src/cluster/cluster-repo.d.ts.map +1 -1
  11. package/dist/src/cluster/cluster-repo.js +88 -19
  12. package/dist/src/cluster/cluster-repo.js.map +1 -1
  13. package/dist/src/cluster/quorum-restore.d.ts +25 -3
  14. package/dist/src/cluster/quorum-restore.d.ts.map +1 -1
  15. package/dist/src/cluster/quorum-restore.js +27 -3
  16. package/dist/src/cluster/quorum-restore.js.map +1 -1
  17. package/dist/src/cluster/reconcile-block.d.ts +10 -2
  18. package/dist/src/cluster/reconcile-block.d.ts.map +1 -1
  19. package/dist/src/cluster/reconcile-block.js +38 -18
  20. package/dist/src/cluster/reconcile-block.js.map +1 -1
  21. package/dist/src/cluster/spread-on-churn.d.ts.map +1 -1
  22. package/dist/src/cluster/spread-on-churn.js +8 -0
  23. package/dist/src/cluster/spread-on-churn.js.map +1 -1
  24. package/dist/src/inbound-authorization.d.ts +6 -0
  25. package/dist/src/inbound-authorization.d.ts.map +1 -1
  26. package/dist/src/inbound-authorization.js +6 -0
  27. package/dist/src/inbound-authorization.js.map +1 -1
  28. package/dist/src/libp2p-key-network.d.ts +14 -0
  29. package/dist/src/libp2p-key-network.d.ts.map +1 -1
  30. package/dist/src/libp2p-key-network.js +54 -4
  31. package/dist/src/libp2p-key-network.js.map +1 -1
  32. package/dist/src/libp2p-node-base.d.ts +22 -23
  33. package/dist/src/libp2p-node-base.d.ts.map +1 -1
  34. package/dist/src/libp2p-node-base.js +22 -19
  35. package/dist/src/libp2p-node-base.js.map +1 -1
  36. package/dist/src/repo/cluster-coordinator.d.ts +21 -3
  37. package/dist/src/repo/cluster-coordinator.d.ts.map +1 -1
  38. package/dist/src/repo/cluster-coordinator.js +27 -5
  39. package/dist/src/repo/cluster-coordinator.js.map +1 -1
  40. package/dist/src/repo/coordinator-repo.d.ts +60 -26
  41. package/dist/src/repo/coordinator-repo.d.ts.map +1 -1
  42. package/dist/src/repo/coordinator-repo.js +218 -65
  43. package/dist/src/repo/coordinator-repo.js.map +1 -1
  44. package/dist/src/storage/storage-repo.d.ts +9 -0
  45. package/dist/src/storage/storage-repo.d.ts.map +1 -1
  46. package/dist/src/storage/storage-repo.js +56 -4
  47. package/dist/src/storage/storage-repo.js.map +1 -1
  48. package/dist/src/testing/mesh-harness.d.ts +10 -0
  49. package/dist/src/testing/mesh-harness.d.ts.map +1 -1
  50. package/dist/src/testing/mesh-harness.js +14 -1
  51. package/dist/src/testing/mesh-harness.js.map +1 -1
  52. package/package.json +2 -2
  53. package/readme.md +20 -0
  54. package/src/cluster/block-transfer-service.ts +9 -1
  55. package/src/cluster/cluster-policy.ts +152 -0
  56. package/src/cluster/cluster-repo.ts +93 -22
  57. package/src/cluster/quorum-restore.ts +28 -3
  58. package/src/cluster/reconcile-block.ts +52 -19
  59. package/src/cluster/spread-on-churn.ts +8 -0
  60. package/src/inbound-authorization.ts +6 -0
  61. package/src/libp2p-key-network.ts +54 -4
  62. package/src/libp2p-node-base.ts +42 -43
  63. package/src/repo/cluster-coordinator.ts +30 -6
  64. package/src/repo/coordinator-repo.ts +235 -73
  65. package/src/storage/storage-repo.ts +58 -6
  66. package/src/testing/mesh-harness.ts +15 -1
@@ -1,14 +1,15 @@
1
1
  import { LruMap, blockIdsForTransforms, DEFAULT_SUPER_MAJORITY_THRESHOLD } from "@optimystic/db-core";
2
- import { ClusterCoordinator } from "./cluster-coordinator.js";
2
+ import { ClusterCoordinator, ValidatorRejectionError } from "./cluster-coordinator.js";
3
3
  import { peerIdFromString } from "@libp2p/peer-id";
4
4
  import { createLogger } from '../logger.js';
5
5
  import { PenaltyReason } from "../reputation/types.js";
6
- import { quorumSize, selectQuorumRev } from "../cluster/quorum-restore.js";
6
+ import { quorumSize, corroboratorCapacity, selectQuorumRev } from "../cluster/quorum-restore.js";
7
7
  import { RECONCILE_TIMEOUT_MS } from "../cluster/reconcile-block.js";
8
+ import { isMissingBaseRevisionFailure, MISSING_BASE_REVISION_REASON } from "../storage/storage-repo.js";
8
9
  const log = createLogger('coordinator-repo');
9
10
  /** True when a freshly-read local revision is strictly ahead of the baseline the repair started from. */
10
- function isAdvanceOver(rev, baseline) {
11
- return typeof rev === 'number' && (baseline === undefined || rev > baseline.rev);
11
+ function isAdvanceOver(rev, baselineRev) {
12
+ return typeof rev === 'number' && (baselineRev === undefined || rev > baselineRev);
12
13
  }
13
14
  /**
14
15
  * Reject if `promise` has not settled within `ms`. The timer is cleared on either outcome, so no
@@ -24,6 +25,22 @@ function withDeadline(promise, ms, label) {
24
25
  clearTimeout(timer);
25
26
  });
26
27
  }
28
+ /**
29
+ * Resolve `undefined` if `promise` has not settled within `ms` — a slow peer is skipped, not an
30
+ * error. Same timer discipline as {@link withDeadline}: one repair pass races this once per cohort
31
+ * peer, so leaving the handles pending would keep the event loop alive for the full timeout after
32
+ * every peer has already answered.
33
+ */
34
+ function withTimeout(promise, ms) {
35
+ let timer;
36
+ const expiry = new Promise(resolve => {
37
+ timer = setTimeout(() => resolve(undefined), ms);
38
+ });
39
+ return Promise.race([promise, expiry]).finally(() => {
40
+ if (timer !== undefined)
41
+ clearTimeout(timer);
42
+ });
43
+ }
27
44
  export function coordinatorRepo(keyNetwork, createClusterClient, cfg, fretService, reputation, stateStore) {
28
45
  return (components) => new CoordinatorRepo(keyNetwork, createClusterClient, components.storageRepo, cfg, components.localCluster, components.localPeerId, fretService, components.clusterLatestCallback, reputation, stateStore, components.acquireBlockFromCohort);
29
46
  }
@@ -45,8 +62,13 @@ export class CoordinatorRepo {
45
62
  readRepairSampleRate;
46
63
  /** Simple-majority threshold from the consensus policy; drives the read-repair corroboration quorum. */
47
64
  simpleMajorityThreshold;
48
- /** Configured full cluster size; the operator's declaration of how many corroborators should exist. */
49
- clusterSize;
65
+ /**
66
+ * Yardstick the read-repair corroboration floor is measured against; the floor for
67
+ * {@link corroboratorCapacity}. Resolved by `resolveClusterPolicy` for a real node; falls back to
68
+ * `assumedClusterSize` and then `clusterSize` for direct constructors (see the constructor), so a
69
+ * caller that has adopted neither field keeps today's behavior exactly.
70
+ */
71
+ repairCorroborationClusterSize;
50
72
  /** Resolved super-majority threshold the coordinator commits on (mirrors the value handed to ClusterCoordinator). */
51
73
  superMajorityThreshold;
52
74
  reputation;
@@ -63,6 +85,7 @@ export class CoordinatorRepo {
63
85
  this.localPeerId = localPeerId;
64
86
  const policy = {
65
87
  clusterSize: cfg?.clusterSize ?? 10,
88
+ assumedClusterSize: cfg?.assumedClusterSize,
66
89
  superMajorityThreshold: cfg?.superMajorityThreshold ?? DEFAULT_SUPER_MAJORITY_THRESHOLD,
67
90
  simpleMajorityThreshold: cfg?.simpleMajorityThreshold ?? 0.51,
68
91
  minAbsoluteClusterSize: cfg?.minAbsoluteClusterSize ?? 3,
@@ -87,7 +110,15 @@ export class CoordinatorRepo {
87
110
  this.readRepairSampleRate = policy.readRepairSampleRate;
88
111
  this.simpleMajorityThreshold = policy.simpleMajorityThreshold;
89
112
  this.superMajorityThreshold = policy.superMajorityThreshold;
90
- this.clusterSize = policy.clusterSize;
113
+ // Unlike the membership admission gate (which treats an absent assumedClusterSize as "unknown"
114
+ // and admits — refusing writes outright is unacceptable), this falls back to the replication
115
+ // factor and stays strict: the failure mode of getting this wrong is a block that goes
116
+ // unrepaired, degraded rather than dead, so there is no reason to relax it for a caller that
117
+ // has not adopted the new field. A real node is handed an explicit
118
+ // `repairCorroborationClusterSize` by `resolveClusterPolicy`; the `assumedClusterSize` middle
119
+ // term keeps direct constructors (embedders, existing tests) behaving as before.
120
+ this.repairCorroborationClusterSize =
121
+ cfg?.repairCorroborationClusterSize ?? policy.assumedClusterSize ?? policy.clusterSize;
91
122
  this.reputation = reputation;
92
123
  const localClusterRef = localCluster && localPeerId ? {
93
124
  update: localCluster.update.bind(localCluster),
@@ -154,6 +185,13 @@ export class CoordinatorRepo {
154
185
  }
155
186
  async get(blockGets, options) {
156
187
  // Soft proximity check — warn but still serve reads for graceful degradation
188
+ // NOTE: a soft-served read now also *acquires* the block durably (see restoreCorroborated), where
189
+ // before it could at most promote a pending this node already held. So a soft serve leaves behind
190
+ // a replica of a block this node is not responsible for, and nothing sweeps those: ring-shift
191
+ // sheds a keyspace RANGE, not "blocks outside my cohort". Fine while soft serves are what they
192
+ // are meant to be — a rare degradation during routing churn — since routing already placed this
193
+ // node near the block. If they ever become routine, gate acquisition (not the serve itself) on
194
+ // isResponsibleForBlock.
157
195
  for (const blockId of blockGets.blockIds) {
158
196
  if (!await this.isResponsibleForBlock(blockId)) {
159
197
  log('proximity:get-warning', { blockId, msg: 'serving read for non-responsible block' });
@@ -165,14 +203,21 @@ export class CoordinatorRepo {
165
203
  // (a) Missing — block isn't present locally at all (legacy behavior).
166
204
  // (b) Stale-by-policy — block is present but read-repair policy says verify.
167
205
  // Skip cluster fetch if this is already a sync request (to prevent recursive queries).
206
+ // A sync read is also never marked `unavailable` here — the consult it skips is the
207
+ // one whose failure the flag reports, and flagging would feed the recursion this
208
+ // bypass exists to prevent. (Storage-level 'unmaterializable' flags still pass
209
+ // through untouched; they report local state, not the consult.)
168
210
  const skipClusterFetch = options?.skipClusterFetch;
169
211
  // NOTE: NetworkTransactor.get treats an authoritative "absent" ({ state: {} })
170
212
  // as final and no longer retries it (ticket txn-perf-authoritative-notfound),
171
- // relying on this cluster reconciliation to have already run. If a coordinator
172
- // is ever configured WITHOUT clusterLatestCallback, a missing block is answered
173
- // from local state alone with no transactor-level retry to compensate. That is
174
- // fine today (such a coordinator has no cluster to reconcile against), but keep
175
- // this coupling in mind if a partial-cluster read path is added.
213
+ // relying on this cluster reconciliation to have already run. When the consult
214
+ // runs and FAILS, the entry is flagged `unavailable: 'peers-unreachable'` below,
215
+ // which re-enables the transactor-level retry against a different peer. If a
216
+ // coordinator is configured WITHOUT clusterLatestCallback, there is no cohort to
217
+ // consult and the local answer IS the whole truth it stays authoritative, with
218
+ // no flag and no transactor-level retry to compensate. That is fine (such a
219
+ // coordinator has no cluster to reconcile against), but keep this coupling in
220
+ // mind if a partial-cluster read path is added.
176
221
  if (this.clusterLatestCallback && !skipClusterFetch) {
177
222
  for (const blockId of blockGets.blockIds) {
178
223
  const localEntry = localResult[blockId];
@@ -190,7 +235,7 @@ export class CoordinatorRepo {
190
235
  });
191
236
  }
192
237
  try {
193
- await this.fetchBlockFromCluster(blockId, blockGets.context);
238
+ await this.fetchBlockFromCluster(blockId, blockGets.context, localRev);
194
239
  const refreshed = await this.storageRepo.get({ blockIds: [blockId], context: blockGets.context }, options);
195
240
  const newRev = refreshed[blockId]?.state?.latest?.rev;
196
241
  if (refreshed[blockId]) {
@@ -207,6 +252,24 @@ export class CoordinatorRepo {
207
252
  }
208
253
  catch (err) {
209
254
  log('cluster-fetch:error', { blockId, error: err.message });
255
+ // The consult that was supposed to make this answer trustworthy did not run.
256
+ // Only a locally-MISSING block is downgraded to `unavailable`: a merely-stale
257
+ // block still has a real local answer and stays authoritative. A sharper flag
258
+ // already on the entry (storage's 'unmaterializable') is never overwritten.
259
+ // NOTE: a consult that runs but corroborates nothing (per-peer timeouts and
260
+ // "peer holds nothing" both surface as absent claims → no quorum) does NOT
261
+ // land here and stays an authoritative absent — the common new-collection
262
+ // probe against a healthy cohort takes exactly that path, and the callback
263
+ // contract cannot distinguish the two without counting responders.
264
+ if (isMissing) {
265
+ const entry = localResult[blockId];
266
+ if (!entry) {
267
+ localResult[blockId] = { state: {}, unavailable: 'peers-unreachable' };
268
+ }
269
+ else if (entry.unavailable === undefined) {
270
+ entry.unavailable = 'peers-unreachable';
271
+ }
272
+ }
210
273
  }
211
274
  }
212
275
  }
@@ -249,7 +312,12 @@ export class CoordinatorRepo {
249
312
  setLastSeenForTest(blockId, ts) {
250
313
  this.lastSeenCommitMs.set(blockId, ts);
251
314
  }
252
- async fetchBlockFromCluster(blockId, context) {
315
+ /**
316
+ * One repair pass for a block: ask the cohort what it holds, and converge onto that if it is
317
+ * ahead of `localRev` — the revision the caller's read already loaded, and the baseline every
318
+ * decision below is measured against.
319
+ */
320
+ async fetchBlockFromCluster(blockId, context, localRev) {
253
321
  if (!this.clusterLatestCallback)
254
322
  return;
255
323
  const blockIdBytes = new TextEncoder().encode(blockId);
@@ -272,17 +340,30 @@ export class CoordinatorRepo {
272
340
  // block seen here would suppress the next attempt for the whole read-repair window.
273
341
  if (!corroborated)
274
342
  return;
343
+ // The self answer is the sharper baseline (same storage, same context, read alongside the
344
+ // cohort's), but it exists only when `findCluster` returned this node. A soft serve for a
345
+ // block this node is no longer responsible for is absent from its own cohort view, so fall
346
+ // back to the revision the caller's read already loaded. Without the fallback both decisions
347
+ // below degrade to "any local revision is an advance", which restores backwards and reports
348
+ // a sync at the revision the pass started from.
349
+ const baselineRev = local?.rev ?? localRev;
275
350
  // Never restore backwards. With this node's own claim excluded from the quorum, a
276
351
  // cohort that lags behind the reader corroborates an OLDER revision; adopting it
277
352
  // would be a regression, and logging it as a sync would be a lie. The cohort did
278
353
  // answer, so the block is verified fresh — mark it seen.
279
- if (local && corroborated.rev <= local.rev) {
280
- log('cluster-fetch:local-current', { blockId, localRev: local.rev, clusterRev: corroborated.rev });
354
+ // NOTE: in a cohort of two, that sole peer is the only corroborator, so a lying one can park
355
+ // the reader here corroborating the revision it already holds — and re-arm the lazy window
356
+ // on every pass, hiding a real divergence. Bounded by `readRepairWindowMs` (10s default) and
357
+ // no worse than the peer simply staying silent. If two-member cohorts become a supported
358
+ // production topology rather than a dev convenience, stop re-arming the window on a
359
+ // corroboration that came from a single voter.
360
+ if (baselineRev !== undefined && corroborated.rev <= baselineRev) {
361
+ log('cluster-fetch:local-current', { blockId, localRev: baselineRev, clusterRev: corroborated.rev });
281
362
  this.markBlocksSeen([blockId]);
282
363
  return;
283
364
  }
284
365
  // Corroborated revision is ahead of ours — converge onto it.
285
- const rev = await this.restoreCorroborated(blockId, corroborated, local, peerIds);
366
+ const rev = await this.restoreCorroborated(blockId, corroborated, baselineRev, peerIds);
286
367
  // Log the OUTCOME, not the attempt. Logging `synced` unconditionally reported hundreds of
287
368
  // phantom convergences per run and made a real replication defect invisible for two debugging
288
369
  // sessions.
@@ -290,15 +371,15 @@ export class CoordinatorRepo {
290
371
  log('cluster-fetch:synced', { blockId, rev });
291
372
  }
292
373
  else {
293
- log('cluster-fetch:not-restored', { blockId, localRev: local?.rev, clusterRev: corroborated.rev });
374
+ log('cluster-fetch:not-restored', { blockId, localRev: baselineRev, clusterRev: corroborated.rev });
294
375
  }
295
376
  // The block is marked seen either way — the cohort DID answer, so its freshness was checked,
296
377
  // which is what the read-repair window tracks. A failed convergence therefore waits out the
297
378
  // window before retrying.
298
379
  // NOTE: that damping covers only a block this node holds at an OLDER revision. A block entirely
299
380
  // missing locally never consults the window (`get` triggers on `isMissing` before
300
- // `shouldReadRepair`), so a persistently failing acquisition — e.g. a two-node deployment left
301
- // at the default `clusterSize: 10`, where the content quorum can never be met — re-fetches an
381
+ // `shouldReadRepair`), so a persistently failing acquisition — e.g. a two-node deployment that
382
+ // never set `assumedClusterSize`, where the content quorum can never be met — re-fetches an
302
383
  // archive on every read of that block. Correct, and self-limiting once the cohort can agree; if
303
384
  // it ever shows as read amplification, gate the acquisition step (not the latest-query) on the
304
385
  // same window rather than widening `isMissing`.
@@ -306,7 +387,7 @@ export class CoordinatorRepo {
306
387
  }
307
388
  /**
308
389
  * Bring this node up to the cohort-corroborated `corroborated`, returning the revision it holds
309
- * afterwards when that is an advance over `local`, else `undefined`.
390
+ * afterwards when that is an advance over `baselineRev`, else `undefined`.
310
391
  *
311
392
  * Two mechanisms, cheapest first:
312
393
  * 1. **Promote a local pending** — free, no network, and the only mechanism that existed before
@@ -326,9 +407,9 @@ export class CoordinatorRepo {
326
407
  * Cohort peer ids are passed straight through: the callback filters self out and caps its own
327
408
  * corroboration quorum by how many peers could answer at all.
328
409
  */
329
- async restoreCorroborated(blockId, corroborated, local, cohortPeerIds) {
410
+ async restoreCorroborated(blockId, corroborated, baselineRev, cohortPeerIds) {
330
411
  const promoted = await this.promoteCorroborated(blockId, corroborated);
331
- if (isAdvanceOver(promoted, local)) {
412
+ if (isAdvanceOver(promoted, baselineRev)) {
332
413
  return promoted;
333
414
  }
334
415
  if (!this.acquireBlockFromCohort) {
@@ -339,6 +420,12 @@ export class CoordinatorRepo {
339
420
  // inside the callback via `saveReplicatedBlock`, which takes the per-block commit latch —
340
421
  // safe to call from here because the read path holds no latch of its own (`StorageRepo.get`
341
422
  // acquires and releases it around the promotion above, and nothing wraps this method).
423
+ // NOTE: `get` walks its block ids sequentially, so the bound is per block, not per call — a
424
+ // multi-block read that is missing N blocks against a wholly stalled cohort waits N × this.
425
+ // Acceptable today (the underlying per-peer archive fetch is itself 1s-bounded and runs the
426
+ // cohort in parallel, so the 5s is a stall ceiling, not a typical cost). If a cold reader
427
+ // batching a wide read ever times out above this layer, repair the block ids concurrently
428
+ // rather than shortening the bound.
342
429
  await withDeadline(this.acquireBlockFromCohort(blockId, corroborated, cohortPeerIds), RECONCILE_TIMEOUT_MS, `block acquisition for ${blockId}`);
343
430
  }
344
431
  catch (err) {
@@ -347,47 +434,42 @@ export class CoordinatorRepo {
347
434
  return undefined;
348
435
  }
349
436
  const acquired = await this.readLocalRev(blockId);
350
- return isAdvanceOver(acquired, local) ? acquired : undefined;
437
+ return isAdvanceOver(acquired, baselineRev) ? acquired : undefined;
351
438
  }
352
439
  /**
353
440
  * Promote a corroborated action this node already holds as a local pending — the no-network half of
354
441
  * the repair. Returns the local revision afterwards.
355
442
  *
356
443
  * A pending-only block (metadata seeded by `savePendingTransaction`, no committed revision) asked
357
- * for a forward revision throws out of `BlockStorage.ensureRevision` when no restore can supply it.
358
- * On THIS path that is an absence, not a read failure — acquisition is precisely the mechanism that
359
- * can supply it so the throw is logged and swallowed rather than short-circuiting the caller.
444
+ * for a forward revision no promotion can reach used to throw out of `BlockStorage.ensureRevision`;
445
+ * `StorageRepo.get` now reports it as an entry flagged `unavailable` instead (ticket
446
+ * repo-reports-unavailable-vs-absent). On THIS path either shape is an absence, not a read failure
447
+ * acquisition is precisely the mechanism that can supply the revision — so both are logged as
448
+ * `promote-unavailable` and stepped over rather than short-circuiting the caller.
360
449
  */
361
450
  async promoteCorroborated(blockId, corroborated) {
362
451
  try {
363
- return await this.readLocalRev(blockId, { committed: [corroborated], rev: corroborated.rev });
452
+ const entry = await this.readLocalEntry(blockId, { committed: [corroborated], rev: corroborated.rev });
453
+ if (entry?.unavailable !== undefined) {
454
+ log('cluster-fetch:promote-unavailable', { blockId, rev: corroborated.rev, error: entry.unavailable });
455
+ return undefined;
456
+ }
457
+ return entry?.state?.latest?.rev;
364
458
  }
365
459
  catch (err) {
366
460
  log('cluster-fetch:promote-unavailable', { blockId, rev: corroborated.rev, error: err.message });
367
461
  return undefined;
368
462
  }
369
463
  }
370
- /** This node's own `latest.rev` for a block, optionally driving a promotion context through the read. */
371
- async readLocalRev(blockId, context) {
464
+ /** This node's own answer for a block, optionally driving a promotion context through the read.
465
+ * Callers that care whether the answer is authoritative inspect `entry.unavailable`. */
466
+ async readLocalEntry(blockId, context) {
372
467
  const result = await this.storageRepo.get({ blockIds: [blockId], context });
373
- return result[blockId]?.state?.latest?.rev;
468
+ return result[blockId];
374
469
  }
375
- /**
376
- * How many peers other than this node could corroborate a claim about a block, given a
377
- * cohort view of `peerIds`. Deliberately the MAX of what we observe and what the
378
- * configured cluster size implies: the corroboration floor may only be relaxed for a
379
- * cohort that is genuinely small, never for one that merely *looks* small. `findCluster`
380
- * results are unauthenticated, so a partition — or an attacker with routing influence —
381
- * can shrink this node's view to itself plus one peer; measuring against the configured
382
- * size keeps that shrunken view from talking the requirement down to a single voter.
383
- * The escape hatch for a real two-node deployment is therefore to configure
384
- * `clusterSize: 2`, an explicit operator declaration, mirroring how
385
- * `allowUnvalidatedSmallCluster` gates the membership admission floor.
386
- */
387
- corroboratorCapacity(peerIds) {
388
- const selfId = this.localPeerId?.toString();
389
- const observed = peerIds.filter(id => id !== selfId).length;
390
- return Math.max(observed, this.clusterSize - 1);
470
+ /** This node's own `latest.rev` for a block, optionally driving a promotion context through the read. */
471
+ async readLocalRev(blockId, context) {
472
+ return (await this.readLocalEntry(blockId, context))?.state?.latest?.rev;
391
473
  }
392
474
  /**
393
475
  * Query cluster peers for their latest revision and return the highest revision
@@ -410,11 +492,6 @@ export class CoordinatorRepo {
410
492
  * `debt-read-repair-commit-cert-verification`.
411
493
  */
412
494
  async queryClusterForLatest(peerIds, blockId, context) {
413
- // Add timeout wrapper to prevent hanging on unresponsive peers
414
- const withTimeout = (promise, timeoutMs) => Promise.race([
415
- promise,
416
- new Promise(resolve => setTimeout(() => resolve(undefined), timeoutMs))
417
- ]);
418
495
  // Query peers in parallel for their latest revision (with 1s timeout per peer),
419
496
  // tagging each response with the peer that made it so votes stay distinct.
420
497
  const latestResults = await Promise.allSettled(peerIds.map(async (peerIdStr) => {
@@ -422,6 +499,11 @@ export class CoordinatorRepo {
422
499
  const value = await withTimeout(this.clusterLatestCallback(peerId, blockId, context), 1000);
423
500
  return { peerIdStr, value };
424
501
  }));
502
+ // NOTE: self-exclusion is keyed on `localPeerId`, which is optional for the single-node/test
503
+ // construction this class has always tolerated. Left unset, this node's own answer is counted
504
+ // as a peer claim again. Harmless today — the self answer can only ever corroborate the
505
+ // revision already held, so the pass declines as `local-current` — but if a future caller can
506
+ // make self report something the reader does not hold, make `localPeerId` required instead.
425
507
  const selfId = this.localPeerId?.toString();
426
508
  let local;
427
509
  const claims = [];
@@ -435,7 +517,7 @@ export class CoordinatorRepo {
435
517
  }
436
518
  claims.push({ peerId: peerIdStr, rev: value.rev, actionId: value.actionId });
437
519
  }
438
- const capacity = this.corroboratorCapacity(peerIds);
520
+ const capacity = corroboratorCapacity(peerIds.filter(id => id !== selfId).length, this.repairCorroborationClusterSize);
439
521
  const selected = selectQuorumRev(claims, this.simpleMajorityThreshold, capacity);
440
522
  if (!selected) {
441
523
  log('cluster-fetch:no-quorum', {
@@ -517,9 +599,62 @@ export class CoordinatorRepo {
517
599
  }
518
600
  catch (error) {
519
601
  log('coordinator-repo:pend-error', { actionId: request.actionId, error: error.message });
602
+ const stale = await this.classifyStaleRejection(error, request, allBlockIds);
603
+ if (stale)
604
+ return stale;
520
605
  throw error;
521
606
  }
522
607
  }
608
+ /**
609
+ * Decide whether a cluster validator rejection was an optimistic-concurrency loss — the block
610
+ * already advanced past the requested revision — rather than a genuine validation fault.
611
+ * A confirmed loss returns a {@link StaleFailure} carrying `conflict: true` so the caller
612
+ * receives a non-success *response* that says plainly it is a lost race: network-transactor's
613
+ * pend then takes its stale branch and both writers (`Collection.sync`, and the coordinator's
614
+ * multi-collection pendPhase via `isConflictFailure`) retry, instead of a thrown error escaping
615
+ * mid-batch (which splits multi-tree commits — see PartialCommitError).
616
+ *
617
+ * The failure carries no `missing` list: confirmation is a local re-read that reveals the
618
+ * revision is taken but not which actions took it, and no consumer rebases from `missing`
619
+ * anyway (it is only counted or logged). `conflict` conveys retryability directly instead.
620
+ *
621
+ * Confirmation is purely local: re-read the affected blocks from our own storage and require
622
+ * `latest.rev >= request.rev`. The signed reject-reason text is never consulted — it is
623
+ * free-form wire-visible prose and must not become control flow. Anything unconfirmed
624
+ * (including read errors during confirmation) stays a throw, preserving fail-fast for
625
+ * genuine validation faults.
626
+ */
627
+ async classifyStaleRejection(error, request, blockIds) {
628
+ if (!(error instanceof ValidatorRejectionError) || request.rev === undefined)
629
+ return undefined;
630
+ let results;
631
+ try {
632
+ results = await this.storageRepo.get({ blockIds });
633
+ }
634
+ catch (readError) {
635
+ log('coordinator-repo:pend-stale-classify-read-error', {
636
+ actionId: request.actionId,
637
+ error: readError.message
638
+ });
639
+ return undefined;
640
+ }
641
+ for (const blockId of blockIds) {
642
+ const latest = results[blockId]?.state.latest;
643
+ if (latest && latest.rev >= request.rev) {
644
+ log('coordinator-repo:pend-stale-classified', {
645
+ actionId: request.actionId,
646
+ blockId,
647
+ latestRev: latest.rev,
648
+ requestedRev: request.rev
649
+ });
650
+ return { success: false, conflict: true, reason: `stale revision: block ${blockId} at rev ${latest.rev}, requested rev ${request.rev}` };
651
+ }
652
+ }
653
+ // NOTE: conservative — when only remote members saw the newer revision (local storage still
654
+ // behind), staleness can't be confirmed locally and the rejection stays a throw. If that
655
+ // shows up in practice, extend confirmation with a quorum read; never trust the reject text.
656
+ return undefined;
657
+ }
523
658
  async cancel(actionRef, options) {
524
659
  const blockIds = actionRef.blockIds;
525
660
  await this.verifyResponsibility(blockIds);
@@ -564,25 +699,33 @@ export class CoordinatorRepo {
564
699
  this.markBlocksSeen(blockIds);
565
700
  return { success: true };
566
701
  }
567
- // Local cluster didn't execute during consensus. Attempt a local commit,
568
- // but tolerate failure (e.g., "pending action not found") when the cluster
569
- // already reached consensus this coordinator was likely picked for commit
570
- // after missing the pend phase (unreachable during pend, fresh join, etc.).
571
- // The cluster's majority is authoritative; this peer will catch up via sync.
702
+ // Local cluster didn't execute during consensus. Attempt a local commit, but tolerate
703
+ // local divergence when the cluster already reached consensus this coordinator was
704
+ // likely picked for commit after missing the pend phase (unreachable during pend, fresh
705
+ // join, etc.). The cluster's majority is authoritative; this peer catches up via sync.
706
+ //
707
+ // Divergence reaches us in BOTH shapes and both must be tolerated identically:
708
+ // - a THROW ("Pending action … not found"), when we never saw the pend;
709
+ // - a RETURNED `success:false` carrying `missing-base-revision`, when we saw the pend
710
+ // but not the revision that created the block (see StorageRepo.internalCommit).
711
+ // Only the throw was tolerated before the refusal existed. Reporting the refusal to the
712
+ // caller instead would surface a committed transaction as a stale loss: db-core's
713
+ // commitPhase treats any returned `success:false` as a permanent stale failure, so the
714
+ // client would retry an action the cluster already landed until it exhausted its budget.
572
715
  try {
573
716
  const result = await this.storageRepo.commit(request, options);
574
- if (result.success)
717
+ if (result.success) {
575
718
  this.markBlocksSeen(blockIds);
719
+ return result;
720
+ }
721
+ if (isMissingBaseRevisionFailure(result) && clusterReachedCommitConsensus(record)) {
722
+ return this.tolerateLocalCommitDivergence(request, blockIds, result.reason ?? MISSING_BASE_REVISION_REASON);
723
+ }
576
724
  return result;
577
725
  }
578
726
  catch (err) {
579
727
  if (clusterReachedCommitConsensus(record)) {
580
- log('coordinator-repo:commit-local-failed-cluster-succeeded', {
581
- actionId: request.actionId,
582
- error: err.message
583
- });
584
- this.markBlocksSeen(blockIds);
585
- return { success: true };
728
+ return this.tolerateLocalCommitDivergence(request, blockIds, err.message);
586
729
  }
587
730
  throw err;
588
731
  }
@@ -592,6 +735,16 @@ export class CoordinatorRepo {
592
735
  throw error;
593
736
  }
594
737
  }
738
+ /**
739
+ * Report success for a commit the cluster carried but this peer could not apply locally. The
740
+ * blocks are marked seen so the read path treats them as freshness-checked; convergence comes
741
+ * from replication (cohort reconcile, or read-driven acquisition), not from replay here.
742
+ */
743
+ tolerateLocalCommitDivergence(request, blockIds, detail) {
744
+ log('coordinator-repo:commit-local-failed-cluster-succeeded', { actionId: request.actionId, error: detail });
745
+ this.markBlocksSeen(blockIds);
746
+ return { success: true };
747
+ }
595
748
  }
596
749
  /** True if a simple majority of cluster peers signed an approving commit. */
597
750
  function clusterReachedCommitConsensus(record) {
@@ -1 +1 @@
1
- {"version":3,"file":"coordinator-repo.js","sourceRoot":"","sources":["../../../src/repo/coordinator-repo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACtG,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAG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AIG;IACK,6BAA6B,CAAC,OAAsB,EAAE,QAAmB,EAAE,MAAc;QAChG,GAAG,CAAC,wDAAwD,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QAC7G,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAC9B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC1B,CAAC;;AAGF,6EAA6E;AAC7E,SAAS,6BAA6B,CAAC,MAAqB;IAC3D,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;IACnD,IAAI,SAAS,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAClC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,MAAM,CAAC;IAC/F,OAAO,eAAe,GAAG,SAAS,GAAG,CAAC,CAAC;AACxC,CAAC"}
@@ -125,6 +125,15 @@ export declare class StorageRepo implements IRepo, IBlockChangeNotifier, IBlockR
125
125
  * all, so it is translated into {@link MissingBaseRevisionError} rather than surfacing as an opaque
126
126
  * storage fault: the healing path can then repair the block instead of the fault resetting the
127
127
  * cluster stream, and a wedged node recovers on the next write touching the block.
128
+ *
129
+ * The catch is deliberately UNNARROWED — it also absorbs a transient fault (a raw-storage read
130
+ * error, a `restoreCallback` timeout on a block whose `ranges` do not cover its own `latest`).
131
+ * BlockStorage reports every one of these as a bare `Error`, so they cannot be told apart here,
132
+ * and treating them as divergence is the safe default: this node genuinely cannot materialize the
133
+ * base right now, and the cluster's policy is to heal rather than throw out of consensus. The
134
+ * price is that a transient fault ALSO drops the pending (see {@link refuseMissingBase}), so the
135
+ * block converges by replication instead of by a replay the retry could have done. Narrowing this
136
+ * would require typed faults out of BlockStorage; until then, prefer the tolerant reading.
128
137
  */
129
138
  private readCommitBase;
130
139
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"storage-repo.d.ts","sourceRoot":"","sources":["../../../src/storage/storage-repo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EACzG,SAAS,EACH,MAAM,EAAE,SAAS,EACjC,kBAAkB,EAClB,YAAY,EAAE,oBAAoB,EAAE,wBAAwB,EAC5D,MAAM,qBAAqB,CAAC;AAM7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAK/E;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS,OAAO,KAAG,MAAyC,CAAC;AAE5F;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAOhG;AAED;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,0BAA0B,CAAC;AAEpE;;;;;;GAMG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;IACtC,QAAQ,CAAC,OAAO,EAAE,OAAO;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM;gBAAtC,OAAO,EAAE,OAAO,EAAW,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAI3E;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAE1E;AAED,MAAM,MAAM,kBAAkB,GAAG;IAChC,6DAA6D;IAC7D,YAAY,CAAC,EAAE,kBAAkB,CAAC;CAClC,CAAC;AAEF,qBAAa,WAAY,YAAW,KAA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