@optimystic/db-core 0.13.5 → 0.14.1
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 +13 -0
- package/dist/src/cluster/structs.d.ts.map +1 -1
- package/dist/src/cohort-topic/addressing.d.ts +53 -0
- package/dist/src/cohort-topic/addressing.d.ts.map +1 -0
- package/dist/src/cohort-topic/addressing.js +95 -0
- package/dist/src/cohort-topic/addressing.js.map +1 -0
- package/dist/src/cohort-topic/antidos/bootstrap-evidence-envelope.d.ts +105 -0
- package/dist/src/cohort-topic/antidos/bootstrap-evidence-envelope.d.ts.map +1 -0
- package/dist/src/cohort-topic/antidos/bootstrap-evidence-envelope.js +197 -0
- package/dist/src/cohort-topic/antidos/bootstrap-evidence-envelope.js.map +1 -0
- package/dist/src/cohort-topic/antidos/bootstrap-evidence.d.ts +50 -0
- package/dist/src/cohort-topic/antidos/bootstrap-evidence.d.ts.map +1 -0
- package/dist/src/cohort-topic/antidos/bootstrap-evidence.js +62 -0
- package/dist/src/cohort-topic/antidos/bootstrap-evidence.js.map +1 -0
- package/dist/src/cohort-topic/antidos/index.d.ts +6 -0
- package/dist/src/cohort-topic/antidos/index.d.ts.map +1 -0
- package/dist/src/cohort-topic/antidos/index.js +6 -0
- package/dist/src/cohort-topic/antidos/index.js.map +1 -0
- package/dist/src/cohort-topic/antidos/rate-limiter.d.ts +95 -0
- package/dist/src/cohort-topic/antidos/rate-limiter.d.ts.map +1 -0
- package/dist/src/cohort-topic/antidos/rate-limiter.js +146 -0
- package/dist/src/cohort-topic/antidos/rate-limiter.js.map +1 -0
- package/dist/src/cohort-topic/antidos/replay-guard.d.ts +37 -0
- package/dist/src/cohort-topic/antidos/replay-guard.d.ts.map +1 -0
- package/dist/src/cohort-topic/antidos/replay-guard.js +78 -0
- package/dist/src/cohort-topic/antidos/replay-guard.js.map +1 -0
- package/dist/src/cohort-topic/antidos/topic-budget.d.ts +50 -0
- package/dist/src/cohort-topic/antidos/topic-budget.d.ts.map +1 -0
- package/dist/src/cohort-topic/antidos/topic-budget.js +95 -0
- package/dist/src/cohort-topic/antidos/topic-budget.js.map +1 -0
- package/dist/src/cohort-topic/antiflood/index.d.ts +3 -0
- package/dist/src/cohort-topic/antiflood/index.d.ts.map +1 -0
- package/dist/src/cohort-topic/antiflood/index.js +3 -0
- package/dist/src/cohort-topic/antiflood/index.js.map +1 -0
- package/dist/src/cohort-topic/antiflood/invariants.d.ts +70 -0
- package/dist/src/cohort-topic/antiflood/invariants.d.ts.map +1 -0
- package/dist/src/cohort-topic/antiflood/invariants.js +86 -0
- package/dist/src/cohort-topic/antiflood/invariants.js.map +1 -0
- package/dist/src/cohort-topic/antiflood/jitter.d.ts +65 -0
- package/dist/src/cohort-topic/antiflood/jitter.d.ts.map +1 -0
- package/dist/src/cohort-topic/antiflood/jitter.js +75 -0
- package/dist/src/cohort-topic/antiflood/jitter.js.map +1 -0
- package/dist/src/cohort-topic/coldstart.d.ts +117 -0
- package/dist/src/cohort-topic/coldstart.d.ts.map +1 -0
- package/dist/src/cohort-topic/coldstart.js +127 -0
- package/dist/src/cohort-topic/coldstart.js.map +1 -0
- package/dist/src/cohort-topic/dmax.d.ts +44 -0
- package/dist/src/cohort-topic/dmax.d.ts.map +1 -0
- package/dist/src/cohort-topic/dmax.js +70 -0
- package/dist/src/cohort-topic/dmax.js.map +1 -0
- package/dist/src/cohort-topic/gossip/bus.d.ts +85 -0
- package/dist/src/cohort-topic/gossip/bus.d.ts.map +1 -0
- package/dist/src/cohort-topic/gossip/bus.js +146 -0
- package/dist/src/cohort-topic/gossip/bus.js.map +1 -0
- package/dist/src/cohort-topic/gossip/index.d.ts +4 -0
- package/dist/src/cohort-topic/gossip/index.d.ts.map +1 -0
- package/dist/src/cohort-topic/gossip/index.js +4 -0
- package/dist/src/cohort-topic/gossip/index.js.map +1 -0
- package/dist/src/cohort-topic/gossip/records.d.ts +12 -0
- package/dist/src/cohort-topic/gossip/records.d.ts.map +1 -0
- package/dist/src/cohort-topic/gossip/records.js +41 -0
- package/dist/src/cohort-topic/gossip/records.js.map +1 -0
- package/dist/src/cohort-topic/gossip/view.d.ts +39 -0
- package/dist/src/cohort-topic/gossip/view.d.ts.map +1 -0
- package/dist/src/cohort-topic/gossip/view.js +30 -0
- package/dist/src/cohort-topic/gossip/view.js.map +1 -0
- package/dist/src/cohort-topic/index.d.ts +21 -0
- package/dist/src/cohort-topic/index.d.ts.map +1 -0
- package/dist/src/cohort-topic/index.js +21 -0
- package/dist/src/cohort-topic/index.js.map +1 -0
- package/dist/src/cohort-topic/load/barometer.d.ts +78 -0
- package/dist/src/cohort-topic/load/barometer.d.ts.map +1 -0
- package/dist/src/cohort-topic/load/barometer.js +93 -0
- package/dist/src/cohort-topic/load/barometer.js.map +1 -0
- package/dist/src/cohort-topic/load/index.d.ts +2 -0
- package/dist/src/cohort-topic/load/index.d.ts.map +1 -0
- package/dist/src/cohort-topic/load/index.js +2 -0
- package/dist/src/cohort-topic/load/index.js.map +1 -0
- package/dist/src/cohort-topic/member-engine.d.ts +134 -0
- package/dist/src/cohort-topic/member-engine.d.ts.map +1 -0
- package/dist/src/cohort-topic/member-engine.js +264 -0
- package/dist/src/cohort-topic/member-engine.js.map +1 -0
- package/dist/src/cohort-topic/membership/index.d.ts +4 -0
- package/dist/src/cohort-topic/membership/index.d.ts.map +1 -0
- package/dist/src/cohort-topic/membership/index.js +4 -0
- package/dist/src/cohort-topic/membership/index.js.map +1 -0
- package/dist/src/cohort-topic/membership/publisher.d.ts +82 -0
- package/dist/src/cohort-topic/membership/publisher.d.ts.map +1 -0
- package/dist/src/cohort-topic/membership/publisher.js +107 -0
- package/dist/src/cohort-topic/membership/publisher.js.map +1 -0
- package/dist/src/cohort-topic/membership/source.d.ts +31 -0
- package/dist/src/cohort-topic/membership/source.d.ts.map +1 -0
- package/dist/src/cohort-topic/membership/source.js +32 -0
- package/dist/src/cohort-topic/membership/source.js.map +1 -0
- package/dist/src/cohort-topic/membership/verifier.d.ts +96 -0
- package/dist/src/cohort-topic/membership/verifier.d.ts.map +1 -0
- package/dist/src/cohort-topic/membership/verifier.js +250 -0
- package/dist/src/cohort-topic/membership/verifier.js.map +1 -0
- package/dist/src/cohort-topic/ports.d.ts +149 -0
- package/dist/src/cohort-topic/ports.d.ts.map +1 -0
- package/dist/src/cohort-topic/ports.js +25 -0
- package/dist/src/cohort-topic/ports.js.map +1 -0
- package/dist/src/cohort-topic/promotion.d.ts +135 -0
- package/dist/src/cohort-topic/promotion.d.ts.map +1 -0
- package/dist/src/cohort-topic/promotion.js +269 -0
- package/dist/src/cohort-topic/promotion.js.map +1 -0
- package/dist/src/cohort-topic/registration/bytes.d.ts +16 -0
- package/dist/src/cohort-topic/registration/bytes.d.ts.map +1 -0
- package/dist/src/cohort-topic/registration/bytes.js +32 -0
- package/dist/src/cohort-topic/registration/bytes.js.map +1 -0
- package/dist/src/cohort-topic/registration/handoff.d.ts +69 -0
- package/dist/src/cohort-topic/registration/handoff.d.ts.map +1 -0
- package/dist/src/cohort-topic/registration/handoff.js +98 -0
- package/dist/src/cohort-topic/registration/handoff.js.map +1 -0
- package/dist/src/cohort-topic/registration/index.d.ts +7 -0
- package/dist/src/cohort-topic/registration/index.d.ts.map +1 -0
- package/dist/src/cohort-topic/registration/index.js +7 -0
- package/dist/src/cohort-topic/registration/index.js.map +1 -0
- package/dist/src/cohort-topic/registration/renewal.d.ts +115 -0
- package/dist/src/cohort-topic/registration/renewal.d.ts.map +1 -0
- package/dist/src/cohort-topic/registration/renewal.js +306 -0
- package/dist/src/cohort-topic/registration/renewal.js.map +1 -0
- package/dist/src/cohort-topic/registration/sharding.d.ts +31 -0
- package/dist/src/cohort-topic/registration/sharding.d.ts.map +1 -0
- package/dist/src/cohort-topic/registration/sharding.js +48 -0
- package/dist/src/cohort-topic/registration/sharding.js.map +1 -0
- package/dist/src/cohort-topic/registration/store.d.ts +13 -0
- package/dist/src/cohort-topic/registration/store.d.ts.map +1 -0
- package/dist/src/cohort-topic/registration/store.js +72 -0
- package/dist/src/cohort-topic/registration/store.js.map +1 -0
- package/dist/src/cohort-topic/registration/types.d.ts +71 -0
- package/dist/src/cohort-topic/registration/types.d.ts.map +1 -0
- package/dist/src/cohort-topic/registration/types.js +27 -0
- package/dist/src/cohort-topic/registration/types.js.map +1 -0
- package/dist/src/cohort-topic/ring-hash.d.ts +27 -0
- package/dist/src/cohort-topic/ring-hash.d.ts.map +1 -0
- package/dist/src/cohort-topic/ring-hash.js +45 -0
- package/dist/src/cohort-topic/ring-hash.js.map +1 -0
- package/dist/src/cohort-topic/service.d.ts +157 -0
- package/dist/src/cohort-topic/service.d.ts.map +1 -0
- package/dist/src/cohort-topic/service.js +237 -0
- package/dist/src/cohort-topic/service.js.map +1 -0
- package/dist/src/cohort-topic/sig/index.d.ts +3 -0
- package/dist/src/cohort-topic/sig/index.d.ts.map +1 -0
- package/dist/src/cohort-topic/sig/index.js +3 -0
- package/dist/src/cohort-topic/sig/index.js.map +1 -0
- package/dist/src/cohort-topic/sig/payloads.d.ts +25 -0
- package/dist/src/cohort-topic/sig/payloads.d.ts.map +1 -0
- package/dist/src/cohort-topic/sig/payloads.js +25 -0
- package/dist/src/cohort-topic/sig/payloads.js.map +1 -0
- package/dist/src/cohort-topic/sig/threshold.d.ts +33 -0
- package/dist/src/cohort-topic/sig/threshold.d.ts.map +1 -0
- package/dist/src/cohort-topic/sig/threshold.js +51 -0
- package/dist/src/cohort-topic/sig/threshold.js.map +1 -0
- package/dist/src/cohort-topic/tiers.d.ts +58 -0
- package/dist/src/cohort-topic/tiers.d.ts.map +1 -0
- package/dist/src/cohort-topic/tiers.js +49 -0
- package/dist/src/cohort-topic/tiers.js.map +1 -0
- package/dist/src/cohort-topic/traffic.d.ts +90 -0
- package/dist/src/cohort-topic/traffic.d.ts.map +1 -0
- package/dist/src/cohort-topic/traffic.js +146 -0
- package/dist/src/cohort-topic/traffic.js.map +1 -0
- package/dist/src/cohort-topic/walk.d.ts +123 -0
- package/dist/src/cohort-topic/walk.d.ts.map +1 -0
- package/dist/src/cohort-topic/walk.js +150 -0
- package/dist/src/cohort-topic/walk.js.map +1 -0
- package/dist/src/cohort-topic/willingness.d.ts +123 -0
- package/dist/src/cohort-topic/willingness.d.ts.map +1 -0
- package/dist/src/cohort-topic/willingness.js +143 -0
- package/dist/src/cohort-topic/willingness.js.map +1 -0
- package/dist/src/cohort-topic/wire/codec.d.ts +42 -0
- package/dist/src/cohort-topic/wire/codec.d.ts.map +1 -0
- package/dist/src/cohort-topic/wire/codec.js +163 -0
- package/dist/src/cohort-topic/wire/codec.js.map +1 -0
- package/dist/src/cohort-topic/wire/index.d.ts +6 -0
- package/dist/src/cohort-topic/wire/index.d.ts.map +1 -0
- package/dist/src/cohort-topic/wire/index.js +6 -0
- package/dist/src/cohort-topic/wire/index.js.map +1 -0
- package/dist/src/cohort-topic/wire/payloads.d.ts +38 -0
- package/dist/src/cohort-topic/wire/payloads.d.ts.map +1 -0
- package/dist/src/cohort-topic/wire/payloads.js +102 -0
- package/dist/src/cohort-topic/wire/payloads.js.map +1 -0
- package/dist/src/cohort-topic/wire/types.d.ts +304 -0
- package/dist/src/cohort-topic/wire/types.d.ts.map +1 -0
- package/dist/src/cohort-topic/wire/types.js +16 -0
- package/dist/src/cohort-topic/wire/types.js.map +1 -0
- package/dist/src/cohort-topic/wire/validate.d.ts +25 -0
- package/dist/src/cohort-topic/wire/validate.d.ts.map +1 -0
- package/dist/src/cohort-topic/wire/validate.js +427 -0
- package/dist/src/cohort-topic/wire/validate.js.map +1 -0
- package/dist/src/collection/collection.d.ts +58 -1
- package/dist/src/collection/collection.d.ts.map +1 -1
- package/dist/src/collection/collection.js +76 -0
- package/dist/src/collection/collection.js.map +1 -1
- package/dist/src/collections/tree/tree.d.ts +58 -2
- package/dist/src/collections/tree/tree.d.ts.map +1 -1
- package/dist/src/collections/tree/tree.js +59 -2
- package/dist/src/collections/tree/tree.js.map +1 -1
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/log/log.d.ts +42 -4
- package/dist/src/log/log.d.ts.map +1 -1
- package/dist/src/log/log.js +71 -3
- package/dist/src/log/log.js.map +1 -1
- package/dist/src/log/struct.d.ts +122 -2
- package/dist/src/log/struct.d.ts.map +1 -1
- package/dist/src/log/struct.js.map +1 -1
- package/dist/src/matchmaking/capability-filter.d.ts +24 -0
- package/dist/src/matchmaking/capability-filter.d.ts.map +1 -0
- package/dist/src/matchmaking/capability-filter.js +37 -0
- package/dist/src/matchmaking/capability-filter.js.map +1 -0
- package/dist/src/matchmaking/config.d.ts +77 -0
- package/dist/src/matchmaking/config.d.ts.map +1 -0
- package/dist/src/matchmaking/config.js +69 -0
- package/dist/src/matchmaking/config.js.map +1 -0
- package/dist/src/matchmaking/index.d.ts +21 -0
- package/dist/src/matchmaking/index.d.ts.map +1 -0
- package/dist/src/matchmaking/index.js +21 -0
- package/dist/src/matchmaking/index.js.map +1 -0
- package/dist/src/matchmaking/multi-cohort-seeker.d.ts +133 -0
- package/dist/src/matchmaking/multi-cohort-seeker.d.ts.map +1 -0
- package/dist/src/matchmaking/multi-cohort-seeker.js +142 -0
- package/dist/src/matchmaking/multi-cohort-seeker.js.map +1 -0
- package/dist/src/matchmaking/provider.d.ts +70 -0
- package/dist/src/matchmaking/provider.d.ts.map +1 -0
- package/dist/src/matchmaking/provider.js +93 -0
- package/dist/src/matchmaking/provider.js.map +1 -0
- package/dist/src/matchmaking/query-eval.d.ts +53 -0
- package/dist/src/matchmaking/query-eval.d.ts.map +1 -0
- package/dist/src/matchmaking/query-eval.js +69 -0
- package/dist/src/matchmaking/query-eval.js.map +1 -0
- package/dist/src/matchmaking/seeker-walk.d.ts +95 -0
- package/dist/src/matchmaking/seeker-walk.d.ts.map +1 -0
- package/dist/src/matchmaking/seeker-walk.js +75 -0
- package/dist/src/matchmaking/seeker-walk.js.map +1 -0
- package/dist/src/matchmaking/seeker.d.ts +51 -0
- package/dist/src/matchmaking/seeker.d.ts.map +1 -0
- package/dist/src/matchmaking/seeker.js +62 -0
- package/dist/src/matchmaking/seeker.js.map +1 -0
- package/dist/src/matchmaking/topic-anchor.d.ts +54 -0
- package/dist/src/matchmaking/topic-anchor.d.ts.map +1 -0
- package/dist/src/matchmaking/topic-anchor.js +67 -0
- package/dist/src/matchmaking/topic-anchor.js.map +1 -0
- package/dist/src/matchmaking/voting-quorum.d.ts +233 -0
- package/dist/src/matchmaking/voting-quorum.d.ts.map +1 -0
- package/dist/src/matchmaking/voting-quorum.js +238 -0
- package/dist/src/matchmaking/voting-quorum.js.map +1 -0
- package/dist/src/matchmaking/wire.d.ts +259 -0
- package/dist/src/matchmaking/wire.d.ts.map +1 -0
- package/dist/src/matchmaking/wire.js +484 -0
- package/dist/src/matchmaking/wire.js.map +1 -0
- package/dist/src/network/i-repo.d.ts +9 -0
- package/dist/src/network/i-repo.d.ts.map +1 -1
- package/dist/src/network/repo-protocol.d.ts +3 -1
- package/dist/src/network/repo-protocol.d.ts.map +1 -1
- package/dist/src/network/struct.d.ts +23 -1
- package/dist/src/network/struct.d.ts.map +1 -1
- package/dist/src/reactivity/backfill.d.ts +118 -0
- package/dist/src/reactivity/backfill.d.ts.map +1 -0
- package/dist/src/reactivity/backfill.js +137 -0
- package/dist/src/reactivity/backfill.js.map +1 -0
- package/dist/src/reactivity/backpressure.d.ts +99 -0
- package/dist/src/reactivity/backpressure.d.ts.map +1 -0
- package/dist/src/reactivity/backpressure.js +153 -0
- package/dist/src/reactivity/backpressure.js.map +1 -0
- package/dist/src/reactivity/checkpoint.d.ts +165 -0
- package/dist/src/reactivity/checkpoint.d.ts.map +1 -0
- package/dist/src/reactivity/checkpoint.js +232 -0
- package/dist/src/reactivity/checkpoint.js.map +1 -0
- package/dist/src/reactivity/config.d.ts +131 -0
- package/dist/src/reactivity/config.d.ts.map +1 -0
- package/dist/src/reactivity/config.js +135 -0
- package/dist/src/reactivity/config.js.map +1 -0
- package/dist/src/reactivity/dedupe.d.ts +51 -0
- package/dist/src/reactivity/dedupe.d.ts.map +1 -0
- package/dist/src/reactivity/dedupe.js +90 -0
- package/dist/src/reactivity/dedupe.js.map +1 -0
- package/dist/src/reactivity/forwarder.d.ts +50 -0
- package/dist/src/reactivity/forwarder.d.ts.map +1 -0
- package/dist/src/reactivity/forwarder.js +52 -0
- package/dist/src/reactivity/forwarder.js.map +1 -0
- package/dist/src/reactivity/index.d.ts +34 -0
- package/dist/src/reactivity/index.d.ts.map +1 -0
- package/dist/src/reactivity/index.js +34 -0
- package/dist/src/reactivity/index.js.map +1 -0
- package/dist/src/reactivity/notification.d.ts +72 -0
- package/dist/src/reactivity/notification.d.ts.map +1 -0
- package/dist/src/reactivity/notification.js +92 -0
- package/dist/src/reactivity/notification.js.map +1 -0
- package/dist/src/reactivity/policy.d.ts +59 -0
- package/dist/src/reactivity/policy.d.ts.map +1 -0
- package/dist/src/reactivity/policy.js +64 -0
- package/dist/src/reactivity/policy.js.map +1 -0
- package/dist/src/reactivity/push-state.d.ts +140 -0
- package/dist/src/reactivity/push-state.d.ts.map +1 -0
- package/dist/src/reactivity/push-state.js +270 -0
- package/dist/src/reactivity/push-state.js.map +1 -0
- package/dist/src/reactivity/recover.d.ts +75 -0
- package/dist/src/reactivity/recover.d.ts.map +1 -0
- package/dist/src/reactivity/recover.js +105 -0
- package/dist/src/reactivity/recover.js.map +1 -0
- package/dist/src/reactivity/replay-buffer.d.ts +57 -0
- package/dist/src/reactivity/replay-buffer.d.ts.map +1 -0
- package/dist/src/reactivity/replay-buffer.js +88 -0
- package/dist/src/reactivity/replay-buffer.js.map +1 -0
- package/dist/src/reactivity/resume.d.ts +214 -0
- package/dist/src/reactivity/resume.d.ts.map +1 -0
- package/dist/src/reactivity/resume.js +358 -0
- package/dist/src/reactivity/resume.js.map +1 -0
- package/dist/src/reactivity/rotation.d.ts +283 -0
- package/dist/src/reactivity/rotation.d.ts.map +1 -0
- package/dist/src/reactivity/rotation.js +265 -0
- package/dist/src/reactivity/rotation.js.map +1 -0
- package/dist/src/reactivity/subscriber.d.ts +66 -0
- package/dist/src/reactivity/subscriber.d.ts.map +1 -0
- package/dist/src/reactivity/subscriber.js +75 -0
- package/dist/src/reactivity/subscriber.js.map +1 -0
- package/dist/src/reactivity/subscription.d.ts +52 -0
- package/dist/src/reactivity/subscription.d.ts.map +1 -0
- package/dist/src/reactivity/subscription.js +28 -0
- package/dist/src/reactivity/subscription.js.map +1 -0
- package/dist/src/reactivity/topic-anchor.d.ts +46 -0
- package/dist/src/reactivity/topic-anchor.d.ts.map +1 -0
- package/dist/src/reactivity/topic-anchor.js +61 -0
- package/dist/src/reactivity/topic-anchor.js.map +1 -0
- package/dist/src/reactivity/verify.d.ts +41 -0
- package/dist/src/reactivity/verify.d.ts.map +1 -0
- package/dist/src/reactivity/verify.js +48 -0
- package/dist/src/reactivity/verify.js.map +1 -0
- package/dist/src/reactivity/wire-validate.d.ts +28 -0
- package/dist/src/reactivity/wire-validate.d.ts.map +1 -0
- package/dist/src/reactivity/wire-validate.js +79 -0
- package/dist/src/reactivity/wire-validate.js.map +1 -0
- package/dist/src/reactivity/wire.d.ts +102 -0
- package/dist/src/reactivity/wire.d.ts.map +1 -0
- package/dist/src/reactivity/wire.js +129 -0
- package/dist/src/reactivity/wire.js.map +1 -0
- package/dist/src/transaction/coordinator.d.ts +9 -5
- package/dist/src/transaction/coordinator.d.ts.map +1 -1
- package/dist/src/transaction/coordinator.js +48 -25
- package/dist/src/transaction/coordinator.js.map +1 -1
- package/dist/src/transactor/change-notifier.d.ts +74 -0
- package/dist/src/transactor/change-notifier.d.ts.map +1 -0
- package/dist/src/transactor/change-notifier.js +4 -0
- package/dist/src/transactor/change-notifier.js.map +1 -0
- 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 +34 -2
- package/dist/src/transactor/network-transactor.d.ts.map +1 -1
- package/dist/src/transactor/network-transactor.js +113 -13
- package/dist/src/transactor/network-transactor.js.map +1 -1
- package/package.json +2 -2
- package/src/cluster/structs.ts +13 -0
- package/src/cohort-topic/addressing.ts +112 -0
- package/src/cohort-topic/antidos/bootstrap-evidence-envelope.ts +253 -0
- package/src/cohort-topic/antidos/bootstrap-evidence.ts +94 -0
- package/src/cohort-topic/antidos/index.ts +5 -0
- package/src/cohort-topic/antidos/rate-limiter.ts +210 -0
- package/src/cohort-topic/antidos/replay-guard.ts +109 -0
- package/src/cohort-topic/antidos/topic-budget.ts +145 -0
- package/src/cohort-topic/antiflood/index.ts +2 -0
- package/src/cohort-topic/antiflood/invariants.ts +108 -0
- package/src/cohort-topic/antiflood/jitter.ts +117 -0
- package/src/cohort-topic/coldstart.ts +204 -0
- package/src/cohort-topic/dmax.ts +88 -0
- package/src/cohort-topic/gossip/bus.ts +217 -0
- package/src/cohort-topic/gossip/index.ts +3 -0
- package/src/cohort-topic/gossip/records.ts +45 -0
- package/src/cohort-topic/gossip/view.ts +66 -0
- package/src/cohort-topic/index.ts +20 -0
- package/src/cohort-topic/load/barometer.ts +134 -0
- package/src/cohort-topic/load/index.ts +1 -0
- package/src/cohort-topic/member-engine.ts +409 -0
- package/src/cohort-topic/membership/index.ts +3 -0
- package/src/cohort-topic/membership/publisher.ts +171 -0
- package/src/cohort-topic/membership/source.ts +41 -0
- package/src/cohort-topic/membership/verifier.ts +345 -0
- package/src/cohort-topic/ports.ts +157 -0
- package/src/cohort-topic/promotion.ts +384 -0
- package/src/cohort-topic/registration/bytes.ts +37 -0
- package/src/cohort-topic/registration/handoff.ts +154 -0
- package/src/cohort-topic/registration/index.ts +6 -0
- package/src/cohort-topic/registration/renewal.ts +423 -0
- package/src/cohort-topic/registration/sharding.ts +61 -0
- package/src/cohort-topic/registration/store.ts +81 -0
- package/src/cohort-topic/registration/types.ts +76 -0
- package/src/cohort-topic/ring-hash.ts +50 -0
- package/src/cohort-topic/service.ts +390 -0
- package/src/cohort-topic/sig/index.ts +2 -0
- package/src/cohort-topic/sig/payloads.ts +39 -0
- package/src/cohort-topic/sig/threshold.ts +64 -0
- package/src/cohort-topic/tiers.ts +74 -0
- package/src/cohort-topic/traffic.ts +211 -0
- package/src/cohort-topic/walk.ts +255 -0
- package/src/cohort-topic/willingness.ts +237 -0
- package/src/cohort-topic/wire/codec.ts +204 -0
- package/src/cohort-topic/wire/index.ts +16 -0
- package/src/cohort-topic/wire/payloads.ts +117 -0
- package/src/cohort-topic/wire/types.ts +343 -0
- package/src/cohort-topic/wire/validate.ts +478 -0
- package/src/collection/collection.ts +93 -1
- package/src/collections/tree/tree.ts +84 -3
- package/src/index.ts +3 -0
- package/src/log/log.ts +86 -7
- package/src/log/struct.ts +126 -2
- package/src/matchmaking/capability-filter.ts +45 -0
- package/src/matchmaking/config.ts +98 -0
- package/src/matchmaking/index.ts +21 -0
- package/src/matchmaking/multi-cohort-seeker.ts +234 -0
- package/src/matchmaking/provider.ts +123 -0
- package/src/matchmaking/query-eval.ts +105 -0
- package/src/matchmaking/seeker-walk.ts +127 -0
- package/src/matchmaking/seeker.ts +86 -0
- package/src/matchmaking/topic-anchor.ts +90 -0
- package/src/matchmaking/voting-quorum.ts +394 -0
- package/src/matchmaking/wire.ts +680 -0
- package/src/network/i-repo.ts +9 -0
- package/src/network/repo-protocol.ts +3 -2
- package/src/network/struct.ts +24 -1
- package/src/reactivity/backfill.ts +220 -0
- package/src/reactivity/backpressure.ts +191 -0
- package/src/reactivity/checkpoint.ts +308 -0
- package/src/reactivity/config.ts +172 -0
- package/src/reactivity/dedupe.ts +132 -0
- package/src/reactivity/forwarder.ts +87 -0
- package/src/reactivity/index.ts +34 -0
- package/src/reactivity/notification.ts +123 -0
- package/src/reactivity/policy.ts +79 -0
- package/src/reactivity/push-state.ts +343 -0
- package/src/reactivity/recover.ts +153 -0
- package/src/reactivity/replay-buffer.ts +141 -0
- package/src/reactivity/resume.ts +549 -0
- package/src/reactivity/rotation.ts +415 -0
- package/src/reactivity/subscriber.ts +132 -0
- package/src/reactivity/subscription.ts +66 -0
- package/src/reactivity/topic-anchor.ts +71 -0
- package/src/reactivity/verify.ts +73 -0
- package/src/reactivity/wire-validate.ts +87 -0
- package/src/reactivity/wire.ts +224 -0
- package/src/transaction/coordinator.ts +53 -27
- package/src/transactor/change-notifier.ts +80 -0
- package/src/transactor/index.ts +1 -0
- package/src/transactor/network-transactor.ts +133 -15
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cohort-topic substrate — canonical participant-signature payloads.
|
|
3
|
+
*
|
|
4
|
+
* A participant peer-key-signs its outbound `RegisterV1` / `RenewV1` bodies (db-p2p supplies the
|
|
5
|
+
* libp2p peer key); a cohort member recomputes the identical byte image to verify that signature
|
|
6
|
+
* before admitting a register (anti-DoS) or honoring a crash-failover `reattach` attestation (so a
|
|
7
|
+
* stray/MITM'd ping cannot usurp a live primary — `docs/cohort-topic.md` §TTL and renewal).
|
|
8
|
+
*
|
|
9
|
+
* Signer and verifier must agree byte-for-byte. Exactly like {@link import("../sig/payloads.js")}
|
|
10
|
+
* for the threshold-signed notices, determinism comes from encoding an explicitly-ordered JSON
|
|
11
|
+
* array (array order is stable, unlike object key order) as UTF-8 — never the `signature` envelope.
|
|
12
|
+
* Optional fields are normalized to a fixed placeholder (`bootstrap`→`false`, `probe`→`false`,
|
|
13
|
+
* `appPayload`→`null`, `bootstrapEvidence`→`null` with an empty string treated as absent,
|
|
14
|
+
* `reattach`→`false`, `withdraw`→`false`) so an absent optional and a present-but-default optional can
|
|
15
|
+
* never disagree across the wire round-trip.
|
|
16
|
+
*/
|
|
17
|
+
const utf8 = new TextEncoder();
|
|
18
|
+
/** Normalize the optional bootstrap-evidence slot: absent and empty-string both map to `null`. */
|
|
19
|
+
function normalizeEvidence(bootstrapEvidence) {
|
|
20
|
+
return bootstrapEvidence === undefined || bootstrapEvidence === "" ? null : bootstrapEvidence;
|
|
21
|
+
}
|
|
22
|
+
/** Canonical signed byte image of a `RegisterV1` body (every field except `signature`). */
|
|
23
|
+
export function registerSigningPayload(body) {
|
|
24
|
+
return utf8.encode(JSON.stringify([
|
|
25
|
+
"RegisterV1",
|
|
26
|
+
body.v,
|
|
27
|
+
body.topicId,
|
|
28
|
+
body.tier,
|
|
29
|
+
body.treeTier,
|
|
30
|
+
body.participantCoord,
|
|
31
|
+
body.ttl,
|
|
32
|
+
body.bootstrap ?? false,
|
|
33
|
+
body.appPayload ?? null,
|
|
34
|
+
normalizeEvidence(body.bootstrapEvidence),
|
|
35
|
+
body.timestamp,
|
|
36
|
+
body.correlationId,
|
|
37
|
+
// A read-only probe signs `probe: true`; a normal register signs `false`. Both sides recompute
|
|
38
|
+
// this image identically, so a probe and a register over the same fields produce distinct signatures.
|
|
39
|
+
body.probe ?? false,
|
|
40
|
+
]));
|
|
41
|
+
}
|
|
42
|
+
/** Canonical signed byte image of a `RenewV1` body (every field except `signature`). */
|
|
43
|
+
export function renewSigningPayload(body) {
|
|
44
|
+
return utf8.encode(JSON.stringify([
|
|
45
|
+
"RenewV1",
|
|
46
|
+
body.v,
|
|
47
|
+
body.topicId,
|
|
48
|
+
body.participantId,
|
|
49
|
+
body.correlationId,
|
|
50
|
+
body.timestamp,
|
|
51
|
+
body.reattach ?? false,
|
|
52
|
+
// A withdraw tombstone signs `withdraw: true`, a ping/reattach signs `false`. Strictly appended
|
|
53
|
+
// (array length 7→8) so the reattach-vs-ping distinction is preserved and a third party cannot
|
|
54
|
+
// evict someone else's registration. Signer (participant) + verifier (db-p2p) move together; no
|
|
55
|
+
// signatures are persisted, so there is no cross-version concern.
|
|
56
|
+
body.withdraw ?? false,
|
|
57
|
+
]));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Canonical signed byte image of a `CohortGossipV1` (every field except `signature`). Intra-cohort
|
|
61
|
+
* gossip is peer-key-signed by the originating member so a receiver can drop a frame whose `fromMember`
|
|
62
|
+
* signature does not verify or that comes from a non-cohort member (it can never spoof willingness/load
|
|
63
|
+
* or replicate forged records). Like the other payload helpers, determinism comes from an
|
|
64
|
+
* explicitly-ordered array — nested records/summaries/evictions are emitted as fixed ordered tuples so
|
|
65
|
+
* 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 `null`.
|
|
67
|
+
*/
|
|
68
|
+
export function cohortGossipSigningPayload(g) {
|
|
69
|
+
return utf8.encode(JSON.stringify([
|
|
70
|
+
"CohortGossipV1",
|
|
71
|
+
g.v,
|
|
72
|
+
g.fromMember,
|
|
73
|
+
g.coord,
|
|
74
|
+
g.cohortEpoch,
|
|
75
|
+
g.willingnessBits,
|
|
76
|
+
g.loadBuckets,
|
|
77
|
+
g.windowSeconds,
|
|
78
|
+
g.topicSummaries.map((s) => [
|
|
79
|
+
s.topicId,
|
|
80
|
+
s.tier,
|
|
81
|
+
s.directParticipants,
|
|
82
|
+
s.arrivalsPerMin,
|
|
83
|
+
s.queriesPerMin,
|
|
84
|
+
s.promoted,
|
|
85
|
+
s.childCohortCount,
|
|
86
|
+
]),
|
|
87
|
+
(g.records ?? []).map((r) => [
|
|
88
|
+
r.topicId,
|
|
89
|
+
r.participantId,
|
|
90
|
+
r.tier,
|
|
91
|
+
r.primary,
|
|
92
|
+
r.backups,
|
|
93
|
+
r.attachedAt,
|
|
94
|
+
r.lastPing,
|
|
95
|
+
r.ttl,
|
|
96
|
+
r.appState ?? null,
|
|
97
|
+
]),
|
|
98
|
+
(g.evicted ?? []).map((e) => [e.topicId, e.participantId]),
|
|
99
|
+
g.timestamp,
|
|
100
|
+
]));
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=payloads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payloads.js","sourceRoot":"","sources":["../../../../src/cohort-topic/wire/payloads.ts"],"names":[],"mappings":"AAAA;;;;;;;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BAA0B,CAAC,CAAuB;IACjE,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;QACjC,gBAAgB;QAChB,CAAC,CAAC,CAAC;QACH,CAAC,CAAC,UAAU;QACZ,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,WAAW;QACb,CAAC,CAAC,eAAe;QACjB,CAAC,CAAC,WAAW;QACb,CAAC,CAAC,aAAa;QACf,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YAC3B,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,kBAAkB;YACpB,CAAC,CAAC,cAAc;YAChB,CAAC,CAAC,aAAa;YACf,CAAC,CAAC,QAAQ;YACV,CAAC,CAAC,gBAAgB;SAClB,CAAC;QACF,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YAC5B,CAAC,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,CAAC,CAAC;QAC1D,CAAC,CAAC,SAAS;KACX,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cohort-topic substrate — V1 wire message types.
|
|
3
|
+
*
|
|
4
|
+
* Transcribed from `docs/cohort-topic.md` §Wire formats. These interfaces are the canonical
|
|
5
|
+
* on-the-wire shapes for the cohort-topic RPC surface; the codec in `./codec.ts` serializes
|
|
6
|
+
* them as length-prefixed UTF-8 JSON.
|
|
7
|
+
*
|
|
8
|
+
* Conventions (mandated by §Wire formats):
|
|
9
|
+
* - Every byte-typed field is carried as a base64url string (no padding) — never raw bytes.
|
|
10
|
+
* - Every timestamp is unix milliseconds.
|
|
11
|
+
* - `appPayload` is an opaque base64url string carrying application-defined bytes. The wire layer
|
|
12
|
+
* never interprets it; reactivity / matchmaking define their own structures and serialize them
|
|
13
|
+
* into this slot.
|
|
14
|
+
*/
|
|
15
|
+
/** Registration request. Walks toward the root via FRET `RouteAndMaybeAct`. */
|
|
16
|
+
export interface RegisterV1 {
|
|
17
|
+
v: 1;
|
|
18
|
+
/** Topic id, 32 bytes, base64url. */
|
|
19
|
+
topicId: string;
|
|
20
|
+
/** Tier, 0..3. */
|
|
21
|
+
tier: number;
|
|
22
|
+
/** Current walk position `d`. */
|
|
23
|
+
treeTier: number;
|
|
24
|
+
/** Participant's ring coord, 32 bytes, base64url. */
|
|
25
|
+
participantCoord: string;
|
|
26
|
+
/** Registration TTL in ms (default 90000; Edge 60000). */
|
|
27
|
+
ttl: number;
|
|
28
|
+
/** True on a root cold-start request. */
|
|
29
|
+
bootstrap?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Read-only lookup probe: classify + return the cohort snapshot without admitting (no record, no
|
|
32
|
+
* arrival, no promotion trigger, no topic-budget touch, and **never** a cold-start instantiation /
|
|
33
|
+
* `bootstrap`). A probe walks to the responsible cohort exactly as a register does and resolves the
|
|
34
|
+
* same {@link RegisterReplyV1} (`no_state` cold, `promoted` redirected, `accepted` snapshot served),
|
|
35
|
+
* but the terminal member action is the read-only {@link RegisterReplyV1} classify rather than an
|
|
36
|
+
* admission. Drives {@link import("../service.js").CohortTopicService.lookup}. Mutually exclusive with
|
|
37
|
+
* `bootstrap` (the walk never sets `bootstrap` on a probe).
|
|
38
|
+
*/
|
|
39
|
+
probe?: boolean;
|
|
40
|
+
/** Opaque application-defined bytes, base64url. */
|
|
41
|
+
appPayload?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Cold-start bootstrap-evidence envelope, base64url (a `BootstrapEvidenceEnvelopeV1` — see
|
|
44
|
+
* `../antidos/bootstrap-evidence-envelope.js`). Present only on a `bootstrap: true` root register;
|
|
45
|
+
* carries the tier-dependent proof a cold root demands (proof-of-work / reputation endorsement /
|
|
46
|
+
* signed parent reference — §Anti-DoS). This is a **dedicated** field, NOT `appPayload`: the cohort
|
|
47
|
+
* copies `appPayload` verbatim into the registration's `appState` and replicates it cluster-wide,
|
|
48
|
+
* whereas the bootstrap evidence is parsed-and-checked by the substrate, **covered by `signature`**
|
|
49
|
+
* (so a MITM cannot strip or swap it), and never stored as appState. Empty string is treated as
|
|
50
|
+
* absent (it normalizes to the same signed-image placeholder as an absent field).
|
|
51
|
+
*/
|
|
52
|
+
bootstrapEvidence?: string;
|
|
53
|
+
/** Unix ms. */
|
|
54
|
+
timestamp: number;
|
|
55
|
+
/** 16 random bytes, base64url. */
|
|
56
|
+
correlationId: string;
|
|
57
|
+
/** Participant peer-key signature, base64url. */
|
|
58
|
+
signature: string;
|
|
59
|
+
}
|
|
60
|
+
export type RegisterResult = "accepted" | "no_state" | "promoted" | "unwilling_member" | "unwilling_cohort";
|
|
61
|
+
/** Registration reply. Field presence is keyed by {@link RegisterResult}. */
|
|
62
|
+
export interface RegisterReplyV1 {
|
|
63
|
+
v: 1;
|
|
64
|
+
result: RegisterResult;
|
|
65
|
+
/** PeerId. */
|
|
66
|
+
primary?: string;
|
|
67
|
+
/** PeerIds, 1-2. */
|
|
68
|
+
backups?: string[];
|
|
69
|
+
/** 32 bytes, base64url. */
|
|
70
|
+
cohortEpoch?: string;
|
|
71
|
+
/** Full cohort PeerIds, for client cache. */
|
|
72
|
+
cohortMembers?: string[];
|
|
73
|
+
/** Present on `accepted` and `promoted` only. */
|
|
74
|
+
topicTraffic?: TopicTrafficV1;
|
|
75
|
+
/** `d+1` typically; may leap. */
|
|
76
|
+
targetTier?: number;
|
|
77
|
+
/** PeerIds within the same cohort to try. */
|
|
78
|
+
candidateMembers?: string[];
|
|
79
|
+
retryAfterMs?: number;
|
|
80
|
+
/** Human-readable, optional. */
|
|
81
|
+
reason?: string;
|
|
82
|
+
}
|
|
83
|
+
/** Coarse traffic barometer attached to accepted/promoted replies. */
|
|
84
|
+
export interface TopicTrafficV1 {
|
|
85
|
+
windowSeconds: number;
|
|
86
|
+
arrivalsPerMin: number;
|
|
87
|
+
queriesPerMin: number;
|
|
88
|
+
directParticipants: number;
|
|
89
|
+
childCohortCount: number;
|
|
90
|
+
}
|
|
91
|
+
/** Registration renewal (ping). */
|
|
92
|
+
export interface RenewV1 {
|
|
93
|
+
v: 1;
|
|
94
|
+
topicId: string;
|
|
95
|
+
/** PeerId. */
|
|
96
|
+
participantId: string;
|
|
97
|
+
/** Matches the original {@link RegisterV1}. */
|
|
98
|
+
correlationId: string;
|
|
99
|
+
timestamp: number;
|
|
100
|
+
/**
|
|
101
|
+
* True on a crash-failover re-attach — the participant attests it could not reach its primary and
|
|
102
|
+
* asks the contacted backup to promote itself. Absent/false on a normal ping. Signed (part of the
|
|
103
|
+
* renew body) so a member can trust the attestation and a MITM cannot flip a ping into a promotion.
|
|
104
|
+
*/
|
|
105
|
+
reattach?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* True on a withdraw tombstone — the participant attests it is leaving; the holder evicts the
|
|
108
|
+
* record immediately and gossips the eviction (freeing the cohort slot rather than holding it for a
|
|
109
|
+
* full TTL). Absent/false on a ping or reattach. Signed (part of the renew body) so a third party
|
|
110
|
+
* cannot evict someone else's registration. Mutually exclusive with {@link reattach} (the participant
|
|
111
|
+
* never sets both; on a malformed frame that sets both, the cohort side honors `withdraw`).
|
|
112
|
+
*/
|
|
113
|
+
withdraw?: boolean;
|
|
114
|
+
signature: string;
|
|
115
|
+
}
|
|
116
|
+
/** Renewal reply. */
|
|
117
|
+
export interface RenewReplyV1 {
|
|
118
|
+
v: 1;
|
|
119
|
+
/**
|
|
120
|
+
* `withdrawn` answers a {@link RenewV1.withdraw} tombstone the holder accepted (record evicted +
|
|
121
|
+
* gossiped); the participant ignores it (it is leaving), but the distinct result lets the cohort
|
|
122
|
+
* side branch unambiguously (re-touch the topic budget down, never count an arrival).
|
|
123
|
+
*/
|
|
124
|
+
result: "ok" | "unknown_registration" | "primary_moved" | "withdrawn";
|
|
125
|
+
newPrimary?: string;
|
|
126
|
+
newBackups?: string[];
|
|
127
|
+
cohortEpoch?: string;
|
|
128
|
+
}
|
|
129
|
+
/** Threshold-signed promotion notice. */
|
|
130
|
+
export interface PromotionNoticeV1 {
|
|
131
|
+
v: 1;
|
|
132
|
+
topicId: string;
|
|
133
|
+
fromTier: number;
|
|
134
|
+
/** Typically `fromTier + 1`. */
|
|
135
|
+
toTier: number;
|
|
136
|
+
/** Unix ms. */
|
|
137
|
+
effectiveAt: number;
|
|
138
|
+
/** Cohort threshold signature, base64url. */
|
|
139
|
+
thresholdSig: string;
|
|
140
|
+
/** PeerIds, `>= minSigs`. */
|
|
141
|
+
signers: string[];
|
|
142
|
+
cohortEpoch: string;
|
|
143
|
+
}
|
|
144
|
+
/** Threshold-signed demotion notice. */
|
|
145
|
+
export interface DemotionNoticeV1 {
|
|
146
|
+
v: 1;
|
|
147
|
+
topicId: string;
|
|
148
|
+
tier: number;
|
|
149
|
+
/** 32 bytes, base64url. */
|
|
150
|
+
parentCohortCoord: string;
|
|
151
|
+
effectiveAt: number;
|
|
152
|
+
thresholdSig: string;
|
|
153
|
+
signers: string[];
|
|
154
|
+
cohortEpoch: string;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* A registration record carried in cohort gossip for cross-member replication (so any member can
|
|
158
|
+
* fail over to serving it). Byte fields are base64url; mirrors the local `RegistrationRecord`.
|
|
159
|
+
*/
|
|
160
|
+
export interface GossipRecordV1 {
|
|
161
|
+
/** Topic id, 32 bytes, base64url. */
|
|
162
|
+
topicId: string;
|
|
163
|
+
/** Registering participant peer id, base64url. */
|
|
164
|
+
participantId: string;
|
|
165
|
+
/** Tier 0..3. */
|
|
166
|
+
tier: number;
|
|
167
|
+
/** Assigned primary peer id, base64url. */
|
|
168
|
+
primary: string;
|
|
169
|
+
/** 1..2 warm-failover peer ids, base64url. */
|
|
170
|
+
backups: string[];
|
|
171
|
+
/** Unix ms the registration first attached. */
|
|
172
|
+
attachedAt: number;
|
|
173
|
+
/** Unix ms of the most recent ping/touch (the convergence key — newest wins). */
|
|
174
|
+
lastPing: number;
|
|
175
|
+
/** Registration TTL in ms. */
|
|
176
|
+
ttl: number;
|
|
177
|
+
/** Opaque application-defined per-registration state, base64url. */
|
|
178
|
+
appState?: string;
|
|
179
|
+
}
|
|
180
|
+
/** Reference to a single registration in an eviction delta. */
|
|
181
|
+
export interface GossipRecordRefV1 {
|
|
182
|
+
/** Topic id, 32 bytes, base64url. */
|
|
183
|
+
topicId: string;
|
|
184
|
+
/** Participant peer id, base64url. */
|
|
185
|
+
participantId: string;
|
|
186
|
+
}
|
|
187
|
+
/** Intra-cohort gossip: willingness vector, load barometer, exact per-topic summaries, record deltas. */
|
|
188
|
+
export interface CohortGossipV1 {
|
|
189
|
+
v: 1;
|
|
190
|
+
/** PeerId. */
|
|
191
|
+
fromMember: string;
|
|
192
|
+
/**
|
|
193
|
+
* The cohort coord this gossip is for, 32 bytes, base64url — the inbound routing key. A node serving
|
|
194
|
+
* many cohorts fans a delivered frame to every coord engine's bus; each bus merges only the gossip
|
|
195
|
+
* naming its own coord, so a gossip for one cohort never pollutes a sibling cohort's store/view.
|
|
196
|
+
*/
|
|
197
|
+
coord: string;
|
|
198
|
+
cohortEpoch: string;
|
|
199
|
+
/** 4 bits T0..T3, hex. */
|
|
200
|
+
willingnessBits: string;
|
|
201
|
+
/** 4 entries, 0..7 per tier. */
|
|
202
|
+
loadBuckets: number[];
|
|
203
|
+
/** Cohort-wide observation window for the rate fields in `topicSummaries`. */
|
|
204
|
+
windowSeconds: number;
|
|
205
|
+
topicSummaries: CohortTopicSummary[];
|
|
206
|
+
/**
|
|
207
|
+
* Registration records this member is advertising (fresh or touched), for cross-member
|
|
208
|
+
* replication. Absent when this gossip carries no record changes. Merge is last-writer-wins by
|
|
209
|
+
* {@link GossipRecordV1.lastPing}.
|
|
210
|
+
*/
|
|
211
|
+
records?: GossipRecordV1[];
|
|
212
|
+
/** Registrations this member evicted (stale), so all members converge on the active set. */
|
|
213
|
+
evicted?: GossipRecordRefV1[];
|
|
214
|
+
timestamp: number;
|
|
215
|
+
signature: string;
|
|
216
|
+
}
|
|
217
|
+
/** Per-topic summary inside {@link CohortGossipV1}; counts are exact, intra-cohort only. */
|
|
218
|
+
export interface CohortTopicSummary {
|
|
219
|
+
topicId: string;
|
|
220
|
+
tier: number;
|
|
221
|
+
/** Exact, intra-cohort only. */
|
|
222
|
+
directParticipants: number;
|
|
223
|
+
/** Exact, fresh + renewals over the gossip window. */
|
|
224
|
+
arrivalsPerMin: number;
|
|
225
|
+
queriesPerMin: number;
|
|
226
|
+
promoted: boolean;
|
|
227
|
+
childCohortCount: number;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* What a {@link SignRequestV1} asks a cohort member to endorse — drives the signer's endorsement policy.
|
|
231
|
+
*
|
|
232
|
+
* - `membership` / `promotion` / `demotion` — the requester and endorser must share the **current**
|
|
233
|
+
* cohort + epoch around `coord`.
|
|
234
|
+
* - `rotation` — an epoch hand-off: the endorser attests it was a member of the cohort at the **prior**
|
|
235
|
+
* epoch carried as `cohortEpoch` (the predecessor cohort threshold-signs the successor cert's payload),
|
|
236
|
+
* so the gate checks *prior*-epoch membership rather than current. See `cohort-topic-trust-anchor-rotation-production`.
|
|
237
|
+
*/
|
|
238
|
+
export type SignKind = "membership" | "promotion" | "demotion" | "rotation";
|
|
239
|
+
/**
|
|
240
|
+
* Intra-cohort sign request (`/optimystic/cohort-topic/1.0.0/sign`). A member assembling a `k − x`
|
|
241
|
+
* threshold signature dials each cohort member with this; the member endorses by Ed25519-signing the
|
|
242
|
+
* **exact** `payload` bytes (already canonicalized by the requester via `sig/payloads.ts`), so signer
|
|
243
|
+
* and verifier never re-canonicalize independently. `coord`/`cohortEpoch` scope the endorsement
|
|
244
|
+
* (the member checks it shares that cohort/epoch); `kind` selects the endorsement policy.
|
|
245
|
+
*/
|
|
246
|
+
export interface SignRequestV1 {
|
|
247
|
+
v: 1;
|
|
248
|
+
kind: SignKind;
|
|
249
|
+
/** Cohort coord the signature is for, 32 bytes, base64url. */
|
|
250
|
+
coord: string;
|
|
251
|
+
/** Cohort epoch the requester is collecting under, 32 bytes, base64url. */
|
|
252
|
+
cohortEpoch: string;
|
|
253
|
+
/** The already-canonical signing bytes (the requester's `sig/payloads.ts` image), base64url. */
|
|
254
|
+
payload: string;
|
|
255
|
+
}
|
|
256
|
+
/** A member's endorsement of a {@link SignRequestV1}: its peer-key signature over the request payload. */
|
|
257
|
+
export interface SignReplyOkV1 {
|
|
258
|
+
v: 1;
|
|
259
|
+
/** The endorsing member's dialable id (UTF-8 peer-id string), base64url. */
|
|
260
|
+
signer: string;
|
|
261
|
+
/** Ed25519 signature over the request `payload`, base64url (64 bytes decoded). */
|
|
262
|
+
signature: string;
|
|
263
|
+
}
|
|
264
|
+
/** A member's refusal to endorse a {@link SignRequestV1} (not a cohort member, epoch mismatch, …). */
|
|
265
|
+
export interface SignReplyRefusedV1 {
|
|
266
|
+
v: 1;
|
|
267
|
+
refused: true;
|
|
268
|
+
reason: string;
|
|
269
|
+
}
|
|
270
|
+
/** Reply to a {@link SignRequestV1}: an endorsement ({@link SignReplyOkV1}) or a refusal ({@link SignReplyRefusedV1}). */
|
|
271
|
+
export type SignReplyV1 = SignReplyOkV1 | SignReplyRefusedV1;
|
|
272
|
+
/** Membership certificate for a cohort. */
|
|
273
|
+
export interface MembershipCertV1 {
|
|
274
|
+
v: 1;
|
|
275
|
+
/** 32 bytes, base64url. */
|
|
276
|
+
cohortCoord: string;
|
|
277
|
+
cohortEpoch: string;
|
|
278
|
+
/** PeerIds, sorted ascending, length `k`. */
|
|
279
|
+
members: string[];
|
|
280
|
+
/** Unix ms. */
|
|
281
|
+
stabilizedAt: number;
|
|
282
|
+
thresholdSig: string;
|
|
283
|
+
signers: string[];
|
|
284
|
+
/** Optional FRET stabilization proof, base64url. */
|
|
285
|
+
fretAttestation?: string;
|
|
286
|
+
/**
|
|
287
|
+
* Rotation attestation (epoch rotation). The three fields below are an all-or-nothing group: a cert
|
|
288
|
+
* either carries a full attestation (all three present) or none (all absent). They let a successor
|
|
289
|
+
* cohort inherit trust from its predecessor: the predecessor cohort threshold-signs **this** cert's
|
|
290
|
+
* `membershipCertSigningPayload`, so a verifier holding a trusted predecessor at {@link prevEpoch} can
|
|
291
|
+
* confirm the rotation is legitimate (the prior cohort signed off) rather than a forgery. The
|
|
292
|
+
* attestation is **not** part of `membershipCertSigningPayload` (it signs *over* that payload), so the
|
|
293
|
+
* signed image is unchanged and legacy certs (no rotation fields) still decode.
|
|
294
|
+
*/
|
|
295
|
+
/** Predecessor cohort epoch this cert rotates from (32 bytes, base64url). Present only on a rotation. */
|
|
296
|
+
prevEpoch?: string;
|
|
297
|
+
/** Predecessor cohort's threshold signature over THIS cert's `membershipCertSigningPayload`, base64url. */
|
|
298
|
+
rotationSig?: string;
|
|
299
|
+
/** Predecessor cohort signers (PeerIds, base64url) that produced {@link rotationSig}; `>= minSigs`. */
|
|
300
|
+
rotationSigners?: string[];
|
|
301
|
+
}
|
|
302
|
+
/** Discriminated union over every V1 message carried by the cohort-topic protocols. */
|
|
303
|
+
export type CohortMessageV1 = RegisterV1 | RegisterReplyV1 | RenewV1 | RenewReplyV1 | PromotionNoticeV1 | DemotionNoticeV1 | CohortGossipV1 | MembershipCertV1 | SignRequestV1 | SignReplyOkV1 | SignReplyRefusedV1;
|
|
304
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../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f;AAED,0HAA0H;AAC1H,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,kBAAkB,CAAC;AAE7D,2CAA2C;AAC3C,MAAM,WAAW,gBAAgB;IAChC,CAAC,EAAE,CAAC,CAAC;IACL,2BAA2B;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,eAAe;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,oDAAoD;IACpD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;;;;OAQG;IACH,yGAAyG;IACzG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2GAA2G;IAC3G,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uGAAuG;IACvG,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,uFAAuF;AACvF,MAAM,MAAM,eAAe,GACxB,UAAU,GACV,eAAe,GACf,OAAO,GACP,YAAY,GACZ,iBAAiB,GACjB,gBAAgB,GAChB,cAAc,GACd,gBAAgB,GAChB,aAAa,GACb,aAAa,GACb,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cohort-topic substrate — V1 wire message types.
|
|
3
|
+
*
|
|
4
|
+
* Transcribed from `docs/cohort-topic.md` §Wire formats. These interfaces are the canonical
|
|
5
|
+
* on-the-wire shapes for the cohort-topic RPC surface; the codec in `./codec.ts` serializes
|
|
6
|
+
* them as length-prefixed UTF-8 JSON.
|
|
7
|
+
*
|
|
8
|
+
* Conventions (mandated by §Wire formats):
|
|
9
|
+
* - Every byte-typed field is carried as a base64url string (no padding) — never raw bytes.
|
|
10
|
+
* - Every timestamp is unix milliseconds.
|
|
11
|
+
* - `appPayload` is an opaque base64url string carrying application-defined bytes. The wire layer
|
|
12
|
+
* never interprets it; reactivity / matchmaking define their own structures and serialize them
|
|
13
|
+
* into this slot.
|
|
14
|
+
*/
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/cohort-topic/wire/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cohort-topic substrate — per-message structural validation.
|
|
3
|
+
*
|
|
4
|
+
* Each validator narrows an already-parsed `unknown` (the output of `JSON.parse` on a decoded
|
|
5
|
+
* frame) to a concrete V1 interface, throwing {@link CohortWireError} on any structural defect:
|
|
6
|
+
* missing required field, wrong `v`, out-of-enum discriminant, a byte field that does not decode
|
|
7
|
+
* as base64url, or an out-of-range numeric. Validators never return partial data — they either
|
|
8
|
+
* narrow cleanly or throw.
|
|
9
|
+
*/
|
|
10
|
+
import type { CohortGossipV1, DemotionNoticeV1, MembershipCertV1, PromotionNoticeV1, RegisterReplyV1, RegisterV1, RenewReplyV1, RenewV1, SignRequestV1, SignReplyV1 } from "./types.js";
|
|
11
|
+
/** Thrown for any malformed, oversized, or structurally invalid cohort-topic frame. */
|
|
12
|
+
export declare class CohortWireError extends Error {
|
|
13
|
+
constructor(message: string);
|
|
14
|
+
}
|
|
15
|
+
export declare function validateRegisterV1(value: unknown): RegisterV1;
|
|
16
|
+
export declare function validateRegisterReplyV1(value: unknown): RegisterReplyV1;
|
|
17
|
+
export declare function validateRenewV1(value: unknown): RenewV1;
|
|
18
|
+
export declare function validateRenewReplyV1(value: unknown): RenewReplyV1;
|
|
19
|
+
export declare function validatePromotionNoticeV1(value: unknown): PromotionNoticeV1;
|
|
20
|
+
export declare function validateDemotionNoticeV1(value: unknown): DemotionNoticeV1;
|
|
21
|
+
export declare function validateCohortGossipV1(value: unknown): CohortGossipV1;
|
|
22
|
+
export declare function validateSignRequestV1(value: unknown): SignRequestV1;
|
|
23
|
+
export declare function validateSignReplyV1(value: unknown): SignReplyV1;
|
|
24
|
+
export declare function validateMembershipCertV1(value: unknown): MembershipCertV1;
|
|
25
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../src/cohort-topic/wire/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EACX,cAAc,EAEd,gBAAgB,EAGhB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EAEf,UAAU,EACV,YAAY,EACZ,OAAO,EAEP,aAAa,EACb,WAAW,EAEX,MAAM,YAAY,CAAC;AAEpB,uFAAuF;AACvF,qBAAa,eAAgB,SAAQ,KAAK;gBAC7B,OAAO,EAAE,MAAM;CAI3B;AAmID,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAmC7D;AAcD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,CAuBvE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAevD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAejE;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,iBAAiB,CAc3E;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAczE;AAgDD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,CAgDrE;AAID,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,CAWnE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAgB/D;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAmBzE"}
|