@optimystic/db-p2p 0.27.0 → 0.29.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 (67) hide show
  1. package/dist/src/cluster/block-transfer-service.d.ts +0 -10
  2. package/dist/src/cluster/block-transfer-service.d.ts.map +1 -1
  3. package/dist/src/cluster/block-transfer-service.js +4 -2
  4. package/dist/src/cluster/block-transfer-service.js.map +1 -1
  5. package/dist/src/cluster/cluster-policy.d.ts +101 -18
  6. package/dist/src/cluster/cluster-policy.d.ts.map +1 -1
  7. package/dist/src/cluster/cluster-policy.js +153 -30
  8. package/dist/src/cluster/cluster-policy.js.map +1 -1
  9. package/dist/src/cluster/quorum-restore.d.ts +4 -2
  10. package/dist/src/cluster/quorum-restore.d.ts.map +1 -1
  11. package/dist/src/cluster/quorum-restore.js +4 -2
  12. package/dist/src/cluster/quorum-restore.js.map +1 -1
  13. package/dist/src/cluster/service.d.ts +12 -9
  14. package/dist/src/cluster/service.d.ts.map +1 -1
  15. package/dist/src/cluster/service.js +6 -6
  16. package/dist/src/cluster/service.js.map +1 -1
  17. package/dist/src/dispute/service.d.ts +1 -4
  18. package/dist/src/dispute/service.d.ts.map +1 -1
  19. package/dist/src/dispute/service.js +2 -1
  20. package/dist/src/dispute/service.js.map +1 -1
  21. package/dist/src/libp2p-key-network.d.ts +38 -0
  22. package/dist/src/libp2p-key-network.d.ts.map +1 -1
  23. package/dist/src/libp2p-key-network.js +47 -1
  24. package/dist/src/libp2p-key-network.js.map +1 -1
  25. package/dist/src/libp2p-node-base.d.ts.map +1 -1
  26. package/dist/src/libp2p-node-base.js +22 -19
  27. package/dist/src/libp2p-node-base.js.map +1 -1
  28. package/dist/src/logger.d.ts +28 -1
  29. package/dist/src/logger.d.ts.map +1 -1
  30. package/dist/src/logger.js +143 -1
  31. package/dist/src/logger.js.map +1 -1
  32. package/dist/src/network/network-manager-service.d.ts +1 -4
  33. package/dist/src/network/network-manager-service.d.ts.map +1 -1
  34. package/dist/src/network/network-manager-service.js +2 -1
  35. package/dist/src/network/network-manager-service.js.map +1 -1
  36. package/dist/src/repo/coordinator-repo.d.ts +183 -13
  37. package/dist/src/repo/coordinator-repo.d.ts.map +1 -1
  38. package/dist/src/repo/coordinator-repo.js +686 -107
  39. package/dist/src/repo/coordinator-repo.js.map +1 -1
  40. package/dist/src/repo/service.d.ts +9 -6
  41. package/dist/src/repo/service.d.ts.map +1 -1
  42. package/dist/src/repo/service.js +4 -5
  43. package/dist/src/repo/service.js.map +1 -1
  44. package/dist/src/sync/service.d.ts +1 -2
  45. package/dist/src/sync/service.d.ts.map +1 -1
  46. package/dist/src/sync/service.js +2 -1
  47. package/dist/src/sync/service.js.map +1 -1
  48. package/dist/src/testing/mesh-harness.d.ts +7 -1
  49. package/dist/src/testing/mesh-harness.d.ts.map +1 -1
  50. package/dist/src/testing/mesh-harness.js +2 -1
  51. package/dist/src/testing/mesh-harness.js.map +1 -1
  52. package/package.json +2 -2
  53. package/readme.md +19 -0
  54. package/src/cluster/block-transfer-service.ts +4 -8
  55. package/src/cluster/cluster-policy.ts +196 -36
  56. package/src/cluster/quorum-restore.ts +4 -2
  57. package/src/cluster/service.ts +14 -9
  58. package/src/dispute/service.ts +3 -3
  59. package/src/libp2p-key-network.ts +50 -1
  60. package/src/libp2p-node-base.ts +22 -19
  61. package/src/logger.ts +196 -2
  62. package/src/network/network-manager-service.ts +414 -414
  63. package/src/protocol-client.ts +196 -196
  64. package/src/repo/coordinator-repo.ts +833 -122
  65. package/src/repo/service.ts +12 -9
  66. package/src/sync/service.ts +3 -5
  67. package/src/testing/mesh-harness.ts +8 -1
@@ -164,16 +164,6 @@ export interface BlockTransferServiceComponents {
164
164
  * its thresholds with.
165
165
  */
166
166
  superMajorityThreshold: number;
167
- /**
168
- * Optional libp2p component logger. Supplied by the node factory so authorization denials
169
- * land on the same `logger.forComponent(...).error` sink as the repo/cluster/sync services;
170
- * without it they fall back to this module's `debug` logger.
171
- */
172
- logger?: {
173
- forComponent: (name: string) => {
174
- error: (message: string, ...args: unknown[]) => void;
175
- };
176
- };
177
167
  }
178
168
  /**
179
169
  * Libp2p service that handles incoming block transfer requests.
@@ -1 +1 @@
1
- {"version":3,"file":"block-transfer-service.d.ts","sourceRoot":"","sources":["../../../src/cluster/block-transfer-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,SAAS,EAAU,MAAM,mBAAmB,CAAC;AACvE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAK7H,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,EAAqE,KAAK,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAErJ,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AASrF,eAAO,MAAM,0BAA0B,GAAI,iBAAgB,MAAW,KAAG,MACJ,CAAC;AAEtE,iCAAiC;AACjC,MAAM,WAAW,oBAAoB;IACpC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,kCAAkC;IAClC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,0BAA0B;IAC1B,MAAM,EAAE,WAAW,GAAG,aAAa,GAAG,UAAU,CAAC;IACjD,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,QAAQ,CAAA;KAAE,CAAC,CAAC;IAChE;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC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AAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAAE,GACpF,OAAO,CAAC,qBAAqB,CAAC;CAYjC"}
@@ -108,8 +108,10 @@ export class BlockTransferService {
108
108
  this.registrar = components.registrar;
109
109
  this.proofThresholds = proofThresholds(components.superMajorityThreshold);
110
110
  this.requirePushCertificate = init.requirePushCertificate ?? true;
111
- const componentLog = components.logger?.forComponent('db-p2p:block-transfer');
112
- this.authorization = createInboundStreamAuthorization(init, this.protocol, componentLog ? (msg, ...args) => componentLog.error(msg, ...args) : (msg, ...args) => log(msg, ...args));
111
+ // Denials are errors, so they go to this module's own `:error` child channel rather than its
112
+ // main one visible under `optimystic:db-p2p:block-transfer-service:*`, not under an exact
113
+ // match on `optimystic:db-p2p:block-transfer-service` alone.
114
+ this.authorization = createInboundStreamAuthorization(init, this.protocol, (msg, ...args) => log.error(msg, ...args));
113
115
  }
114
116
  async start() {
115
117
  if (this.running)
@@ -1 +1 @@
1
- {"version":3,"file":"block-transfer-service.js","sourceRoot":"","sources":["../../../src/cluster/block-transfer-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,UAAU,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,gCAAgC,EAAwE,MAAM,6BAA6B,CAAC;AACrJ,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExE,OAAO,EAAE,aAAa,EAA2B,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAE,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AAyB;YACrC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS;YACzC,GAAG,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,aAAa,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3E,GAAG,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACjF,CAAC;QACF,OAAO,MAAM,IAAI,CAAC,cAAc,CAAwB,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,CAAC,CAAC;IACzI,CAAC;CACD"}
@@ -10,9 +10,9 @@ import { type ClusterConsensusConfig, type UnvalidatablePendPolicy } from "@opti
10
10
  *
11
11
  * ## Why two size yardsticks, not one
12
12
  *
13
- * One operator field — `clusterPolicy.assumedClusterSize`, "the smallest cohort this deployment can
14
- * genuinely field" — feeds two consumers whose failure modes point in opposite directions, so its
15
- * *default* cannot serve both:
13
+ * `clusterPolicy.assumedClusterSize` "the smallest cohort this deployment can genuinely field" —
14
+ * feeds two consumers whose failure modes point in opposite directions, so its *default* cannot
15
+ * serve both:
16
16
  *
17
17
  * - **Membership admission gate** (`cluster/cluster-repo.ts`, `admitMembership`) reads it only on its
18
18
  * fallback path, when this node has no confident network-size estimate. Too small: a
@@ -21,17 +21,32 @@ import { type ClusterConsensusConfig, type UnvalidatablePendPolicy } from "@opti
21
21
  * two-node mesh must still be able to transact. It gets {@link minAbsoluteClusterSize} (2).
22
22
  * - **Repair corroboration floor** (`corroboratorCapacity` in `cluster/quorum-restore.ts`, called by
23
23
  * `CoordinatorRepo.queryClusterForLatest` and `createReconcileBlock`) reads it on *every* repair,
24
- * unconditionally. Too small: a shrunken — and always unauthenticated — cohort view buys a lone
25
- * peer full trust. Too large: a block stays unrepaired, degraded rather than dead. It wants a
26
- * *strict* default. It gets {@link ResolvedClusterPolicy.repairCorroborationClusterSize}, which
27
- * falls back to `clusterSize` (the configured replication factor).
24
+ * unconditionally — as the *fallback* for its own field, below. Too small: a shrunken — and always
25
+ * unauthenticated — cohort view buys a lone peer full trust. Too large: a block stays unrepaired,
26
+ * degraded rather than dead. It wants a *strict* default. It gets
27
+ * {@link ResolvedClusterPolicy.repairCorroborationClusterSize}, which falls back in turn to
28
+ * `clusterSize` (the configured replication factor).
28
29
  *
29
- * A single explicit `clusterPolicy.assumedClusterSize` still sets BOTH — an operator declaring their
30
- * real cohort size means it for both consumers. Only the unconfigured case diverges.
30
+ * ## The two operator fields
31
31
  *
32
- * So a genuine two-node mesh needs exactly one setting to self-repair: either
33
- * `clusterPolicy.assumedClusterSize: 2` (which does not lower the replication factor) or an honest
34
- * `clusterSize: 2`. Writes and voting still work with zero configuration.
32
+ * `clusterPolicy.repairCorroborationClusterSize` declares the **repair yardstick alone**, leaving the
33
+ * admission gate at its permissive default. `clusterPolicy.assumedClusterSize` remains the shared
34
+ * field and still sets BOTH an operator declaring their real cohort size usually means it for both
35
+ * consumers — but it is now the *fallback* for the repair yardstick, not its only declared source.
36
+ * The repair yardstick is therefore fully declarable on its own.
37
+ *
38
+ * The split exists because the two directions cost different things. Raising the repair yardstick is
39
+ * a pure tightening: the worst outcome is a block that stays unrepaired. Raising the admission
40
+ * yardstick trades write availability — a node with no confident network-size estimate demands
41
+ * `ceil(membershipAdmissionFraction x assumedClusterSize)` declared peers and refuses writes below
42
+ * that. A host that knows its real machine count and wants only the strict yardstick raised (so a
43
+ * shrunken, unauthenticated cohort view cannot talk repair down to trusting one peer) declares
44
+ * `repairCorroborationClusterSize` and leaves `assumedClusterSize` alone.
45
+ *
46
+ * So a genuine two-node mesh needs exactly one setting to self-repair: any of
47
+ * `clusterPolicy.repairCorroborationClusterSize: 2`, `clusterPolicy.assumedClusterSize: 2` (neither
48
+ * of which lowers the replication factor), or an honest `clusterSize: 2`. Writes and voting still
49
+ * work with zero configuration.
35
50
  *
36
51
  * ## Future
37
52
  *
@@ -65,10 +80,11 @@ export interface ClusterPolicyOptions {
65
80
  * the coordinator aims for. NOT a statement about how many peers actually exist, so the
66
81
  * membership admission gate is never measured against it (see `cluster/cluster-repo.ts`).
67
82
  *
68
- * The read-repair/reconcile corroboration floor DOES fall back to it when
69
- * `clusterPolicy.assumedClusterSize` is absent — the strict direction, so an unconfigured node
70
- * cannot have its floor talked down by a shrunken cohort view. A deployment that genuinely runs
71
- * fewer peers than this should declare `clusterPolicy.assumedClusterSize`.
83
+ * The read-repair/reconcile corroboration floor DOES fall back to it — last in the chain
84
+ * `clusterPolicy.repairCorroborationClusterSize` -> `clusterPolicy.assumedClusterSize` ->
85
+ * `clusterSize` the strict direction, so an unconfigured node cannot have its floor talked down
86
+ * by a shrunken cohort view. A deployment that genuinely runs fewer peers than this should declare
87
+ * one of those two `clusterPolicy` fields.
72
88
  */
73
89
  clusterSize?: number;
74
90
  clusterPolicy?: {
@@ -97,6 +113,33 @@ export interface ClusterPolicyOptions {
97
113
  * `clusterSize: 2`) to self-repair.
98
114
  */
99
115
  assumedClusterSize?: number;
116
+ /**
117
+ * The cohort size the **repair corroboration floor alone** is measured against
118
+ * (`corroboratorCapacity` in `cluster/quorum-restore.ts`, read on every read-repair and every
119
+ * reconcile). Declaring it is a pure tightening: the worst cost of overstating it is a block
120
+ * that stays unrepaired — degraded, not dead.
121
+ *
122
+ * Deliberately does NOT touch {@link assumedClusterSize}, which is the membership admission
123
+ * gate's low-confidence write floor: raising that one can make a node refuse legitimate writes
124
+ * while its network-size estimate is unconfident. A host that derives its machine count from
125
+ * its own authenticated membership records and wants only the strict yardstick raised declares
126
+ * this field. It also does not touch {@link ClusterPolicyOptions.clusterSize} (the replication
127
+ * factor).
128
+ *
129
+ * Wins over `assumedClusterSize` for the repair yardstick when both are declared; when absent
130
+ * the chain falls through to `assumedClusterSize`, then to `clusterSize`. A value above
131
+ * `clusterSize` is accepted and never raises the corroboration requirement (capped at
132
+ * `CORROBORATION_FLOOR`), but it is not free: it is also the denominator
133
+ * `CoordinatorRepo.commitQuorumRulesOutRivals` measures a local commit against before arming
134
+ * the lazy read-repair freshness window, so a yardstick well above the cohort a commit
135
+ * actually reaches stops that window arming and costs one cohort consult per written block
136
+ * per window. Declare the machine count you run, not a safety margin.
137
+ *
138
+ * Applied at node construction only — there is deliberately no runtime setter. A host that
139
+ * learns a new machine count applies it by building a new node; see the accepted-tradeoff
140
+ * `NOTE:` in {@link resolveClusterPolicy}.
141
+ */
142
+ repairCorroborationClusterSize?: number;
100
143
  /**
101
144
  * What a validator-configured member does with a pend that carries no `validation` payload
102
145
  * (nothing to re-execute — the single-collection `Collection.sync` shape). Default 'accept';
@@ -114,11 +157,51 @@ export type ResolvedClusterPolicy = ClusterConsensusConfig & {
114
157
  * cohort view against — see `corroboratorCapacity` in `cluster/quorum-restore.ts`.
115
158
  *
116
159
  * Deliberately distinct from {@link ClusterConsensusConfig.assumedClusterSize}, which the
117
- * membership admission gate reads: the two share an operator field but not a default, because
118
- * over- and under-stating them cost opposite things. See the module doc.
160
+ * membership admission gate reads: over- and under-stating the two cost opposite things, so they
161
+ * share neither a default nor since `clusterPolicy.repairCorroborationClusterSize` a required
162
+ * operator field. See the module doc.
119
163
  */
120
164
  repairCorroborationClusterSize: number;
121
165
  };
166
+ /**
167
+ * A declared cohort size, or `undefined` if the operator handed over something that is not one.
168
+ *
169
+ * `Number.isInteger` already rejects `NaN`, both infinities and every fractional value, so the extra
170
+ * check is only the sign. Used for both declared size fields in the repair yardstick's fall-through
171
+ * chain — see the `NOTE:` in {@link resolveRepairCorroborationClusterSize} for why a bad value falls
172
+ * through rather than being clamped.
173
+ */
174
+ export declare function asDeclaredSize(value: number | undefined): number | undefined;
175
+ /**
176
+ * The repair corroboration floor's yardstick, from the two operator fields and the replication
177
+ * factor: `repairCorroborationClusterSize` -> `assumedClusterSize` -> `clusterSize`, floored at
178
+ * {@link minAbsoluteClusterSize}.
179
+ *
180
+ * Exported because there are TWO composition paths onto this number — {@link resolveClusterPolicy}
181
+ * (what `createLibp2pNodeBase` runs) and the `CoordinatorRepo` constructor (the readme's manual
182
+ * wiring, `repo/coordinator-repo.ts`) — and a node and a hand-wired coordinator given the same
183
+ * operator numbers must land on the same yardstick, or the two disagree about how much trust a lone
184
+ * peer gets. One function rather than two copies of the chain, so they cannot drift.
185
+ *
186
+ * NOTE: a declared size that is not a positive finite integer is treated as NOT DECLARED and falls
187
+ * through to the next term, rather than being clamped. Clamping to {@link minAbsoluteClusterSize}
188
+ * would be the UNSAFE direction: 2 is the one size whose corroboration floor relaxes to a single
189
+ * voter, so a NaN — which today makes every quorum comparison false, and therefore declines repair
190
+ * forever, dead but safe — would become "trust one peer". Falling through treats a nonsense
191
+ * declaration as no declaration and lands on the strict `clusterSize` default instead.
192
+ *
193
+ * NOTE: the result is deliberately NOT floored at {@link minAbsoluteClusterSize}. Such a floor looks
194
+ * free — it cannot change the corroboration requirement, since `quorumSize` takes
195
+ * `max(1, min(CORROBORATION_FLOOR, capacity))` and `corroboratorCapacity`'s own max against visible
196
+ * peers absorbs the difference at every peer count — but this number has a SECOND consumer:
197
+ * `CoordinatorRepo.commitQuorumRulesOutRivals` uses it as the full-cohort denominator a local commit
198
+ * must beat to arm the lazy read-repair freshness window. Flooring a genuine `clusterSize: 1` up to 2
199
+ * makes a solo node's own commit stop clearing that bar, so every written block pays a cohort consult
200
+ * per window — a real cost in a supported topology (one machine is an ordinary deployment size, see
201
+ * `docs/architecture.md`). Pinned by 'a solo commit on a genuine cohort of one DOES arm the window'
202
+ * in `test/coordinator-repo-commit-freshness.spec.ts`.
203
+ */
204
+ export declare function resolveRepairCorroborationClusterSize(declaredRepairSize: number | undefined, declaredCohortSize: number | undefined, clusterSize: number): number;
122
205
  /**
123
206
  * Apply every cluster-policy default a node needs. Same options in, same numbers out, so the
124
207
  * composition root's behavior is unit-testable (`test/cluster-policy.spec.ts`). Its one side effect
@@ -1 +1 @@
1
- {"version":3,"file":"cluster-policy.d.ts","sourceRoot":"","sources":["../../../src/cluster/cluster-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,sBAAsB,EAAE,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAMlI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE;QACf,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,0DAA0D;QAC1D,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,sGAAsG;QACtG,sBAAsB,CAAC,EAAE,MAAM,CAAC;QAChC;;;;;WAKG;QACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;QACvC;;;;;;;;;;;WAWG;QACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B;;;;WAIG;QACH,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;KAClD,CAAC;CACF;AAED,kGAAkG;AAClG,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,GAAG;IAC5D,oFAAoF;IACpF,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;;OAOG;IACH,8BAA8B,EAAE,MAAM,CAAC;CACvC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,oBAAoB,GAAG,qBAAqB,CA4JzF"}
1
+ {"version":3,"file":"cluster-policy.d.ts","sourceRoot":"","sources":["../../../src/cluster/cluster-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,sBAAsB,EAAE,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAMlI;;;;;;;;;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qBAAqB,CA+NzF"}
@@ -13,9 +13,9 @@ const log = createLogger('cluster-policy');
13
13
  *
14
14
  * ## Why two size yardsticks, not one
15
15
  *
16
- * One operator field — `clusterPolicy.assumedClusterSize`, "the smallest cohort this deployment can
17
- * genuinely field" — feeds two consumers whose failure modes point in opposite directions, so its
18
- * *default* cannot serve both:
16
+ * `clusterPolicy.assumedClusterSize` "the smallest cohort this deployment can genuinely field" —
17
+ * feeds two consumers whose failure modes point in opposite directions, so its *default* cannot
18
+ * serve both:
19
19
  *
20
20
  * - **Membership admission gate** (`cluster/cluster-repo.ts`, `admitMembership`) reads it only on its
21
21
  * fallback path, when this node has no confident network-size estimate. Too small: a
@@ -24,17 +24,32 @@ const log = createLogger('cluster-policy');
24
24
  * two-node mesh must still be able to transact. It gets {@link minAbsoluteClusterSize} (2).
25
25
  * - **Repair corroboration floor** (`corroboratorCapacity` in `cluster/quorum-restore.ts`, called by
26
26
  * `CoordinatorRepo.queryClusterForLatest` and `createReconcileBlock`) reads it on *every* repair,
27
- * unconditionally. Too small: a shrunken — and always unauthenticated — cohort view buys a lone
28
- * peer full trust. Too large: a block stays unrepaired, degraded rather than dead. It wants a
29
- * *strict* default. It gets {@link ResolvedClusterPolicy.repairCorroborationClusterSize}, which
30
- * falls back to `clusterSize` (the configured replication factor).
27
+ * unconditionally — as the *fallback* for its own field, below. Too small: a shrunken — and always
28
+ * unauthenticated — cohort view buys a lone peer full trust. Too large: a block stays unrepaired,
29
+ * degraded rather than dead. It wants a *strict* default. It gets
30
+ * {@link ResolvedClusterPolicy.repairCorroborationClusterSize}, which falls back in turn to
31
+ * `clusterSize` (the configured replication factor).
31
32
  *
32
- * A single explicit `clusterPolicy.assumedClusterSize` still sets BOTH — an operator declaring their
33
- * real cohort size means it for both consumers. Only the unconfigured case diverges.
33
+ * ## The two operator fields
34
34
  *
35
- * So a genuine two-node mesh needs exactly one setting to self-repair: either
36
- * `clusterPolicy.assumedClusterSize: 2` (which does not lower the replication factor) or an honest
37
- * `clusterSize: 2`. Writes and voting still work with zero configuration.
35
+ * `clusterPolicy.repairCorroborationClusterSize` declares the **repair yardstick alone**, leaving the
36
+ * admission gate at its permissive default. `clusterPolicy.assumedClusterSize` remains the shared
37
+ * field and still sets BOTH an operator declaring their real cohort size usually means it for both
38
+ * consumers — but it is now the *fallback* for the repair yardstick, not its only declared source.
39
+ * The repair yardstick is therefore fully declarable on its own.
40
+ *
41
+ * The split exists because the two directions cost different things. Raising the repair yardstick is
42
+ * a pure tightening: the worst outcome is a block that stays unrepaired. Raising the admission
43
+ * yardstick trades write availability — a node with no confident network-size estimate demands
44
+ * `ceil(membershipAdmissionFraction x assumedClusterSize)` declared peers and refuses writes below
45
+ * that. A host that knows its real machine count and wants only the strict yardstick raised (so a
46
+ * shrunken, unauthenticated cohort view cannot talk repair down to trusting one peer) declares
47
+ * `repairCorroborationClusterSize` and leaves `assumedClusterSize` alone.
48
+ *
49
+ * So a genuine two-node mesh needs exactly one setting to self-repair: any of
50
+ * `clusterPolicy.repairCorroborationClusterSize: 2`, `clusterPolicy.assumedClusterSize: 2` (neither
51
+ * of which lowers the replication factor), or an honest `clusterSize: 2`. Writes and voting still
52
+ * work with zero configuration.
38
53
  *
39
54
  * ## Future
40
55
  *
@@ -57,6 +72,49 @@ export const minAbsoluteClusterSize = 2;
57
72
  * here would have resolved to". Repeating the literal is how the two drifted last time.
58
73
  */
59
74
  export const DEFAULT_CLUSTER_SIZE = 10;
75
+ /**
76
+ * A declared cohort size, or `undefined` if the operator handed over something that is not one.
77
+ *
78
+ * `Number.isInteger` already rejects `NaN`, both infinities and every fractional value, so the extra
79
+ * check is only the sign. Used for both declared size fields in the repair yardstick's fall-through
80
+ * chain — see the `NOTE:` in {@link resolveRepairCorroborationClusterSize} for why a bad value falls
81
+ * through rather than being clamped.
82
+ */
83
+ export function asDeclaredSize(value) {
84
+ return Number.isInteger(value) && value > 0 ? value : undefined;
85
+ }
86
+ /**
87
+ * The repair corroboration floor's yardstick, from the two operator fields and the replication
88
+ * factor: `repairCorroborationClusterSize` -> `assumedClusterSize` -> `clusterSize`, floored at
89
+ * {@link minAbsoluteClusterSize}.
90
+ *
91
+ * Exported because there are TWO composition paths onto this number — {@link resolveClusterPolicy}
92
+ * (what `createLibp2pNodeBase` runs) and the `CoordinatorRepo` constructor (the readme's manual
93
+ * wiring, `repo/coordinator-repo.ts`) — and a node and a hand-wired coordinator given the same
94
+ * operator numbers must land on the same yardstick, or the two disagree about how much trust a lone
95
+ * peer gets. One function rather than two copies of the chain, so they cannot drift.
96
+ *
97
+ * NOTE: a declared size that is not a positive finite integer is treated as NOT DECLARED and falls
98
+ * through to the next term, rather than being clamped. Clamping to {@link minAbsoluteClusterSize}
99
+ * would be the UNSAFE direction: 2 is the one size whose corroboration floor relaxes to a single
100
+ * voter, so a NaN — which today makes every quorum comparison false, and therefore declines repair
101
+ * forever, dead but safe — would become "trust one peer". Falling through treats a nonsense
102
+ * declaration as no declaration and lands on the strict `clusterSize` default instead.
103
+ *
104
+ * NOTE: the result is deliberately NOT floored at {@link minAbsoluteClusterSize}. Such a floor looks
105
+ * free — it cannot change the corroboration requirement, since `quorumSize` takes
106
+ * `max(1, min(CORROBORATION_FLOOR, capacity))` and `corroboratorCapacity`'s own max against visible
107
+ * peers absorbs the difference at every peer count — but this number has a SECOND consumer:
108
+ * `CoordinatorRepo.commitQuorumRulesOutRivals` uses it as the full-cohort denominator a local commit
109
+ * must beat to arm the lazy read-repair freshness window. Flooring a genuine `clusterSize: 1` up to 2
110
+ * makes a solo node's own commit stop clearing that bar, so every written block pays a cohort consult
111
+ * per window — a real cost in a supported topology (one machine is an ordinary deployment size, see
112
+ * `docs/architecture.md`). Pinned by 'a solo commit on a genuine cohort of one DOES arm the window'
113
+ * in `test/coordinator-repo-commit-freshness.spec.ts`.
114
+ */
115
+ export function resolveRepairCorroborationClusterSize(declaredRepairSize, declaredCohortSize, clusterSize) {
116
+ return asDeclaredSize(declaredRepairSize) ?? asDeclaredSize(declaredCohortSize) ?? clusterSize;
117
+ }
60
118
  /**
61
119
  * Apply every cluster-policy default a node needs. Same options in, same numbers out, so the
62
120
  * composition root's behavior is unit-testable (`test/cluster-policy.spec.ts`). Its one side effect
@@ -64,18 +122,26 @@ export const DEFAULT_CLUSTER_SIZE = 10;
64
122
  * that knows the resolution produced a combination with no repair margin — or none at all.
65
123
  */
66
124
  export function resolveClusterPolicy(options) {
67
- // undefined here means "the operator said nothing", which is the only case where the two
68
- // yardsticks below diverge.
125
+ // Nothing usable on EITHER declared field means "the operator said nothing", which is the only
126
+ // case where the two yardsticks below diverge. Why a degenerate declaration counts as nothing
127
+ // rather than being clamped: see the `NOTE:` on `resolveRepairCorroborationClusterSize`.
69
128
  //
70
- // NOTE: a declared value is passed through unvalidated. The admission gate floors a degenerate one
71
- // (0, negative, NaN, Infinity) itself — see `cluster-repo.admissionFloor` and its specs — but
72
- // `corroboratorCapacity` does not: NaN there makes every quorum comparison false, so repair
73
- // silently declines forever. Fail-safe, and unreachable through the reference-peer CLI (which
74
- // rejects non-positive integers). If another composition root starts accepting unvalidated config,
75
- // clamp here rather than in each consumer.
129
+ // The ADMISSION-gate value below stays an unvalidated pass-through on purpose:
130
+ // `cluster-repo.admissionFloor` already floors a degenerate one itself (see its specs), and
131
+ // changing that here would alter documented behaviour with no bug behind it.
132
+ //
133
+ // NOTE: accepted tradeoff resolved once, at node construction; there is deliberately no runtime
134
+ // mutation of either size yardstick. A host that learns a new machine count applies it by building
135
+ // a new node (which every embedder already does on restart and on wake from hibernation), not
136
+ // through a setter: a construction-time argument is what keeps the number un-reachable from the
137
+ // network, and every consumer holds it as an immutable snapshot. Weighed against a
138
+ // live-reconfiguration API and kept. Revisit only if a deployment appears where a rebuild is
139
+ // measurably disruptive — for example a server-profile node holding thousands of blocks whose
140
+ // post-rebuild cohort-consult burst shows up in profiles.
76
141
  const declaredCohortSize = options.clusterPolicy?.assumedClusterSize;
142
+ const declaredRepairSize = options.clusterPolicy?.repairCorroborationClusterSize;
77
143
  const clusterSize = options.clusterSize ?? DEFAULT_CLUSTER_SIZE;
78
- const repairCorroborationClusterSize = declaredCohortSize ?? clusterSize;
144
+ const repairCorroborationClusterSize = resolveRepairCorroborationClusterSize(declaredRepairSize, declaredCohortSize, clusterSize);
79
145
  // ## What the advisory actually claims, and why the trigger is what it is
80
146
  //
81
147
  // The rule it states is measurable, not rhetorical: sweep `corroboratorCapacity` and `quorumSize`
@@ -126,13 +192,36 @@ export function resolveClusterPolicy(options) {
126
192
  // can honestly get. If `feat-admission-floor-from-observed-cohort-high-water-mark` ever lands
127
193
  // (deriving the yardstick from observation), that check becomes cheap and belongs here.
128
194
  const minimumSelfHealingDeployment = CORROBORATION_FLOOR + 1;
129
- const cohortUndeclared = declaredCohortSize === undefined && clusterSize > minAbsoluteClusterSize;
195
+ // BOTH operator fields must be absent for this arm: declaring only
196
+ // `repairCorroborationClusterSize` is still a declaration, and `undeclaredAdvice` below would
197
+ // otherwise tell a reader who has already declared the repair yardstick directly to go and declare
198
+ // it — the wrong advice, pointed at the wrong field.
199
+ //
200
+ // "Absent" is the SANITIZED notion, the same one the resolution above uses: a declaration the
201
+ // resolution discarded as degenerate (0, NaN, 2.5, …) must not count as a declaration here
202
+ // either. It is the case that most needs the advice — the operator believes they declared a size,
203
+ // the resolution silently used `clusterSize` instead, and without this the advisory's
204
+ // no-margin arm cannot fire either (the strict fallback has margin), so a typo'd declaration
205
+ // would be QUIETER than declaring nothing at all. The raw values still reach the log payload
206
+ // below, so a reader can see what was rejected.
207
+ const cohortUndeclared = asDeclaredSize(declaredCohortSize) === undefined
208
+ && asDeclaredSize(declaredRepairSize) === undefined
209
+ && clusterSize > minAbsoluteClusterSize;
130
210
  const noRepairMargin = repairCorroborationClusterSize <= minimumSelfHealingDeployment;
131
211
  if (cohortUndeclared || noRepairMargin) {
132
212
  // How many peers besides the reader must answer and agree, at the resolved size. Two once the
133
213
  // cohort is three or larger; one for a cohort declared at two, which is the only size whose
134
214
  // floor relaxes. Never below one — a claim nobody made is never accepted.
135
215
  const requiredAnsweringPeers = Math.max(1, Math.min(CORROBORATION_FLOOR, repairCorroborationClusterSize - 1));
216
+ // NOTE: a genuine solo node (`clusterSize: 1`, nothing declared) reads "0 cohort peer(s) and
217
+ // needs 1" and is told to run four machines — honest arithmetic, but advice aimed at a
218
+ // deployment that wanted a cohort. A solo node has nothing to repair FROM and nothing to
219
+ // repair against, so the line is noise rather than wrong. Left as is because one machine is a
220
+ // transitional shape (the ordinary next step is adding a backup) and the advisory is one line
221
+ // per construction. If solo becomes a shape deployments sit in, give this a solo-cohort arm
222
+ // that says so — do NOT reach for a floor on `repairCorroborationClusterSize` instead, which
223
+ // would fix the wording and break the commit-freshness window (see
224
+ // `resolveRepairCorroborationClusterSize`).
136
225
  const availablePeers = Math.max(0, repairCorroborationClusterSize - 1);
137
226
  const rule = `Block repair (read-repair and reconcile) converges only when ${CORROBORATION_FLOOR} cohort peers ` +
138
227
  `BESIDES the reader answer that reader and agree on the same (rev, actionId); that requirement drops ` +
@@ -164,13 +253,43 @@ export function resolveClusterPolicy(options) {
164
253
  `COPY IT — so founding data can stay stranded however many machines you later run. That case is ` +
165
254
  `reported once per affected block as cluster-fetch:repair-deadlock with reason=sole-holder, and its ` +
166
255
  `remedy is another cohort peer holding it (commit a new revision of the block), never more machines.`;
256
+ // Names the discarded value when the operator DID pass something the resolution rejected —
257
+ // otherwise "no size declared" reads as a contradiction of their own config, and they have no
258
+ // way to tell that the number they computed never took effect.
259
+ const discardedDeclaration = cohortUndeclared && (declaredCohortSize !== undefined || declaredRepairSize !== undefined)
260
+ ? ` (a declared value that is not a positive whole number is discarded and counts as no ` +
261
+ `declaration — this node discarded assumedClusterSize=${String(declaredCohortSize)}, ` +
262
+ `repairCorroborationClusterSize=${String(declaredRepairSize)})`
263
+ : '';
167
264
  const undeclaredAdvice = cohortUndeclared
168
- ? ` No clusterPolicy.assumedClusterSize declared, so the floor is measured against ` +
265
+ ? ` No clusterPolicy.assumedClusterSize declared, and no clusterPolicy.repairCorroborationClusterSize ` +
266
+ `either${discardedDeclaration}, so the floor is measured against ` +
169
267
  `repairCorroborationClusterSize=${repairCorroborationClusterSize} and never relaxes: if you actually ` +
170
- `run fewer than ${minimumSelfHealingDeployment} machines, every repair declines, permanently. Set ` +
171
- `clusterPolicy.assumedClusterSize to your real cohort size; it does not lower ` +
172
- `clusterSize=${clusterSize} (the replication factor). Larger deployments can ignore this.`
268
+ `run fewer than ${minimumSelfHealingDeployment} machines, every proof-less repair declines, ` +
269
+ `permanently. Either field declares your real cohort size and fixes this: ` +
270
+ `clusterPolicy.repairCorroborationClusterSize moves ONLY this repair yardstick, while ` +
271
+ `clusterPolicy.assumedClusterSize moves it AND the membership admission gate's write floor (which ` +
272
+ `refuses writes below ceil(0.75 x the declared size) while this node has no confident network-size ` +
273
+ `estimate) — so declare the repair field alone unless you mean to raise the write floor too. ` +
274
+ `Neither lowers clusterSize=${clusterSize} (the replication factor). Larger deployments can ignore ` +
275
+ `this.`
173
276
  : '';
277
+ // The rule and both advices above constrain proof-LESS claims only — without saying so the
278
+ // advisory overstates the emergency: an operator reading "every repair declines, permanently"
279
+ // would not guess that proof-carrying data is exempt, nor that the cohort-too-small decline is
280
+ // now quiet. It must not overshoot in the other direction either: `sole-holder` is equally
281
+ // permanent and deliberately stays loud, so name WHICH decline went quiet, and for which blocks.
282
+ const certifiedCaveat = ` Two softeners to all of the above. A claim carrying a VERIFIED cohort commit proof repairs at any ` +
283
+ `size with no second voter (the proof's signature set is its corroboration), so every permanent-` +
284
+ `decline warning here applies to PROOF-LESS data only — legacy blocks written before proofs ` +
285
+ `shipped, or a peer that lost its proof store. And the decline this advisory is about — ` +
286
+ `reason=cohort-too-small, a cohort that cannot reach the quorum at any answer rate — no longer ` +
287
+ `consults on every read: it arms the lazy read-repair window, so the steady-state cost is one ` +
288
+ `declined consult per readRepairWindowMs for each block this node HOLDS, with the permanence named ` +
289
+ `once per episode (cluster-fetch:repair-deadlock). Two shapes still consult on every read, by ` +
290
+ `design: reason=sole-holder, where the missing thing is a COPY a later commit or cohort-growth ` +
291
+ `push can deliver, so re-asking can genuinely learn; and a block this node does not hold at all, ` +
292
+ `whose read must attempt an acquisition and therefore bypasses the window.`;
174
293
  const noMarginAdvice = noRepairMargin
175
294
  ? ` This node resolved repairCorroborationClusterSize=${repairCorroborationClusterSize}, which leaves ` +
176
295
  `repair with NO fault tolerance: the reader has ${availablePeers} cohort peer(s) and needs ` +
@@ -182,11 +301,14 @@ export function resolveClusterPolicy(options) {
182
301
  repairCorroborationClusterSize,
183
302
  corroborationFloor: CORROBORATION_FLOOR,
184
303
  declaredCohortSize,
304
+ // Beside declaredCohortSize so a reader can tell WHICH field produced the resolved number
305
+ // (the repair field wins when both are declared).
306
+ declaredRepairSize,
185
307
  cohortUndeclared,
186
308
  noRepairMargin,
187
309
  requiredAnsweringPeers,
188
310
  minimumSelfHealingDeployment,
189
- message: rule + undeclaredAdvice + noMarginAdvice + holdersCaveat
311
+ message: rule + undeclaredAdvice + noMarginAdvice + certifiedCaveat + holdersCaveat
190
312
  });
191
313
  }
192
314
  return {
@@ -210,9 +332,10 @@ export function resolveClusterPolicy(options) {
210
332
  // permissive so a two- or three-node mesh transacts unconfigured; the cost of that default is
211
333
  // bounded to the gate, since the repair floor no longer reads this field.
212
334
  assumedClusterSize: declaredCohortSize ?? minAbsoluteClusterSize,
213
- // Repair corroboration floor, every repair. Defaults strict to the replication factor — so an
214
- // unconfigured node cannot have its floor talked down to a single voter by a shrunken cohort
215
- // view. A genuinely small mesh declares its size (either field) to regain self-repair.
335
+ // Repair corroboration floor, every repair. Declared by `repairCorroborationClusterSize`, else
336
+ // `assumedClusterSize`, else strict the replication factor so an unconfigured node cannot
337
+ // have its floor talked down to a single voter by a shrunken cohort view. A genuinely small
338
+ // mesh declares its size (any of the three) to regain self-repair.
216
339
  repairCorroborationClusterSize
217
340
  };
218
341
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cluster-policy.js","sourceRoot":"","sources":["../../../src/cluster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D,cAAc,4BAA4B;gBAC5F,GAAG,sBAAsB,oEAAoE;gBAC7F,GAAG,4BAA4B,GAAG,CAAC,uDAAuD;YAC1F,CAAC,CAAC,EAAE,CAAC;QACN,GAAG,CAAC,wBAAwB,EAAE;YAC7B,WAAW;YACX,8BAA8B;YAC9B,kBAAkB,EAAE,mBAAmB;YACvC,kBAAkB;YAClB,0FAA0F;YAC1F,kDAAkD;YAClD,kBAAkB;YAClB,gBAAgB;YAChB,cAAc;YACd,sBAAsB;YACtB,4BAA4B;YAC5B,OAAO,EAAE,IAAI,GAAG,gBAAgB,GAAG,cAAc,GAAG,eAAe,GAAG,aAAa;SACnF,CAAC,CAAC;IACJ,CAAC;IAED,OAAO;QACN,sBAAsB,EAAE,OAAO,CAAC,aAAa,EAAE,sBAAsB,IAAI,gCAAgC;QACzG,uBAAuB,EAAE,IAAI;QAC7B,sBAAsB;QACtB,oBAAoB,EAAE,OAAO,CAAC,aAAa,EAAE,aAAa,IAAI,IAAI;QAClE,oBAAoB,EAAE,OAAO,CAAC,aAAa,EAAE,aAAa,IAAI,GAAG;QACjE,2FAA2F;QAC3F,oFAAoF;QACpF,4BAA4B,EAAE,OAAO,CAAC,aAAa,EAAE,4BAA4B,IAAI,KAAK;QAC1F,yFAAyF;QACzF,yCAAyC;QACzC,uBAAuB,EAAE,OAAO,CAAC,aAAa,EAAE,uBAAuB;QACvE,wBAAwB,EAAE,KAAK;QAC/B,8FAA8F;QAC9F,gGAAgG;QAChG,qFAAqF;QACrF,WAAW;QACX,+FAA+F;QAC/F,8FAA8F;QAC9F,0EAA0E;QAC1E,kBAAkB,EAAE,kBAAkB,IAAI,sBAAsB;QAChE,+FAA+F;QAC/F,8FAA8F;QAC9F,4FAA4F;QAC5F,mEAAmE;QACnE,8BAA8B;KAC9B,CAAC;AACH,CAAC"}
@@ -104,8 +104,10 @@ export declare function quorumSize(responderCount: number, simpleMajorityThresho
104
104
  *
105
105
  * An unconfigured node resolves this to its `clusterSize` (default 10), so the floor of two binds and
106
106
  * a shrunken view gains nothing. The escape hatch for a real two-node deployment is one explicit
107
- * operator declaration `clusterPolicy.assumedClusterSize: 2`, which does NOT also drop the
108
- * replication factor, or an honest `clusterSize: 2`.
107
+ * operator declaration, any of three: `clusterPolicy.repairCorroborationClusterSize: 2`, which moves
108
+ * only this yardstick; `clusterPolicy.assumedClusterSize: 2`, which also raises the membership
109
+ * admission gate's low-confidence write floor; or an honest `clusterSize: 2`. Only the last drops the
110
+ * replication factor.
109
111
  *
110
112
  * Shared by both restoration paths so the two can never drift apart on the rule that decides how
111
113
  * much trust a lone peer gets.
@@ -1 +1 @@
1
- {"version":3,"file":"quorum-restore.d.ts","sourceRoot":"","sources":["../../../src/cluster/quorum-restore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,iEAAiE;AACjE,MAAM,WAAW,QAAQ;IACxB,wFAAwF;IACxF,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;;OAQG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,wFAAwF;AACxF,MAAM,WAAW,SAAS;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,yFAAyF;IACzF,SAAS,CAAC,EAAE,IAAI,CAAC;CACjB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC;;;;;;;;;;;;;GAaG;AACH,wB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9B,MAAM,EAAE,QAAQ,EAAE,EAClB,uBAAuB,EAAE,MAAM,EAC/B,oBAAoB,CAAC,EAAE,MAAM,GAC3B,SAAS,GAAG,SAAS,CA8DvB;AAiDD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,SAAS,CAM1G;AAED;wDACwD;AACxD,MAAM,WAAW,kBAAkB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,iBAAiB,CAChC,UAAU,EAAE,kBAAkB,EAAE,EAChC,uBAAuB,EAAE,MAAM,EAC/B,oBAAoB,CAAC,EAAE,MAAM,GAC3B;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAmD7C;AAmBD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,kBAAkB,EAAE,GAAG;IAAE,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,SAAS,CAK/G"}
@@ -37,8 +37,10 @@ export function quorumSize(responderCount, simpleMajorityThreshold, corroborator
37
37
  *
38
38
  * An unconfigured node resolves this to its `clusterSize` (default 10), so the floor of two binds and
39
39
  * a shrunken view gains nothing. The escape hatch for a real two-node deployment is one explicit
40
- * operator declaration `clusterPolicy.assumedClusterSize: 2`, which does NOT also drop the
41
- * replication factor, or an honest `clusterSize: 2`.
40
+ * operator declaration, any of three: `clusterPolicy.repairCorroborationClusterSize: 2`, which moves
41
+ * only this yardstick; `clusterPolicy.assumedClusterSize: 2`, which also raises the membership
42
+ * admission gate's low-confidence write floor; or an honest `clusterSize: 2`. Only the last drops the
43
+ * replication factor.
42
44
  *
43
45
  * Shared by both restoration paths so the two can never drift apart on the rule that decides how
44
46
  * much trust a lone peer gets.