@optimystic/db-core 1.0.0-beta.2 → 1.0.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/dist/src/cluster/structs.d.ts +62 -16
- package/dist/src/cluster/structs.d.ts.map +1 -1
- package/dist/src/cluster/structs.js +5 -3
- package/dist/src/cluster/structs.js.map +1 -1
- package/dist/src/cohort-topic/antidos/bootstrap-evidence-envelope.d.ts +2 -1
- package/dist/src/cohort-topic/antidos/bootstrap-evidence-envelope.d.ts.map +1 -1
- package/dist/src/cohort-topic/antidos/bootstrap-evidence-envelope.js +10 -3
- package/dist/src/cohort-topic/antidos/bootstrap-evidence-envelope.js.map +1 -1
- package/dist/src/cohort-topic/wire/codec.d.ts.map +1 -1
- package/dist/src/cohort-topic/wire/codec.js +8 -2
- package/dist/src/cohort-topic/wire/codec.js.map +1 -1
- package/dist/src/collection/collection.d.ts +467 -35
- package/dist/src/collection/collection.d.ts.map +1 -1
- package/dist/src/collection/collection.js +879 -149
- package/dist/src/collection/collection.js.map +1 -1
- package/dist/src/collection/struct.d.ts +109 -4
- package/dist/src/collection/struct.d.ts.map +1 -1
- package/dist/src/collection/struct.js +88 -1
- package/dist/src/collection/struct.js.map +1 -1
- package/dist/src/collections/diary/diary.d.ts +6 -2
- package/dist/src/collections/diary/diary.d.ts.map +1 -1
- package/dist/src/collections/diary/diary.js +5 -2
- package/dist/src/collections/diary/diary.js.map +1 -1
- package/dist/src/collections/tree/struct.d.ts +192 -5
- package/dist/src/collections/tree/struct.d.ts.map +1 -1
- package/dist/src/collections/tree/struct.js +134 -0
- package/dist/src/collections/tree/struct.js.map +1 -1
- package/dist/src/collections/tree/tree.d.ts +13 -3
- package/dist/src/collections/tree/tree.d.ts.map +1 -1
- package/dist/src/collections/tree/tree.js +109 -6
- package/dist/src/collections/tree/tree.js.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/logger-registry.d.ts +57 -0
- package/dist/src/logger-registry.d.ts.map +1 -0
- package/dist/src/logger-registry.js +168 -0
- package/dist/src/logger-registry.js.map +1 -0
- package/dist/src/logger.d.ts.map +1 -1
- package/dist/src/logger.js +3 -0
- package/dist/src/logger.js.map +1 -1
- package/dist/src/matchmaking/wire.d.ts.map +1 -1
- package/dist/src/matchmaking/wire.js +8 -2
- package/dist/src/matchmaking/wire.js.map +1 -1
- package/dist/src/network/durability.d.ts +45 -0
- package/dist/src/network/durability.d.ts.map +1 -0
- package/dist/src/network/durability.js +114 -0
- package/dist/src/network/durability.js.map +1 -0
- package/dist/src/network/i-key-network.d.ts +14 -6
- package/dist/src/network/i-key-network.d.ts.map +1 -1
- package/dist/src/network/index.d.ts +3 -0
- package/dist/src/network/index.d.ts.map +1 -1
- package/dist/src/network/index.js +3 -0
- package/dist/src/network/index.js.map +1 -1
- package/dist/src/network/lineage.d.ts +39 -0
- package/dist/src/network/lineage.d.ts.map +1 -0
- package/dist/src/network/lineage.js +61 -0
- package/dist/src/network/lineage.js.map +1 -0
- package/dist/src/network/routing-key.d.ts +24 -0
- package/dist/src/network/routing-key.d.ts.map +1 -0
- package/dist/src/network/routing-key.js +9 -0
- package/dist/src/network/routing-key.js.map +1 -0
- package/dist/src/network/stale-failure.d.ts +5 -1
- package/dist/src/network/stale-failure.d.ts.map +1 -1
- package/dist/src/network/stale-failure.js +5 -1
- package/dist/src/network/stale-failure.js.map +1 -1
- package/dist/src/network/struct.d.ts +151 -8
- package/dist/src/network/struct.d.ts.map +1 -1
- package/dist/src/network/struct.js.map +1 -1
- package/dist/src/reactivity/wire.d.ts.map +1 -1
- package/dist/src/reactivity/wire.js +8 -2
- package/dist/src/reactivity/wire.js.map +1 -1
- package/dist/src/testing/test-transactor.d.ts +64 -7
- package/dist/src/testing/test-transactor.d.ts.map +1 -1
- package/dist/src/testing/test-transactor.js +150 -23
- package/dist/src/testing/test-transactor.js.map +1 -1
- package/dist/src/transaction/coordinator.d.ts +141 -21
- package/dist/src/transaction/coordinator.d.ts.map +1 -1
- package/dist/src/transaction/coordinator.js +408 -122
- package/dist/src/transaction/coordinator.js.map +1 -1
- package/dist/src/transaction/errors.d.ts +39 -10
- package/dist/src/transaction/errors.d.ts.map +1 -1
- package/dist/src/transaction/errors.js +34 -9
- package/dist/src/transaction/errors.js.map +1 -1
- package/dist/src/transaction/index.d.ts +1 -0
- package/dist/src/transaction/index.d.ts.map +1 -1
- package/dist/src/transaction/index.js.map +1 -1
- package/dist/src/transactor/block-floors.d.ts +78 -0
- package/dist/src/transactor/block-floors.d.ts.map +1 -0
- package/dist/src/transactor/block-floors.js +62 -0
- package/dist/src/transactor/block-floors.js.map +1 -0
- package/dist/src/transactor/change-notifier.d.ts +43 -0
- package/dist/src/transactor/change-notifier.d.ts.map +1 -1
- package/dist/src/transactor/change-notifier.js +3 -0
- package/dist/src/transactor/change-notifier.js.map +1 -1
- package/dist/src/transactor/index.d.ts +1 -0
- package/dist/src/transactor/index.d.ts.map +1 -1
- package/dist/src/transactor/index.js +1 -0
- package/dist/src/transactor/index.js.map +1 -1
- package/dist/src/transactor/network-transactor.d.ts +43 -6
- package/dist/src/transactor/network-transactor.d.ts.map +1 -1
- package/dist/src/transactor/network-transactor.js +279 -81
- package/dist/src/transactor/network-transactor.js.map +1 -1
- package/dist/src/transactor/transactor-source.d.ts +94 -4
- package/dist/src/transactor/transactor-source.d.ts.map +1 -1
- package/dist/src/transactor/transactor-source.js +120 -42
- package/dist/src/transactor/transactor-source.js.map +1 -1
- package/dist/src/transactor/transactor.d.ts +14 -1
- package/dist/src/transactor/transactor.d.ts.map +1 -1
- package/dist/src/transform/atomic.d.ts.map +1 -1
- package/dist/src/transform/atomic.js +12 -9
- package/dist/src/transform/atomic.js.map +1 -1
- package/dist/src/transform/base-pins.d.ts +50 -17
- package/dist/src/transform/base-pins.d.ts.map +1 -1
- package/dist/src/transform/base-pins.js +58 -11
- package/dist/src/transform/base-pins.js.map +1 -1
- package/dist/src/transform/cache-source.d.ts +75 -11
- package/dist/src/transform/cache-source.d.ts.map +1 -1
- package/dist/src/transform/cache-source.js +162 -36
- package/dist/src/transform/cache-source.js.map +1 -1
- package/dist/src/transform/digest.d.ts +8 -1
- package/dist/src/transform/digest.d.ts.map +1 -1
- package/dist/src/transform/digest.js +19 -9
- package/dist/src/transform/digest.js.map +1 -1
- package/dist/src/transform/helpers.d.ts +6 -2
- package/dist/src/transform/helpers.d.ts.map +1 -1
- package/dist/src/transform/helpers.js +8 -3
- package/dist/src/transform/helpers.js.map +1 -1
- package/dist/src/transform/tracker.d.ts +94 -14
- package/dist/src/transform/tracker.d.ts.map +1 -1
- package/dist/src/transform/tracker.js +222 -68
- package/dist/src/transform/tracker.js.map +1 -1
- package/dist/src/utility/structural-equals.d.ts +38 -0
- package/dist/src/utility/structural-equals.d.ts.map +1 -0
- package/dist/src/utility/structural-equals.js +77 -0
- package/dist/src/utility/structural-equals.js.map +1 -0
- package/package.json +2 -2
- package/src/cluster/structs.ts +298 -255
- package/src/cohort-topic/antidos/bootstrap-evidence-envelope.ts +260 -253
- package/src/cohort-topic/wire/codec.ts +222 -216
- package/src/collection/collection.ts +996 -158
- package/src/collection/struct.ts +99 -4
- package/src/collections/diary/diary.ts +71 -68
- package/src/collections/tree/struct.ts +248 -26
- package/src/collections/tree/tree.ts +130 -9
- package/src/index.ts +2 -1
- package/src/logger-registry.ts +224 -0
- package/src/logger.ts +4 -0
- package/src/matchmaking/wire.ts +8 -2
- package/src/network/durability.ts +123 -0
- package/src/network/i-key-network.ts +60 -52
- package/src/network/index.ts +10 -7
- package/src/network/lineage.ts +80 -0
- package/src/network/routing-key.ts +27 -0
- package/src/network/stale-failure.ts +5 -1
- package/src/network/struct.ts +156 -8
- package/src/reactivity/wire.ts +230 -224
- package/src/testing/test-transactor.ts +152 -24
- package/src/transaction/coordinator.ts +470 -131
- package/src/transaction/errors.ts +34 -9
- package/src/transaction/index.ts +1 -0
- package/src/transactor/block-floors.ts +105 -0
- package/src/transactor/change-notifier.ts +129 -80
- package/src/transactor/index.ts +1 -0
- package/src/transactor/network-transactor.ts +297 -84
- package/src/transactor/transactor-source.ts +131 -42
- package/src/transactor/transactor.ts +13 -1
- package/src/transform/atomic.ts +25 -22
- package/src/transform/base-pins.ts +76 -18
- package/src/transform/cache-source.ts +327 -194
- package/src/transform/digest.ts +21 -10
- package/src/transform/helpers.ts +8 -3
- package/src/transform/tracker.ts +423 -270
- package/src/utility/structural-equals.ts +72 -0
- package/dist/src/utility/block-id-to-bytes.d.ts +0 -3
- package/dist/src/utility/block-id-to-bytes.d.ts.map +0 -1
- package/dist/src/utility/block-id-to-bytes.js +0 -7
- package/dist/src/utility/block-id-to-bytes.js.map +0 -1
- package/src/utility/block-id-to-bytes.ts +0 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RepoMessage } from "../network/repo-protocol.js";
|
|
2
|
-
import type { PendResult } from "../network/struct.js";
|
|
2
|
+
import type { CommitResult, PendResult } from "../network/struct.js";
|
|
3
3
|
/**
|
|
4
4
|
* One member's vote on a cluster transaction, in either the promise or the commit map.
|
|
5
5
|
*
|
|
@@ -26,12 +26,36 @@ export type Signature = {
|
|
|
26
26
|
type: 'conflict';
|
|
27
27
|
signature: string;
|
|
28
28
|
conflictWith: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* This member refuses the transaction *for now* for the OTHER transient reason: the pend's blocks
|
|
32
|
+
* are reserved by a different unresolved action in this member's durable storage. Retryable and
|
|
33
|
+
* never counted toward the permanent-rejection threshold, exactly like `conflict`.
|
|
34
|
+
*
|
|
35
|
+
* Distinct from `conflict` because the two know different things, from different places:
|
|
36
|
+
* - `conflict` comes from the member's in-memory reservation table, where it holds the rival's
|
|
37
|
+
* whole {@link ClusterRecord} and can name its `messageHash`.
|
|
38
|
+
* - `held` comes from storage's pending list, which carries only an **action id** — and it fires
|
|
39
|
+
* precisely in the window where the rival has left the in-memory table (cleared at its
|
|
40
|
+
* pend-consensus) but not yet storage (cleared at its commit or cancel), so no `messageHash`
|
|
41
|
+
* exists to name.
|
|
42
|
+
*
|
|
43
|
+
* `heldBy` is therefore an action id, a different id space from `conflictWith`. Packing one into
|
|
44
|
+
* the other would put two id spaces in a single unlabelled signed field, which is why this is its
|
|
45
|
+
* own variant rather than a reused one. Where several rivals hold the blocks, `heldBy` names the
|
|
46
|
+
* one the refusal returned on.
|
|
47
|
+
*/
|
|
48
|
+
| {
|
|
49
|
+
type: 'held';
|
|
50
|
+
signature: string;
|
|
51
|
+
heldBy: string;
|
|
29
52
|
};
|
|
30
53
|
/**
|
|
31
54
|
* The exact bytes a vote signature covers: `<hash>:<type>[:<extra>]`, where `extra` is the variant's
|
|
32
|
-
* own payload — a reject's `rejectReason`, a conflict's `conflictWith`,
|
|
33
|
-
* Folding the extra in is what makes it integrity-protected in transit rather than
|
|
34
|
-
* prose.
|
|
55
|
+
* own payload — a reject's `rejectReason`, a conflict's `conflictWith`, a held's `heldBy`, nothing
|
|
56
|
+
* for an approve. Folding the extra in is what makes it integrity-protected in transit rather than
|
|
57
|
+
* free-floating prose. Each variant's extra is a single string, so the preimage needs no encoding
|
|
58
|
+
* scheme; a variant that ever needs two fields must define one rather than concatenating here.
|
|
35
59
|
*
|
|
36
60
|
* Producers and verifiers must both build the preimage here. It lives beside {@link Signature}
|
|
37
61
|
* rather than in either consumer because a second copy that forgets a variant does not fail loudly:
|
|
@@ -52,13 +76,29 @@ export type ClusterPeers = {
|
|
|
52
76
|
};
|
|
53
77
|
/**
|
|
54
78
|
* One member's own report of what its storage did with this transaction at consensus-apply time; see
|
|
55
|
-
* {@link ClusterRecord.applyOutcomes} for the trust rules.
|
|
56
|
-
*
|
|
57
|
-
*
|
|
79
|
+
* {@link ClusterRecord.applyOutcomes} for the trust rules. The two arms report differently, and
|
|
80
|
+
* deliberately so:
|
|
81
|
+
*
|
|
82
|
+
* - `pend` is set ONLY for a conflict-shaped refusal. The coordinator's rule for it is "an entry
|
|
83
|
+
* means retry", so a success must not exist there.
|
|
84
|
+
* - `commit` is ALWAYS set once a commit applied — successes included — because the coordinator
|
|
85
|
+
* counts durable holders (`CoordinatorRepo.commit`'s durability gate), and a count needs the
|
|
86
|
+
* positives. Consensus votes say the cohort agreed to apply the commit; this arm says whether
|
|
87
|
+
* this member's storage actually holds the committed revision under the record's action
|
|
88
|
+
* afterwards, measured AFTER the member's own reconcile (a member that pulled the revision from a
|
|
89
|
+
* cohort peer reports success). A commit that reached consensus is authoritative for ordering,
|
|
90
|
+
* but it was never evidence of storage — which is what this arm supplies.
|
|
58
91
|
*/
|
|
59
92
|
export type MemberApplyOutcome = {
|
|
60
93
|
/** This member's storage refused the record's pend with a conflict-shaped result. */
|
|
61
94
|
pend?: PendResult;
|
|
95
|
+
/**
|
|
96
|
+
* Whether this member's storage durably holds the record's committed revision, for every block
|
|
97
|
+
* the commit named, after applying and (if needed) reconciling. `success: true` is a durable
|
|
98
|
+
* holder; a failure carries storage's refusal (or a refusal built from the missing-pend throw)
|
|
99
|
+
* for the operator's benefit — the coordinator reads only `success`.
|
|
100
|
+
*/
|
|
101
|
+
commit?: CommitResult;
|
|
62
102
|
};
|
|
63
103
|
export type ClusterRecord = {
|
|
64
104
|
messageHash: string;
|
|
@@ -101,17 +141,23 @@ export type ClusterRecord = {
|
|
|
101
141
|
* written by a member *after* the votes are cast, on the response it hands back, so no signed
|
|
102
142
|
* payload could carry it without a further round trip.
|
|
103
143
|
*
|
|
104
|
-
* Members set only their own entry
|
|
105
|
-
* `pending` or `missing`, per `isConflictFailure`) — the
|
|
106
|
-
* rival holds the blocks or already took the revision.
|
|
107
|
-
* omitted: a bare fault stays tolerated local
|
|
108
|
-
* local-verdict arm.
|
|
144
|
+
* Members set only their own entry. The pend arm is set only for a *conflict-shaped* pend
|
|
145
|
+
* refusal (one carrying `pending` or `missing`, per `isConflictFailure`) — the
|
|
146
|
+
* optimistic-concurrency verdict that a rival holds the blocks or already took the revision.
|
|
147
|
+
* Pend successes and bare-reason faults are omitted: a bare fault stays tolerated local
|
|
148
|
+
* divergence, mirroring the coordinator's own local-verdict arm. The commit arm is set for every
|
|
149
|
+
* applied commit, success or not, because the coordinator counts the successes
|
|
150
|
+
* ({@link MemberApplyOutcome}).
|
|
109
151
|
*
|
|
110
|
-
* Why unsigned is acceptable: a hostile entry can only *downgrade* a reported pend success
|
|
111
|
-
* retryable conflict, which the writer answers by rebasing and trying again.
|
|
152
|
+
* Why unsigned is acceptable: a hostile pend entry can only *downgrade* a reported pend success
|
|
153
|
+
* into a retryable conflict, which the writer answers by rebasing and trying again. A hostile
|
|
154
|
+
* commit entry is no worse: a false *success* counts one durable holder the member already
|
|
155
|
+
* counted for with its signed approve vote (the vote is what admits it to the majority the count
|
|
156
|
+
* is measured against), and a false *refusal* is again only retry pressure. The same member
|
|
112
157
|
* could already force strictly worse outcomes with a signed reject or conflict vote, so this adds
|
|
113
158
|
* no attack surface beyond retry pressure — and failing toward retry is the correct direction for
|
|
114
|
-
* optimistic concurrency. Never treat an entry here as evidence of anything but "retry"
|
|
159
|
+
* optimistic concurrency. Never treat an entry here as evidence of anything but "retry" (pend) or
|
|
160
|
+
* "one more holder in a count that a signed vote already bounded" (commit).
|
|
115
161
|
*
|
|
116
162
|
* Old peers never set it and old coordinators ignore it, so it is wire-compatible in both
|
|
117
163
|
* directions.
|
|
@@ -220,7 +266,7 @@ export interface ClusterConsensusConfig {
|
|
|
220
266
|
* single reset here would otherwise drop the peer and sink super-majority.
|
|
221
267
|
*/
|
|
222
268
|
promiseImmediateRetries?: number;
|
|
223
|
-
/** Read-repair behavior: 'off' (only fetch on missing — legacy), 'lazy' (fetch when local age > window), 'paranoid' (always verify against cluster on read). Default 'lazy'. */
|
|
269
|
+
/** Read-repair behavior: 'off' (only fetch on missing — legacy), 'lazy' (fetch when local age > window), 'paranoid' (always verify against cluster on read). Default 'lazy'. In every mode a block missing locally consults its cohort on every read. */
|
|
224
270
|
readRepairMode?: 'off' | 'lazy' | 'paranoid';
|
|
225
271
|
/** For 'lazy' mode: read-repair triggers when (now - localEntry.lastSeenCommitMs) > this. Default 10000. */
|
|
226
272
|
readRepairWindowMs?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structs.d.ts","sourceRoot":"","sources":["../../../src/cluster/structs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"structs.d.ts","sourceRoot":"","sources":["../../../src/cluster/structs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GAClB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE;AAC9D;;;;;GAKG;GACD;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE;AAC/D;;;;;;;;;;;;;;;;;GAiBG;GACD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,CAE3G;AAED,8GAA8G;AAC9G,wBAAgB,8BAA8B,CAA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jC,yPAAyP;IACzP,cAAc,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,UAAU,CAAC;IAC7C,4GAA4G;IAC5G,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gIAAgI;IAChI,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;OAKG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC;;;OAGG;IACH,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;CAClD;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,QAAQ,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The exact bytes a vote signature covers: `<hash>:<type>[:<extra>]`, where `extra` is the variant's
|
|
3
|
-
* own payload — a reject's `rejectReason`, a conflict's `conflictWith`,
|
|
4
|
-
* Folding the extra in is what makes it integrity-protected in transit rather than
|
|
5
|
-
* prose.
|
|
3
|
+
* own payload — a reject's `rejectReason`, a conflict's `conflictWith`, a held's `heldBy`, nothing
|
|
4
|
+
* for an approve. Folding the extra in is what makes it integrity-protected in transit rather than
|
|
5
|
+
* free-floating prose. Each variant's extra is a single string, so the preimage needs no encoding
|
|
6
|
+
* scheme; a variant that ever needs two fields must define one rather than concatenating here.
|
|
6
7
|
*
|
|
7
8
|
* Producers and verifiers must both build the preimage here. It lives beside {@link Signature}
|
|
8
9
|
* rather than in either consumer because a second copy that forgets a variant does not fail loudly:
|
|
@@ -19,6 +20,7 @@ export function clusterVoteVerificationPayload(hash, signature) {
|
|
|
19
20
|
switch (signature.type) {
|
|
20
21
|
case 'reject': return clusterVoteSigningPayload(hash, 'reject', signature.rejectReason);
|
|
21
22
|
case 'conflict': return clusterVoteSigningPayload(hash, 'conflict', signature.conflictWith);
|
|
23
|
+
case 'held': return clusterVoteSigningPayload(hash, 'held', signature.heldBy);
|
|
22
24
|
default: return clusterVoteSigningPayload(hash, signature.type);
|
|
23
25
|
}
|
|
24
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../src/cluster/structs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../src/cluster/structs.ts"],"names":[],"mappings":"AAyCA;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,yBAAyB,CAAC,IAAY,EAAE,IAAuB,EAAE,KAAc;IAC9F,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACjF,CAAC;AAED,8GAA8G;AAC9G,MAAM,UAAU,8BAA8B,CAAC,IAAY,EAAE,SAAoB;IAChF,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;QACxB,KAAK,QAAQ,CAAC,CAAC,OAAO,yBAAyB,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;QACxF,KAAK,UAAU,CAAC,CAAC,OAAO,yBAAyB,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;QAC5F,KAAK,MAAM,CAAC,CAAC,OAAO,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;QAC9E,OAAO,CAAC,CAAC,OAAO,yBAAyB,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;IACjE,CAAC;AACF,CAAC;AAiHD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,IAAI,CAAC"}
|
|
@@ -98,7 +98,8 @@ export declare function serializeBootstrapEvidenceEnvelope(env: BootstrapEvidenc
|
|
|
98
98
|
/**
|
|
99
99
|
* Decode {@link RegisterV1.bootstrapEvidence} (base64url → JSON), structurally validate it, and return
|
|
100
100
|
* the {@link BootstrapEvidenceEnvelopeV1}. **Total**: returns `undefined` on an absent/empty field, a
|
|
101
|
-
* non-base64url or non-JSON body, a wrong/future `v`, or a structurally-invalid kind — never throws
|
|
101
|
+
* non-base64url or non-JSON body, a wrong/future `v`, or a structurally-invalid kind — never throws on its input
|
|
102
|
+
* (a host missing its `TextDecoder` polyfill does throw — a misconfiguration, not bad evidence). A
|
|
102
103
|
* verifier treats `undefined` as "this kind not offered" and fails its check (fails closed).
|
|
103
104
|
*/
|
|
104
105
|
export declare function parseBootstrapEvidenceEnvelope(reg: Pick<RegisterV1, "bootstrapEvidence">): BootstrapEvidenceEnvelopeV1 | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-evidence-envelope.d.ts","sourceRoot":"","sources":["../../../../src/cohort-topic/antidos/bootstrap-evidence-envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"bootstrap-evidence-envelope.d.ts","sourceRoot":"","sources":["../../../../src/cohort-topic/antidos/bootstrap-evidence-envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAQnD,gGAAgG;AAChG,MAAM,WAAW,aAAa;IAC7B,6FAA6F;IAC7F,KAAK,EAAE,MAAM,CAAC;CACd;AAED,8GAA8G;AAC9G,MAAM,WAAW,mBAAmB;IACnC,gDAAgD;IAChD,aAAa,EAAE,MAAM,CAAC;IACtB,oIAAoI;IACpI,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,GAAG,EAAE,MAAM,CAAC;CACZ;AAED,mGAAmG;AACnG,MAAM,WAAW,2BAA2B;IAC3C,CAAC,EAAE,CAAC,CAAC;IACL,2DAA2D;IAC3D,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB,wEAAwE;IACxE,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAChC,kEAAkE;IAClE,UAAU,CAAC,EAAE,oBAAoB,CAAC;CAClC;AAED;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,MAAM,GAAG,kBAAkB,GAAG,WAAW,CAAC,CAAC;AAE3G,sGAAsG;AACtG,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,oBAAoB,GAAG,UAAU,CAQzE;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,GAAG,UAAU,CASlG;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,oBAAoB,EAAE,KAAK,EAAE,UAAU,GAAG,UAAU,CAMpF;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CA0BvE;AAED,0GAA0G;AAC1G,wBAAgB,kCAAkC,CAAC,GAAG,EAAE,2BAA2B,GAAG,MAAM,CAc3F;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,IAAI,CAAC,UAAU,EAAE,mBAAmB,CAAC,GAAG,2BAA2B,GAAG,SAAS,CAelI"}
|
|
@@ -18,7 +18,10 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { b64urlToBytes, bytesToB64url } from "../wire/codec.js";
|
|
20
20
|
const utf8 = new TextEncoder();
|
|
21
|
-
|
|
21
|
+
// Built on first use, not at module load: Hermes (React Native) has no native `TextDecoder`, so a
|
|
22
|
+
// module-scope construction fails the import itself whenever it runs ahead of the host's polyfill.
|
|
23
|
+
let utf8DecoderInstance;
|
|
24
|
+
const utf8Decoder = () => utf8DecoderInstance ??= new TextDecoder("utf-8", { fatal: true });
|
|
22
25
|
/** Default PoW difficulty: leading zero bits required. ~2^bits hashes to mint, one hash to verify. */
|
|
23
26
|
export const DEFAULT_POW_DIFFICULTY_BITS = 20;
|
|
24
27
|
/**
|
|
@@ -125,7 +128,8 @@ export function serializeBootstrapEvidenceEnvelope(env) {
|
|
|
125
128
|
/**
|
|
126
129
|
* Decode {@link RegisterV1.bootstrapEvidence} (base64url → JSON), structurally validate it, and return
|
|
127
130
|
* the {@link BootstrapEvidenceEnvelopeV1}. **Total**: returns `undefined` on an absent/empty field, a
|
|
128
|
-
* non-base64url or non-JSON body, a wrong/future `v`, or a structurally-invalid kind — never throws
|
|
131
|
+
* non-base64url or non-JSON body, a wrong/future `v`, or a structurally-invalid kind — never throws on its input
|
|
132
|
+
* (a host missing its `TextDecoder` polyfill does throw — a misconfiguration, not bad evidence). A
|
|
129
133
|
* verifier treats `undefined` as "this kind not offered" and fails its check (fails closed).
|
|
130
134
|
*/
|
|
131
135
|
export function parseBootstrapEvidenceEnvelope(reg) {
|
|
@@ -133,9 +137,12 @@ export function parseBootstrapEvidenceEnvelope(reg) {
|
|
|
133
137
|
if (raw === undefined || raw === "") {
|
|
134
138
|
return undefined; // not offered
|
|
135
139
|
}
|
|
140
|
+
// Fetched outside the try: a missing `TextDecoder` polyfill is a host misconfiguration and must
|
|
141
|
+
// throw as one, not quietly read every offered envelope as "not offered".
|
|
142
|
+
const decoder = utf8Decoder();
|
|
136
143
|
let parsed;
|
|
137
144
|
try {
|
|
138
|
-
parsed = JSON.parse(
|
|
145
|
+
parsed = JSON.parse(decoder.decode(b64urlToBytes(raw)));
|
|
139
146
|
}
|
|
140
147
|
catch {
|
|
141
148
|
return undefined; // not base64url / not UTF-8 / not JSON → fail closed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-evidence-envelope.js","sourceRoot":"","sources":["../../../../src/cohort-topic/antidos/bootstrap-evidence-envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGhE,MAAM,IAAI,GAAG,IAAI,WAAW,EAAE,CAAC;AAC/B,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"bootstrap-evidence-envelope.js","sourceRoot":"","sources":["../../../../src/cohort-topic/antidos/bootstrap-evidence-envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGhE,MAAM,IAAI,GAAG,IAAI,WAAW,EAAE,CAAC;AAC/B,kGAAkG;AAClG,mGAAmG;AACnG,IAAI,mBAA4C,CAAC;AACjD,MAAM,WAAW,GAAG,GAAgB,EAAE,CAAC,mBAAmB,KAAK,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AA8CzG,sGAAsG;AACtG,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAE9C;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAyB;IAC5D,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;QACjC,qBAAqB;QACrB,GAAG,CAAC,OAAO;QACX,GAAG,CAAC,IAAI;QACR,GAAG,CAAC,gBAAgB;QACpB,GAAG,CAAC,SAAS;KACb,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAyB,EAAE,aAAqB;IACrF,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAA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,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,uCAAuC;IAC9D,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../../src/cohort-topic/wire/codec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAiBH,OAAO,KAAK,EACX,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,OAAO,EACP,aAAa,EACb,WAAW,EACX,MAAM,YAAY,CAAC;AAEpB;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,QAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../../src/cohort-topic/wire/codec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAiBH,OAAO,KAAK,EACX,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,OAAO,EACP,aAAa,EACb,WAAW,EACX,MAAM,YAAY,CAAC;AAEpB;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,QAAc,CAAC;AAsBrD,iDAAiD;AACjD,wBAAgB,aAAa,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,CAgBnD;AAED,oGAAoG;AACpG,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,UAAU,CAkCnD;AAID,iEAAiE;AACjE,wBAAgB,mBAAmB,CAAC,CAAC,SAAS;IAAE,CAAC,EAAE,CAAC,CAAA;CAAE,EAAE,GAAG,EAAE,CAAC,EAAE,eAAe,GAAE,MAAkC,GAAG,UAAU,CAU/H;AAED,8GAA8G;AAC9G,wBAA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AAM,GAAG,WAAW,CAE1F"}
|
|
@@ -22,7 +22,10 @@ import { validateChildLinkReplyV1, validateChildLinkV1, validateCohortGossipV1,
|
|
|
22
22
|
export const DEFAULT_MAX_MESSAGE_BYTES = 1024 * 1024;
|
|
23
23
|
const LENGTH_PREFIX_BYTES = 4;
|
|
24
24
|
const utf8Encoder = new TextEncoder();
|
|
25
|
-
|
|
25
|
+
// Built on first use, not at module load: Hermes (React Native) has no native `TextDecoder`, so a
|
|
26
|
+
// module-scope construction fails the import itself whenever it runs ahead of the host's polyfill.
|
|
27
|
+
let utf8DecoderInstance;
|
|
28
|
+
const utf8Decoder = () => utf8DecoderInstance ??= new TextDecoder("utf-8", { fatal: true });
|
|
26
29
|
// --- base64url helpers (no padding, cross-platform) ---
|
|
27
30
|
const B64URL_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
28
31
|
const B64URL_LOOKUP = (() => {
|
|
@@ -115,9 +118,12 @@ export function decodeCohortMessage(bytes, maxMessageBytes = DEFAULT_MAX_MESSAGE
|
|
|
115
118
|
throw new CohortWireError(`frame length mismatch: declared ${declared}, have ${bytes.length - LENGTH_PREFIX_BYTES}`);
|
|
116
119
|
}
|
|
117
120
|
const body = bytes.subarray(LENGTH_PREFIX_BYTES, LENGTH_PREFIX_BYTES + declared);
|
|
121
|
+
// Fetched outside the try, so a missing `TextDecoder` polyfill surfaces as itself rather than as
|
|
122
|
+
// "not valid UTF-8".
|
|
123
|
+
const decoder = utf8Decoder();
|
|
118
124
|
let text;
|
|
119
125
|
try {
|
|
120
|
-
text =
|
|
126
|
+
text = decoder.decode(body);
|
|
121
127
|
}
|
|
122
128
|
catch {
|
|
123
129
|
throw new CohortWireError("frame body is not valid UTF-8");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../../src/cohort-topic/wire/codec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GA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