@optimystic/db-core 0.14.1 → 0.16.3
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/blocks/block-store.d.ts +18 -1
- package/dist/src/blocks/block-store.d.ts.map +1 -1
- package/dist/src/blocks/helpers.d.ts +2 -2
- package/dist/src/blocks/helpers.d.ts.map +1 -1
- package/dist/src/blocks/helpers.js +2 -2
- package/dist/src/blocks/helpers.js.map +1 -1
- package/dist/src/btree/btree.d.ts +27 -6
- package/dist/src/btree/btree.d.ts.map +1 -1
- package/dist/src/btree/btree.js +104 -61
- package/dist/src/btree/btree.js.map +1 -1
- package/dist/src/chain/chain.d.ts.map +1 -1
- package/dist/src/chain/chain.js +11 -1
- package/dist/src/chain/chain.js.map +1 -1
- package/dist/src/cluster/index.d.ts +1 -0
- package/dist/src/cluster/index.d.ts.map +1 -1
- package/dist/src/cluster/index.js +1 -0
- package/dist/src/cluster/index.js.map +1 -1
- package/dist/src/cluster/membership.d.ts +49 -0
- package/dist/src/cluster/membership.d.ts.map +1 -0
- package/dist/src/cluster/membership.js +75 -0
- package/dist/src/cluster/membership.js.map +1 -0
- package/dist/src/cluster/structs.d.ts +50 -1
- package/dist/src/cluster/structs.d.ts.map +1 -1
- package/dist/src/cluster/structs.js +9 -1
- package/dist/src/cluster/structs.js.map +1 -1
- package/dist/src/cohort-topic/addressing.d.ts +8 -2
- package/dist/src/cohort-topic/addressing.d.ts.map +1 -1
- package/dist/src/cohort-topic/addressing.js +11 -3
- package/dist/src/cohort-topic/addressing.js.map +1 -1
- package/dist/src/cohort-topic/antidos/bootstrap-evidence.d.ts +13 -7
- package/dist/src/cohort-topic/antidos/bootstrap-evidence.d.ts.map +1 -1
- package/dist/src/cohort-topic/antidos/bootstrap-evidence.js +17 -6
- package/dist/src/cohort-topic/antidos/bootstrap-evidence.js.map +1 -1
- package/dist/src/cohort-topic/antidos/replay-guard.d.ts +17 -0
- package/dist/src/cohort-topic/antidos/replay-guard.d.ts.map +1 -1
- package/dist/src/cohort-topic/antidos/replay-guard.js +33 -0
- package/dist/src/cohort-topic/antidos/replay-guard.js.map +1 -1
- package/dist/src/cohort-topic/antidos/topic-budget.d.ts +7 -0
- package/dist/src/cohort-topic/antidos/topic-budget.d.ts.map +1 -1
- package/dist/src/cohort-topic/antidos/topic-budget.js +8 -2
- package/dist/src/cohort-topic/antidos/topic-budget.js.map +1 -1
- package/dist/src/cohort-topic/coldstart.d.ts +34 -14
- package/dist/src/cohort-topic/coldstart.d.ts.map +1 -1
- package/dist/src/cohort-topic/coldstart.js +25 -11
- package/dist/src/cohort-topic/coldstart.js.map +1 -1
- package/dist/src/cohort-topic/gossip/bus.d.ts +12 -1
- package/dist/src/cohort-topic/gossip/bus.d.ts.map +1 -1
- package/dist/src/cohort-topic/gossip/bus.js +27 -1
- package/dist/src/cohort-topic/gossip/bus.js.map +1 -1
- package/dist/src/cohort-topic/gossip/view.d.ts +8 -0
- package/dist/src/cohort-topic/gossip/view.d.ts.map +1 -1
- package/dist/src/cohort-topic/gossip/view.js +17 -1
- package/dist/src/cohort-topic/gossip/view.js.map +1 -1
- package/dist/src/cohort-topic/member-engine.d.ts +10 -3
- package/dist/src/cohort-topic/member-engine.d.ts.map +1 -1
- package/dist/src/cohort-topic/member-engine.js +29 -14
- package/dist/src/cohort-topic/member-engine.js.map +1 -1
- package/dist/src/cohort-topic/membership/publisher.d.ts +14 -7
- package/dist/src/cohort-topic/membership/publisher.d.ts.map +1 -1
- package/dist/src/cohort-topic/membership/publisher.js +15 -27
- package/dist/src/cohort-topic/membership/publisher.js.map +1 -1
- package/dist/src/cohort-topic/membership/verifier.d.ts +35 -0
- package/dist/src/cohort-topic/membership/verifier.d.ts.map +1 -1
- package/dist/src/cohort-topic/membership/verifier.js +88 -3
- package/dist/src/cohort-topic/membership/verifier.js.map +1 -1
- package/dist/src/cohort-topic/promotion.d.ts +7 -0
- package/dist/src/cohort-topic/promotion.d.ts.map +1 -1
- package/dist/src/cohort-topic/promotion.js +16 -2
- package/dist/src/cohort-topic/promotion.js.map +1 -1
- package/dist/src/cohort-topic/registration/renewal.d.ts +18 -0
- package/dist/src/cohort-topic/registration/renewal.d.ts.map +1 -1
- package/dist/src/cohort-topic/registration/renewal.js +54 -0
- package/dist/src/cohort-topic/registration/renewal.js.map +1 -1
- package/dist/src/cohort-topic/registration/types.d.ts +12 -0
- package/dist/src/cohort-topic/registration/types.d.ts.map +1 -1
- package/dist/src/cohort-topic/registration/types.js +14 -0
- package/dist/src/cohort-topic/registration/types.js.map +1 -1
- package/dist/src/cohort-topic/service.d.ts +4 -3
- package/dist/src/cohort-topic/service.d.ts.map +1 -1
- package/dist/src/cohort-topic/service.js +38 -12
- package/dist/src/cohort-topic/service.js.map +1 -1
- package/dist/src/cohort-topic/sig/payloads.d.ts +23 -7
- package/dist/src/cohort-topic/sig/payloads.d.ts.map +1 -1
- package/dist/src/cohort-topic/sig/payloads.js +22 -6
- package/dist/src/cohort-topic/sig/payloads.js.map +1 -1
- package/dist/src/cohort-topic/traffic.d.ts +6 -0
- package/dist/src/cohort-topic/traffic.d.ts.map +1 -1
- package/dist/src/cohort-topic/traffic.js +16 -1
- package/dist/src/cohort-topic/traffic.js.map +1 -1
- package/dist/src/cohort-topic/walk.d.ts +22 -7
- package/dist/src/cohort-topic/walk.d.ts.map +1 -1
- package/dist/src/cohort-topic/walk.js +78 -18
- package/dist/src/cohort-topic/walk.js.map +1 -1
- package/dist/src/cohort-topic/wire/codec.d.ts +3 -1
- package/dist/src/cohort-topic/wire/codec.d.ts.map +1 -1
- package/dist/src/cohort-topic/wire/codec.js +7 -1
- package/dist/src/cohort-topic/wire/codec.js.map +1 -1
- package/dist/src/cohort-topic/wire/index.d.ts +1 -1
- package/dist/src/cohort-topic/wire/index.d.ts.map +1 -1
- package/dist/src/cohort-topic/wire/index.js +1 -1
- package/dist/src/cohort-topic/wire/index.js.map +1 -1
- package/dist/src/cohort-topic/wire/payloads.d.ts +5 -4
- package/dist/src/cohort-topic/wire/payloads.d.ts.map +1 -1
- package/dist/src/cohort-topic/wire/payloads.js +14 -5
- package/dist/src/cohort-topic/wire/payloads.js.map +1 -1
- package/dist/src/cohort-topic/wire/primitives.d.ts +65 -0
- package/dist/src/cohort-topic/wire/primitives.d.ts.map +1 -0
- package/dist/src/cohort-topic/wire/primitives.js +173 -0
- package/dist/src/cohort-topic/wire/primitives.js.map +1 -0
- package/dist/src/cohort-topic/wire/types.d.ts +132 -5
- package/dist/src/cohort-topic/wire/types.d.ts.map +1 -1
- package/dist/src/cohort-topic/wire/validate.d.ts +15 -5
- package/dist/src/cohort-topic/wire/validate.d.ts.map +1 -1
- package/dist/src/cohort-topic/wire/validate.js +146 -123
- package/dist/src/cohort-topic/wire/validate.js.map +1 -1
- package/dist/src/collection/collection.d.ts +23 -12
- package/dist/src/collection/collection.d.ts.map +1 -1
- package/dist/src/collection/collection.js +111 -35
- package/dist/src/collection/collection.js.map +1 -1
- package/dist/src/collection/struct.d.ts +37 -2
- package/dist/src/collection/struct.d.ts.map +1 -1
- package/dist/src/collection/struct.js +16 -1
- package/dist/src/collection/struct.js.map +1 -1
- package/dist/src/collections/tree/tree.d.ts +18 -1
- package/dist/src/collections/tree/tree.d.ts.map +1 -1
- package/dist/src/collections/tree/tree.js +36 -6
- package/dist/src/collections/tree/tree.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/log/log.d.ts +26 -3
- package/dist/src/log/log.d.ts.map +1 -1
- package/dist/src/log/log.js +34 -7
- package/dist/src/log/log.js.map +1 -1
- package/dist/src/log/struct.d.ts +5 -4
- package/dist/src/log/struct.d.ts.map +1 -1
- package/dist/src/log/struct.js.map +1 -1
- package/dist/src/matchmaking/wire.d.ts +2 -1
- package/dist/src/matchmaking/wire.d.ts.map +1 -1
- package/dist/src/matchmaking/wire.js +13 -92
- package/dist/src/matchmaking/wire.js.map +1 -1
- package/dist/src/network/i-key-network.d.ts +9 -0
- package/dist/src/network/i-key-network.d.ts.map +1 -1
- package/dist/src/network/i-repo.d.ts +8 -0
- package/dist/src/network/i-repo.d.ts.map +1 -1
- package/dist/src/network/struct.d.ts +10 -0
- package/dist/src/network/struct.d.ts.map +1 -1
- package/dist/src/reactivity/push-state.d.ts.map +1 -1
- package/dist/src/reactivity/push-state.js +4 -33
- package/dist/src/reactivity/push-state.js.map +1 -1
- package/dist/src/reactivity/wire-validate.d.ts +7 -22
- package/dist/src/reactivity/wire-validate.d.ts.map +1 -1
- package/dist/src/reactivity/wire-validate.js +7 -73
- package/dist/src/reactivity/wire-validate.js.map +1 -1
- package/dist/src/reactivity/wire.js +3 -3
- package/dist/src/reactivity/wire.js.map +1 -1
- package/dist/src/testing/async-wait.d.ts +23 -0
- package/dist/src/testing/async-wait.d.ts.map +1 -0
- package/dist/src/testing/async-wait.js +42 -0
- package/dist/src/testing/async-wait.js.map +1 -0
- package/dist/src/testing/index.d.ts +3 -0
- package/dist/src/testing/index.d.ts.map +1 -0
- package/dist/src/testing/index.js +3 -0
- package/dist/src/testing/index.js.map +1 -0
- package/dist/src/testing/test-transactor.d.ts +44 -0
- package/dist/src/testing/test-transactor.d.ts.map +1 -0
- package/dist/src/testing/test-transactor.js +423 -0
- package/dist/src/testing/test-transactor.js.map +1 -0
- package/dist/src/transaction/actions-engine.d.ts +6 -3
- package/dist/src/transaction/actions-engine.d.ts.map +1 -1
- package/dist/src/transaction/actions-engine.js +8 -7
- package/dist/src/transaction/actions-engine.js.map +1 -1
- package/dist/src/transaction/coordinator.d.ts +43 -22
- package/dist/src/transaction/coordinator.d.ts.map +1 -1
- package/dist/src/transaction/coordinator.js +443 -178
- package/dist/src/transaction/coordinator.js.map +1 -1
- package/dist/src/transaction/errors.d.ts +82 -0
- package/dist/src/transaction/errors.d.ts.map +1 -0
- package/dist/src/transaction/errors.js +93 -0
- package/dist/src/transaction/errors.js.map +1 -0
- package/dist/src/transaction/index.d.ts +6 -3
- package/dist/src/transaction/index.d.ts.map +1 -1
- package/dist/src/transaction/index.js +4 -2
- package/dist/src/transaction/index.js.map +1 -1
- package/dist/src/transaction/operations-hash.d.ts +119 -0
- package/dist/src/transaction/operations-hash.d.ts.map +1 -0
- package/dist/src/transaction/operations-hash.js +180 -0
- package/dist/src/transaction/operations-hash.js.map +1 -0
- package/dist/src/transaction/read-dependency-collector.d.ts +43 -0
- package/dist/src/transaction/read-dependency-collector.d.ts.map +1 -0
- package/dist/src/transaction/read-dependency-collector.js +69 -0
- package/dist/src/transaction/read-dependency-collector.js.map +1 -0
- package/dist/src/transaction/session.d.ts +12 -3
- package/dist/src/transaction/session.d.ts.map +1 -1
- package/dist/src/transaction/session.js +35 -9
- package/dist/src/transaction/session.js.map +1 -1
- package/dist/src/transaction/transaction.d.ts +162 -1
- package/dist/src/transaction/transaction.d.ts.map +1 -1
- package/dist/src/transaction/transaction.js +85 -3
- package/dist/src/transaction/transaction.js.map +1 -1
- package/dist/src/transaction/validator.d.ts +3 -11
- package/dist/src/transaction/validator.d.ts.map +1 -1
- package/dist/src/transaction/validator.js +69 -28
- package/dist/src/transaction/validator.js.map +1 -1
- package/dist/src/transactor/network-transactor.d.ts +35 -0
- package/dist/src/transactor/network-transactor.d.ts.map +1 -1
- package/dist/src/transactor/network-transactor.js +146 -40
- package/dist/src/transactor/network-transactor.js.map +1 -1
- package/dist/src/transactor/transactor-source.d.ts +19 -5
- package/dist/src/transactor/transactor-source.d.ts.map +1 -1
- package/dist/src/transactor/transactor-source.js +43 -11
- package/dist/src/transactor/transactor-source.js.map +1 -1
- package/dist/src/transform/atomic-proxy.d.ts +35 -5
- package/dist/src/transform/atomic-proxy.d.ts.map +1 -1
- package/dist/src/transform/atomic-proxy.js +39 -7
- package/dist/src/transform/atomic-proxy.js.map +1 -1
- package/dist/src/transform/cache-source.d.ts +36 -5
- package/dist/src/transform/cache-source.d.ts.map +1 -1
- package/dist/src/transform/cache-source.js +84 -8
- package/dist/src/transform/cache-source.js.map +1 -1
- package/dist/src/transform/helpers.d.ts.map +1 -1
- package/dist/src/transform/helpers.js +8 -2
- package/dist/src/transform/helpers.js.map +1 -1
- package/dist/src/transform/tracker.d.ts +17 -2
- package/dist/src/transform/tracker.d.ts.map +1 -1
- package/dist/src/transform/tracker.js +66 -11
- package/dist/src/transform/tracker.js.map +1 -1
- package/dist/src/utility/backoff.d.ts +48 -0
- package/dist/src/utility/backoff.d.ts.map +1 -0
- package/dist/src/utility/backoff.js +60 -0
- package/dist/src/utility/backoff.js.map +1 -0
- package/dist/src/utility/pending.d.ts +1 -0
- package/dist/src/utility/pending.d.ts.map +1 -1
- package/dist/src/utility/pending.js +3 -1
- package/dist/src/utility/pending.js.map +1 -1
- package/package.json +4 -4
- package/src/blocks/block-store.ts +19 -1
- package/src/blocks/helpers.ts +3 -3
- package/src/btree/btree.ts +108 -63
- package/src/chain/chain.ts +11 -1
- package/src/cluster/index.ts +1 -0
- package/src/cluster/membership.ts +85 -0
- package/src/cluster/structs.ts +51 -1
- package/src/cohort-topic/addressing.ts +12 -4
- package/src/cohort-topic/antidos/bootstrap-evidence.ts +21 -9
- package/src/cohort-topic/antidos/replay-guard.ts +37 -0
- package/src/cohort-topic/antidos/topic-budget.ts +17 -2
- package/src/cohort-topic/coldstart.ts +48 -15
- package/src/cohort-topic/gossip/bus.ts +39 -2
- package/src/cohort-topic/gossip/view.ts +26 -1
- package/src/cohort-topic/member-engine.ts +36 -15
- package/src/cohort-topic/membership/publisher.ts +25 -33
- package/src/cohort-topic/membership/verifier.ts +119 -3
- package/src/cohort-topic/promotion.ts +23 -2
- package/src/cohort-topic/registration/renewal.ts +73 -1
- package/src/cohort-topic/registration/types.ts +15 -0
- package/src/cohort-topic/service.ts +41 -15
- package/src/cohort-topic/sig/payloads.ts +29 -9
- package/src/cohort-topic/traffic.ts +23 -1
- package/src/cohort-topic/walk.ts +95 -24
- package/src/cohort-topic/wire/codec.ts +12 -0
- package/src/cohort-topic/wire/index.ts +2 -0
- package/src/cohort-topic/wire/payloads.ts +14 -5
- package/src/cohort-topic/wire/primitives.ts +188 -0
- package/src/cohort-topic/wire/types.ts +136 -4
- package/src/cohort-topic/wire/validate.ts +168 -134
- package/src/collection/collection.ts +123 -40
- package/src/collection/struct.ts +44 -2
- package/src/collections/tree/tree.ts +42 -5
- package/src/index.ts +1 -0
- package/src/log/log.ts +37 -9
- package/src/log/struct.ts +5 -4
- package/src/matchmaking/wire.ts +25 -102
- package/src/network/i-key-network.ts +10 -0
- package/src/network/i-repo.ts +8 -0
- package/src/network/struct.ts +10 -0
- package/src/reactivity/push-state.ts +4 -37
- package/src/reactivity/wire-validate.ts +7 -81
- package/src/reactivity/wire.ts +3 -3
- package/src/testing/async-wait.ts +65 -0
- package/src/testing/index.ts +2 -0
- package/src/testing/test-transactor.ts +468 -0
- package/src/transaction/actions-engine.ts +8 -6
- package/src/transaction/coordinator.ts +498 -229
- package/src/transaction/errors.ts +91 -0
- package/src/transaction/index.ts +23 -3
- package/src/transaction/operations-hash.ts +196 -0
- package/src/transaction/read-dependency-collector.ts +78 -0
- package/src/transaction/session.ts +37 -9
- package/src/transaction/transaction.ts +211 -4
- package/src/transaction/validator.ts +73 -48
- package/src/transactor/network-transactor.ts +164 -49
- package/src/transactor/transactor-source.ts +47 -12
- package/src/transform/atomic-proxy.ts +92 -49
- package/src/transform/cache-source.ts +87 -9
- package/src/transform/helpers.ts +8 -2
- package/src/transform/tracker.ts +69 -11
- package/src/utility/backoff.ts +95 -0
- package/src/utility/pending.ts +3 -1
- package/src/transaction/context.ts +0 -103
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Byte fields travel as base64url (no padding); {@link bytesToB64url} / {@link b64urlToBytes}
|
|
10
10
|
* are the shared, cross-platform (browser/node/RN) helpers — no Node `Buffer`.
|
|
11
11
|
*/
|
|
12
|
-
import type { CohortGossipV1, DemotionNoticeV1, MembershipCertV1, PromotionNoticeV1, RegisterReplyV1, RegisterV1, RenewReplyV1, RenewV1, SignRequestV1, SignReplyV1 } from "./types.js";
|
|
12
|
+
import type { ChildLinkReplyV1, ChildLinkV1, CohortGossipV1, DemotionNoticeV1, MembershipCertV1, PromotionNoticeV1, RegisterReplyV1, RegisterV1, RenewReplyV1, RenewV1, SignRequestV1, SignReplyV1 } from "./types.js";
|
|
13
13
|
/**
|
|
14
14
|
* Default ceiling on a framed body, in bytes. Sized conservatively at 1 MiB until the
|
|
15
15
|
* simulator-validated cohort-gossip worst case (`topics_max` topic summaries, see
|
|
@@ -33,6 +33,8 @@ export declare function decodeRegisterV1(bytes: Uint8Array, maxMessageBytes?: nu
|
|
|
33
33
|
export declare function decodeRegisterReplyV1(bytes: Uint8Array, maxMessageBytes?: number): RegisterReplyV1;
|
|
34
34
|
export declare function decodeRenewV1(bytes: Uint8Array, maxMessageBytes?: number): RenewV1;
|
|
35
35
|
export declare function decodeRenewReplyV1(bytes: Uint8Array, maxMessageBytes?: number): RenewReplyV1;
|
|
36
|
+
export declare function decodeChildLinkV1(bytes: Uint8Array, maxMessageBytes?: number, minSigs?: number): ChildLinkV1;
|
|
37
|
+
export declare function decodeChildLinkReplyV1(bytes: Uint8Array, maxMessageBytes?: number): ChildLinkReplyV1;
|
|
36
38
|
export declare function decodePromotionNoticeV1(bytes: Uint8Array, maxMessageBytes?: number): PromotionNoticeV1;
|
|
37
39
|
export declare function decodeDemotionNoticeV1(bytes: Uint8Array, maxMessageBytes?: number): DemotionNoticeV1;
|
|
38
40
|
export declare function decodeCohortGossipV1(bytes: Uint8Array, maxMessageBytes?: number): CohortGossipV1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../../src/cohort-topic/wire/codec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../../src/cohort-topic/wire/codec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAi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AAE,MAAM,GAAG,gBAAgB,CAEpG;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,UAAU,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAEtG;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,UAAU,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAEpG;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,cAAc,CAEhG;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,UAAU,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAEpG;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,aAAa,CAE9F;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,WAAW,CAE1F"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* are the shared, cross-platform (browser/node/RN) helpers — no Node `Buffer`.
|
|
11
11
|
*/
|
|
12
12
|
import { CohortWireError } from "./validate.js";
|
|
13
|
-
import { validateCohortGossipV1, validateDemotionNoticeV1, validateMembershipCertV1, validatePromotionNoticeV1, validateRegisterReplyV1, validateRegisterV1, validateRenewReplyV1, validateRenewV1, validateSignRequestV1, validateSignReplyV1, } from "./validate.js";
|
|
13
|
+
import { validateChildLinkReplyV1, validateChildLinkV1, validateCohortGossipV1, validateDemotionNoticeV1, validateMembershipCertV1, validatePromotionNoticeV1, validateRegisterReplyV1, validateRegisterV1, validateRenewReplyV1, validateRenewV1, validateSignRequestV1, validateSignReplyV1, } from "./validate.js";
|
|
14
14
|
/**
|
|
15
15
|
* Default ceiling on a framed body, in bytes. Sized conservatively at 1 MiB until the
|
|
16
16
|
* simulator-validated cohort-gossip worst case (`topics_max` topic summaries, see
|
|
@@ -142,6 +142,12 @@ export function decodeRenewV1(bytes, maxMessageBytes) {
|
|
|
142
142
|
export function decodeRenewReplyV1(bytes, maxMessageBytes) {
|
|
143
143
|
return validateRenewReplyV1(decodeCohortMessage(bytes, maxMessageBytes));
|
|
144
144
|
}
|
|
145
|
+
export function decodeChildLinkV1(bytes, maxMessageBytes, minSigs) {
|
|
146
|
+
return validateChildLinkV1(decodeCohortMessage(bytes, maxMessageBytes), minSigs);
|
|
147
|
+
}
|
|
148
|
+
export function decodeChildLinkReplyV1(bytes, maxMessageBytes) {
|
|
149
|
+
return validateChildLinkReplyV1(decodeCohortMessage(bytes, maxMessageBytes));
|
|
150
|
+
}
|
|
145
151
|
export function decodePromotionNoticeV1(bytes, maxMessageBytes) {
|
|
146
152
|
return validatePromotionNoticeV1(decodeCohortMessage(bytes, maxMessageBytes));
|
|
147
153
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../../src/cohort-topic/wire/codec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACN,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,mBAAmB,GACnB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../../src/cohort-topic/wire/codec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACN,wBAAwB,EACxB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,mBAAmB,GACnB,MAAM,eAAe,CAAC;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AAwB;IACjF,OAAO,wBAAwB,CAAC,mBAAmB,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,KAAiB,EAAE,eAAwB;IAClF,OAAO,yBAAyB,CAAC,mBAAmB,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC;AAC/E,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,KAAiB,EAAE,eAAwB;IACjF,OAAO,wBAAwB,CAAC,mBAAmB,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,KAAiB,EAAE,eAAwB;IAC/E,OAAO,sBAAsB,CAAC,mBAAmB,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,KAAiB,EAAE,eAAwB;IACjF,OAAO,wBAAwB,CAAC,mBAAmB,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,KAAiB,EAAE,eAAwB;IAC9E,OAAO,qBAAqB,CAAC,mBAAmB,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAiB,EAAE,eAAwB;IAC5E,OAAO,mBAAmB,CAAC,mBAAmB,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -2,5 +2,5 @@ export * from "./types.js";
|
|
|
2
2
|
export * from "./codec.js";
|
|
3
3
|
export * from "./payloads.js";
|
|
4
4
|
export { CohortWireError } from "./validate.js";
|
|
5
|
-
export { validateRegisterV1, validateRegisterReplyV1, validateRenewV1, validateRenewReplyV1, validatePromotionNoticeV1, validateDemotionNoticeV1, validateCohortGossipV1, validateMembershipCertV1, validateSignRequestV1, validateSignReplyV1, } from "./validate.js";
|
|
5
|
+
export { validateRegisterV1, validateRegisterReplyV1, validateRenewV1, validateRenewReplyV1, validateChildLinkV1, validateChildLinkReplyV1, validatePromotionNoticeV1, validateDemotionNoticeV1, validateCohortGossipV1, validateMembershipCertV1, validateSignRequestV1, validateSignReplyV1, } from "./validate.js";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cohort-topic/wire/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACN,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,EACf,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,GACnB,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cohort-topic/wire/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACN,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,GACnB,MAAM,eAAe,CAAC"}
|
|
@@ -2,5 +2,5 @@ export * from "./types.js";
|
|
|
2
2
|
export * from "./codec.js";
|
|
3
3
|
export * from "./payloads.js";
|
|
4
4
|
export { CohortWireError } from "./validate.js";
|
|
5
|
-
export { validateRegisterV1, validateRegisterReplyV1, validateRenewV1, validateRenewReplyV1, validatePromotionNoticeV1, validateDemotionNoticeV1, validateCohortGossipV1, validateMembershipCertV1, validateSignRequestV1, validateSignReplyV1, } from "./validate.js";
|
|
5
|
+
export { validateRegisterV1, validateRegisterReplyV1, validateRenewV1, validateRenewReplyV1, validateChildLinkV1, validateChildLinkReplyV1, validatePromotionNoticeV1, validateDemotionNoticeV1, validateCohortGossipV1, validateMembershipCertV1, validateSignRequestV1, validateSignReplyV1, } from "./validate.js";
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cohort-topic/wire/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACN,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,EACf,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,GACnB,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cohort-topic/wire/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACN,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,GACnB,MAAM,eAAe,CAAC"}
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
* for the threshold-signed notices, determinism comes from encoding an explicitly-ordered JSON
|
|
11
11
|
* array (array order is stable, unlike object key order) as UTF-8 — never the `signature` envelope.
|
|
12
12
|
* Optional fields are normalized to a fixed placeholder (`bootstrap`→`false`, `probe`→`false`,
|
|
13
|
-
* `appPayload`→`null`, `bootstrapEvidence`→`null` with an empty string treated as
|
|
14
|
-
* `reattach`→`false`, `withdraw`→`false`) so an absent optional and a present-but-default
|
|
15
|
-
* never disagree across the wire round-trip.
|
|
13
|
+
* `followOn`→`false`, `appPayload`→`null`, `bootstrapEvidence`→`null` with an empty string treated as
|
|
14
|
+
* absent, `reattach`→`false`, `withdraw`→`false`) so an absent optional and a present-but-default
|
|
15
|
+
* optional can never disagree across the wire round-trip.
|
|
16
16
|
*/
|
|
17
17
|
import type { CohortGossipV1, RegisterV1, RenewV1 } from "./types.js";
|
|
18
18
|
/** A `RegisterV1` minus its `signature` envelope — the bytes the participant peer-key-signs. */
|
|
@@ -32,7 +32,8 @@ export type CohortGossipSignable = Omit<CohortGossipV1, "signature">;
|
|
|
32
32
|
* or replicate forged records). Like the other payload helpers, determinism comes from an
|
|
33
33
|
* explicitly-ordered array — nested records/summaries/evictions are emitted as fixed ordered tuples so
|
|
34
34
|
* the signer and the receiver (which re-derives this image from the validated frame) agree byte-for-byte.
|
|
35
|
-
* Absent optionals (`records`/`evicted`) normalize to `[]`, and `appState` to
|
|
35
|
+
* Absent optionals (`records`/`evicted`/`childLinks`/`childUnlinks`) normalize to `[]`, and `appState` to
|
|
36
|
+
* `null`. `childLinks`/`childUnlinks` are covered so a MITM cannot strip or inject a child link/unlink.
|
|
36
37
|
*/
|
|
37
38
|
export declare function cohortGossipSigningPayload(g: CohortGossipSignable): Uint8Array;
|
|
38
39
|
//# sourceMappingURL=payloads.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payloads.d.ts","sourceRoot":"","sources":["../../../../src/cohort-topic/wire/payloads.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAItE,gGAAgG;AAChG,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;AAE7D,6FAA6F;AAC7F,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AAOvD,2FAA2F;AAC3F,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,gBAAgB,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"payloads.d.ts","sourceRoot":"","sources":["../../../../src/cohort-topic/wire/payloads.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAItE,gGAAgG;AAChG,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;AAE7D,6FAA6F;AAC7F,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AAOvD,2FAA2F;AAC3F,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,gBAAgB,GAAG,UAAU,CAuBzE;AAED,wFAAwF;AACxF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,aAAa,GAAG,UAAU,CAenE;AAED,yGAAyG;AACzG,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;AAErE;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,oBAAoB,GAAG,UAAU,CAoC9E"}
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
* for the threshold-signed notices, determinism comes from encoding an explicitly-ordered JSON
|
|
11
11
|
* array (array order is stable, unlike object key order) as UTF-8 — never the `signature` envelope.
|
|
12
12
|
* Optional fields are normalized to a fixed placeholder (`bootstrap`→`false`, `probe`→`false`,
|
|
13
|
-
* `appPayload`→`null`, `bootstrapEvidence`→`null` with an empty string treated as
|
|
14
|
-
* `reattach`→`false`, `withdraw`→`false`) so an absent optional and a present-but-default
|
|
15
|
-
* never disagree across the wire round-trip.
|
|
13
|
+
* `followOn`→`false`, `appPayload`→`null`, `bootstrapEvidence`→`null` with an empty string treated as
|
|
14
|
+
* absent, `reattach`→`false`, `withdraw`→`false`) so an absent optional and a present-but-default
|
|
15
|
+
* optional can never disagree across the wire round-trip.
|
|
16
16
|
*/
|
|
17
17
|
const utf8 = new TextEncoder();
|
|
18
18
|
/** Normalize the optional bootstrap-evidence slot: absent and empty-string both map to `null`. */
|
|
@@ -37,6 +37,11 @@ export function registerSigningPayload(body) {
|
|
|
37
37
|
// A read-only probe signs `probe: true`; a normal register signs `false`. Both sides recompute
|
|
38
38
|
// this image identically, so a probe and a register over the same fields produce distinct signatures.
|
|
39
39
|
body.probe ?? false,
|
|
40
|
+
// A follow-on cold-start re-issue signs `followOn: true`, everything else `false`. Strictly appended
|
|
41
|
+
// (sibling to `probe`/`withdraw`) so a MITM cannot strip or flip the follow-on assertion and the
|
|
42
|
+
// signer (participant) + verifier (db-p2p cohort) agree byte-for-byte. Safe to append: no register
|
|
43
|
+
// signatures are persisted (each is recomputed per verify), so there is no cross-version image concern.
|
|
44
|
+
body.followOn ?? false,
|
|
40
45
|
]));
|
|
41
46
|
}
|
|
42
47
|
/** Canonical signed byte image of a `RenewV1` body (every field except `signature`). */
|
|
@@ -63,7 +68,8 @@ export function renewSigningPayload(body) {
|
|
|
63
68
|
* or replicate forged records). Like the other payload helpers, determinism comes from an
|
|
64
69
|
* explicitly-ordered array — nested records/summaries/evictions are emitted as fixed ordered tuples so
|
|
65
70
|
* the signer and the receiver (which re-derives this image from the validated frame) agree byte-for-byte.
|
|
66
|
-
* Absent optionals (`records`/`evicted`) normalize to `[]`, and `appState` to
|
|
71
|
+
* Absent optionals (`records`/`evicted`/`childLinks`/`childUnlinks`) normalize to `[]`, and `appState` to
|
|
72
|
+
* `null`. `childLinks`/`childUnlinks` are covered so a MITM cannot strip or inject a child link/unlink.
|
|
67
73
|
*/
|
|
68
74
|
export function cohortGossipSigningPayload(g) {
|
|
69
75
|
return utf8.encode(JSON.stringify([
|
|
@@ -72,6 +78,7 @@ export function cohortGossipSigningPayload(g) {
|
|
|
72
78
|
g.fromMember,
|
|
73
79
|
g.coord,
|
|
74
80
|
g.cohortEpoch,
|
|
81
|
+
g.treeTier,
|
|
75
82
|
g.willingnessBits,
|
|
76
83
|
g.loadBuckets,
|
|
77
84
|
g.windowSeconds,
|
|
@@ -95,7 +102,9 @@ export function cohortGossipSigningPayload(g) {
|
|
|
95
102
|
r.ttl,
|
|
96
103
|
r.appState ?? null,
|
|
97
104
|
]),
|
|
98
|
-
(g.evicted ?? []).map((e) => [e.topicId, e.participantId]),
|
|
105
|
+
(g.evicted ?? []).map((e) => [e.topicId, e.participantId, e.lastPing]),
|
|
106
|
+
(g.childLinks ?? []).map((c) => [c.topicId, c.childCohortCoord, c.effectiveAt]),
|
|
107
|
+
(g.childUnlinks ?? []).map((c) => [c.topicId, c.childCohortCoord, c.effectiveAt]),
|
|
99
108
|
g.timestamp,
|
|
100
109
|
]));
|
|
101
110
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payloads.js","sourceRoot":"","sources":["../../../../src/cohort-topic/wire/payloads.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,MAAM,IAAI,GAAG,IAAI,WAAW,EAAE,CAAC;AAQ/B,kGAAkG;AAClG,SAAS,iBAAiB,CAAC,iBAAqC;IAC/D,OAAO,iBAAiB,KAAK,SAAS,IAAI,iBAAiB,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC;AAC/F,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,sBAAsB,CAAC,IAAsB;IAC5D,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAA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,CAAC,OAAO;YACT,CAAC,CAAC,aAAa;YACf,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,QAAQ;YACV,CAAC,CAAC,GAAG;YACL,CAAC,CAAC,QAAQ,IAAI,IAAI;SAClB,CAAC;QACF,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,gBAAgB,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC;QAC/E,CAAC,CAAC,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,gBAAgB,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC;QACjF,CAAC,CAAC,SAAS;KACX,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cohort-topic wire substrate — shared structural-validation primitives.
|
|
3
|
+
*
|
|
4
|
+
* The generic per-field checks every wire codec across the substrate (cohort-topic, matchmaking,
|
|
5
|
+
* reactivity) uses to narrow an already-parsed `unknown` (the output of `JSON.parse` on a decoded
|
|
6
|
+
* frame) into a validated V1 shape. Each helper throws {@link CohortWireError} on a structural defect:
|
|
7
|
+
* missing required field, wrong `v`, out-of-enum discriminant, a byte field that does not decode as
|
|
8
|
+
* base64url, or an out-of-range numeric.
|
|
9
|
+
*
|
|
10
|
+
* These are the *only* generic primitives — domain-specific narrowing (the `validate*V1` functions, the
|
|
11
|
+
* cohort-topic `tier` / `treeTier` semantics, matchmaking utf8 coders, reactivity notification shapes)
|
|
12
|
+
* lives in the modules that own those message shapes. Keeping the primitives in one place means a
|
|
13
|
+
* hardening tweak to a check (e.g. the fixed-length byte-width guard in {@link b64urlFixedLen}) lands
|
|
14
|
+
* once and every consumer inherits it.
|
|
15
|
+
*/
|
|
16
|
+
/** Thrown for any malformed, oversized, or structurally invalid cohort-topic frame. */
|
|
17
|
+
export declare class CohortWireError extends Error {
|
|
18
|
+
constructor(message: string);
|
|
19
|
+
}
|
|
20
|
+
/** Throw a {@link CohortWireError} with `message`. */
|
|
21
|
+
export declare function failWire(message: string): never;
|
|
22
|
+
/** Set `obj[key]` only when `value` is defined — keeps absent optionals off the decoded object. */
|
|
23
|
+
export declare function assignDefined<T extends object, K extends keyof T>(obj: T, key: K, value: T[K] | undefined): void;
|
|
24
|
+
/** Narrow `value` to a plain object (not null, not an array), or throw. */
|
|
25
|
+
export declare function asObject(value: unknown, what: string): Record<string, unknown>;
|
|
26
|
+
/** Require `obj.v === 1`. */
|
|
27
|
+
export declare function requireV1(obj: Record<string, unknown>, what: string): void;
|
|
28
|
+
/** Require `obj[key]` to be a string; returns it. */
|
|
29
|
+
export declare function reqString(obj: Record<string, unknown>, key: string, what: string): string;
|
|
30
|
+
/** Return `obj[key]` when it is a string, `undefined` when absent; throw on any other type. */
|
|
31
|
+
export declare function optString(obj: Record<string, unknown>, key: string, what: string): string | undefined;
|
|
32
|
+
/** Require `obj[key]` to be a finite number; returns it. */
|
|
33
|
+
export declare function reqFiniteNumber(obj: Record<string, unknown>, key: string, what: string): number;
|
|
34
|
+
/** Return `obj[key]` when it is a finite number, `undefined` when absent; throw on any other type. */
|
|
35
|
+
export declare function optFiniteNumber(obj: Record<string, unknown>, key: string, what: string): number | undefined;
|
|
36
|
+
/** Require `obj[key]` to be a boolean; returns it. */
|
|
37
|
+
export declare function reqBool(obj: Record<string, unknown>, key: string, what: string): boolean;
|
|
38
|
+
/** Return `obj[key]` when it is a boolean, `undefined` when absent; throw on any other type. */
|
|
39
|
+
export declare function optBool(obj: Record<string, unknown>, key: string, what: string): boolean | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Require `obj[key]` to be an integer `>= min` (and `<= max` when supplied); returns it. Reads and
|
|
42
|
+
* finite-checks the field itself (via {@link reqFiniteNumber}) so callers pass the object + key rather
|
|
43
|
+
* than a pre-extracted value — this composes with the other `req*` helpers.
|
|
44
|
+
*/
|
|
45
|
+
export declare function reqIntInRange(obj: Record<string, unknown>, key: string, what: string, min: number, max?: number): number;
|
|
46
|
+
/** Require `obj[key]` to be an array of strings; returns it. */
|
|
47
|
+
export declare function reqStringArray(obj: Record<string, unknown>, key: string, what: string): string[];
|
|
48
|
+
/** Return `obj[key]` when it is an array of strings, `undefined` when absent; throw on any other type. */
|
|
49
|
+
export declare function optStringArray(obj: Record<string, unknown>, key: string, what: string): string[] | undefined;
|
|
50
|
+
/** Require `obj[key]` to be one of `allowed`; returns it narrowed to the enum type. */
|
|
51
|
+
export declare function reqEnum<T extends string>(obj: Record<string, unknown>, key: string, allowed: readonly T[], what: string): T;
|
|
52
|
+
/**
|
|
53
|
+
* Assert a base64url string decodes cleanly; returns it unchanged. Used for variable-width fields —
|
|
54
|
+
* peer ids (multihash-encoded, not 32 raw bytes), signatures, and opaque application payloads.
|
|
55
|
+
*
|
|
56
|
+
* NOTE: no max-length bound here. A hostile peer can still bloat one of these variable-width fields
|
|
57
|
+
* (e.g. `participantCoord`, a signature) into a large map key in the store / rate limiter / replay
|
|
58
|
+
* guard. Their widths aren't pinned by the spec, so a ceiling would be a chosen policy value rather
|
|
59
|
+
* than a decode of the format. If a bloated one is ever seen as a map key in practice, add a
|
|
60
|
+
* `b64urlMaxLen` ceiling here. (Fixed-width hash-derived fields go through `b64urlFixedLen` instead.)
|
|
61
|
+
*/
|
|
62
|
+
export declare function b64urlField(value: string, key: string, what: string): string;
|
|
63
|
+
/** Assert a base64url string decodes cleanly to exactly `len` bytes; returns it unchanged. */
|
|
64
|
+
export declare function b64urlFixedLen(value: string, key: string, len: number, what: string): string;
|
|
65
|
+
//# sourceMappingURL=primitives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../../src/cohort-topic/wire/primitives.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,uFAAuF;AACvF,qBAAa,eAAgB,SAAQ,KAAK;gBAC7B,OAAO,EAAE,MAAM;CAI3B;AAED,sDAAsD;AACtD,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAE/C;AAED,mGAAmG;AACnG,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,CAIhH;AAED,2EAA2E;AAC3E,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAK9E;AAED,6BAA6B;AAC7B,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAI1E;AAED,qDAAqD;AACrD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMzF;AAED,+FAA+F;AAC/F,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,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AC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAM3H;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAO5E;AAED,8FAA8F;AAC9F,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAW5F"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cohort-topic wire substrate — shared structural-validation primitives.
|
|
3
|
+
*
|
|
4
|
+
* The generic per-field checks every wire codec across the substrate (cohort-topic, matchmaking,
|
|
5
|
+
* reactivity) uses to narrow an already-parsed `unknown` (the output of `JSON.parse` on a decoded
|
|
6
|
+
* frame) into a validated V1 shape. Each helper throws {@link CohortWireError} on a structural defect:
|
|
7
|
+
* missing required field, wrong `v`, out-of-enum discriminant, a byte field that does not decode as
|
|
8
|
+
* base64url, or an out-of-range numeric.
|
|
9
|
+
*
|
|
10
|
+
* These are the *only* generic primitives — domain-specific narrowing (the `validate*V1` functions, the
|
|
11
|
+
* cohort-topic `tier` / `treeTier` semantics, matchmaking utf8 coders, reactivity notification shapes)
|
|
12
|
+
* lives in the modules that own those message shapes. Keeping the primitives in one place means a
|
|
13
|
+
* hardening tweak to a check (e.g. the fixed-length byte-width guard in {@link b64urlFixedLen}) lands
|
|
14
|
+
* once and every consumer inherits it.
|
|
15
|
+
*/
|
|
16
|
+
import { b64urlToBytes } from "./codec.js";
|
|
17
|
+
/** Thrown for any malformed, oversized, or structurally invalid cohort-topic frame. */
|
|
18
|
+
export class CohortWireError extends Error {
|
|
19
|
+
constructor(message) {
|
|
20
|
+
super(message);
|
|
21
|
+
this.name = "CohortWireError";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/** Throw a {@link CohortWireError} with `message`. */
|
|
25
|
+
export function failWire(message) {
|
|
26
|
+
throw new CohortWireError(message);
|
|
27
|
+
}
|
|
28
|
+
/** Set `obj[key]` only when `value` is defined — keeps absent optionals off the decoded object. */
|
|
29
|
+
export function assignDefined(obj, key, value) {
|
|
30
|
+
if (value !== undefined) {
|
|
31
|
+
obj[key] = value;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/** Narrow `value` to a plain object (not null, not an array), or throw. */
|
|
35
|
+
export function asObject(value, what) {
|
|
36
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
37
|
+
failWire(`${what}: expected an object`);
|
|
38
|
+
}
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
/** Require `obj.v === 1`. */
|
|
42
|
+
export function requireV1(obj, what) {
|
|
43
|
+
if (obj["v"] !== 1) {
|
|
44
|
+
failWire(`${what}: expected v === 1, got ${JSON.stringify(obj["v"])}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/** Require `obj[key]` to be a string; returns it. */
|
|
48
|
+
export function reqString(obj, key, what) {
|
|
49
|
+
const value = obj[key];
|
|
50
|
+
if (typeof value !== "string") {
|
|
51
|
+
failWire(`${what}: field "${key}" must be a string`);
|
|
52
|
+
}
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
/** Return `obj[key]` when it is a string, `undefined` when absent; throw on any other type. */
|
|
56
|
+
export function optString(obj, key, what) {
|
|
57
|
+
const value = obj[key];
|
|
58
|
+
if (value === undefined) {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
if (typeof value !== "string") {
|
|
62
|
+
failWire(`${what}: field "${key}" must be a string when present`);
|
|
63
|
+
}
|
|
64
|
+
return value;
|
|
65
|
+
}
|
|
66
|
+
/** Require `obj[key]` to be a finite number; returns it. */
|
|
67
|
+
export function reqFiniteNumber(obj, key, what) {
|
|
68
|
+
const value = obj[key];
|
|
69
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
70
|
+
failWire(`${what}: field "${key}" must be a finite number`);
|
|
71
|
+
}
|
|
72
|
+
return value;
|
|
73
|
+
}
|
|
74
|
+
/** Return `obj[key]` when it is a finite number, `undefined` when absent; throw on any other type. */
|
|
75
|
+
export function optFiniteNumber(obj, key, what) {
|
|
76
|
+
const value = obj[key];
|
|
77
|
+
if (value === undefined) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
81
|
+
failWire(`${what}: field "${key}" must be a finite number when present`);
|
|
82
|
+
}
|
|
83
|
+
return value;
|
|
84
|
+
}
|
|
85
|
+
/** Require `obj[key]` to be a boolean; returns it. */
|
|
86
|
+
export function reqBool(obj, key, what) {
|
|
87
|
+
const value = obj[key];
|
|
88
|
+
if (typeof value !== "boolean") {
|
|
89
|
+
failWire(`${what}: field "${key}" must be a boolean`);
|
|
90
|
+
}
|
|
91
|
+
return value;
|
|
92
|
+
}
|
|
93
|
+
/** Return `obj[key]` when it is a boolean, `undefined` when absent; throw on any other type. */
|
|
94
|
+
export function optBool(obj, key, what) {
|
|
95
|
+
const value = obj[key];
|
|
96
|
+
if (value === undefined) {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
if (typeof value !== "boolean") {
|
|
100
|
+
failWire(`${what}: field "${key}" must be a boolean when present`);
|
|
101
|
+
}
|
|
102
|
+
return value;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Require `obj[key]` to be an integer `>= min` (and `<= max` when supplied); returns it. Reads and
|
|
106
|
+
* finite-checks the field itself (via {@link reqFiniteNumber}) so callers pass the object + key rather
|
|
107
|
+
* than a pre-extracted value — this composes with the other `req*` helpers.
|
|
108
|
+
*/
|
|
109
|
+
export function reqIntInRange(obj, key, what, min, max) {
|
|
110
|
+
const value = reqFiniteNumber(obj, key, what);
|
|
111
|
+
if (!Number.isInteger(value) || value < min || (max !== undefined && value > max)) {
|
|
112
|
+
const bound = max === undefined ? `>= ${min}` : `in ${min}..${max}`;
|
|
113
|
+
failWire(`${what}: field "${key}" must be an integer ${bound}, got ${value}`);
|
|
114
|
+
}
|
|
115
|
+
return value;
|
|
116
|
+
}
|
|
117
|
+
/** Require `obj[key]` to be an array of strings; returns it. */
|
|
118
|
+
export function reqStringArray(obj, key, what) {
|
|
119
|
+
const value = obj[key];
|
|
120
|
+
if (!Array.isArray(value) || value.some((entry) => typeof entry !== "string")) {
|
|
121
|
+
failWire(`${what}: field "${key}" must be an array of strings`);
|
|
122
|
+
}
|
|
123
|
+
return value;
|
|
124
|
+
}
|
|
125
|
+
/** Return `obj[key]` when it is an array of strings, `undefined` when absent; throw on any other type. */
|
|
126
|
+
export function optStringArray(obj, key, what) {
|
|
127
|
+
if (obj[key] === undefined) {
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
return reqStringArray(obj, key, what);
|
|
131
|
+
}
|
|
132
|
+
/** Require `obj[key]` to be one of `allowed`; returns it narrowed to the enum type. */
|
|
133
|
+
export function reqEnum(obj, key, allowed, what) {
|
|
134
|
+
const value = obj[key];
|
|
135
|
+
if (typeof value !== "string" || !allowed.includes(value)) {
|
|
136
|
+
failWire(`${what}: field "${key}" must be one of ${allowed.join(" | ")}`);
|
|
137
|
+
}
|
|
138
|
+
return value;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Assert a base64url string decodes cleanly; returns it unchanged. Used for variable-width fields —
|
|
142
|
+
* peer ids (multihash-encoded, not 32 raw bytes), signatures, and opaque application payloads.
|
|
143
|
+
*
|
|
144
|
+
* NOTE: no max-length bound here. A hostile peer can still bloat one of these variable-width fields
|
|
145
|
+
* (e.g. `participantCoord`, a signature) into a large map key in the store / rate limiter / replay
|
|
146
|
+
* guard. Their widths aren't pinned by the spec, so a ceiling would be a chosen policy value rather
|
|
147
|
+
* than a decode of the format. If a bloated one is ever seen as a map key in practice, add a
|
|
148
|
+
* `b64urlMaxLen` ceiling here. (Fixed-width hash-derived fields go through `b64urlFixedLen` instead.)
|
|
149
|
+
*/
|
|
150
|
+
export function b64urlField(value, key, what) {
|
|
151
|
+
try {
|
|
152
|
+
b64urlToBytes(value);
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
failWire(`${what}: field "${key}" is not valid base64url`);
|
|
156
|
+
}
|
|
157
|
+
return value;
|
|
158
|
+
}
|
|
159
|
+
/** Assert a base64url string decodes cleanly to exactly `len` bytes; returns it unchanged. */
|
|
160
|
+
export function b64urlFixedLen(value, key, len, what) {
|
|
161
|
+
let bytes;
|
|
162
|
+
try {
|
|
163
|
+
bytes = b64urlToBytes(value);
|
|
164
|
+
}
|
|
165
|
+
catch {
|
|
166
|
+
return failWire(`${what}: field "${key}" is not valid base64url`);
|
|
167
|
+
}
|
|
168
|
+
if (bytes.length !== len) {
|
|
169
|
+
failWire(`${what}: field "${key}" must decode to ${len} bytes, got ${bytes.length}`);
|
|
170
|
+
}
|
|
171
|
+
return value;
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=primitives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives.js","sourceRoot":"","sources":["../../../../src/cohort-topic/wire/primitives.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,uFAAuF;AACvF,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACzC,YAAY,OAAe;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAC/B,CAAC;CACD;AAED,sDAAsD;AACtD,MAAM,UAAU,QAAQ,CAAC,OAAe;IACvC,MAAM,IAAI,eAAe,CAAC,OAAO,CA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