@dmarket/p2p-tracker-headless 1.2.1-SNAPSHOT-development.165 → 1.3.0-beta
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/VERSION +6 -6
- package/kotlin-kotlin-stdlib.mjs +7 -7
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/p2p-tracker-core.mjs +3909 -3919
- package/p2p-tracker-core.mjs.map +1 -1
- package/p2p-tracker-headless.mjs +45 -45
- package/p2p-tracker-headless.mjs.map +1 -1
- package/package.json +1 -1
- package/pkg/README.md +23 -27
- package/pkg/client_wasm.d.ts +2 -37
- package/pkg/client_wasm.js +5 -24
- package/pkg/client_wasm_bg.wasm +0 -0
- package/pkg/client_wasm_bg.wasm.d.ts +0 -1
- package/pkg/snippets/web-spawn-05868593a72e2d44/js/spawn.js +2 -2
- package/pkg/spawn.js +4 -4
- package/transport/README.md +16 -203
- package/transport/dist/channel.d.ts +3 -23
- package/transport/dist/channel.d.ts.map +1 -1
- package/transport/dist/channel.js +3 -3
- package/transport/dist/channel.js.map +1 -1
- package/transport/dist/index.d.ts +3 -5
- package/transport/dist/index.d.ts.map +1 -1
- package/transport/dist/index.js +2 -3
- package/transport/dist/index.js.map +1 -1
- package/transport/dist/node.d.ts +3 -9
- package/transport/dist/node.d.ts.map +1 -1
- package/transport/dist/node.js +61 -5
- package/transport/dist/node.js.map +1 -1
- package/transport/dist/prover.d.ts +2 -18
- package/transport/dist/prover.d.ts.map +1 -1
- package/transport/dist/prover.js +11 -33
- package/transport/dist/prover.js.map +1 -1
- package/transport/dist/types.d.ts +0 -24
- package/transport/dist/types.d.ts.map +1 -1
- package/transport/package.json +1 -4
- package/transport/dist/egress.d.ts +0 -33
- package/transport/dist/egress.d.ts.map +0 -1
- package/transport/dist/egress.js +0 -311
- package/transport/dist/egress.js.map +0 -1
- package/transport/dist/node-bridge.d.ts +0 -12
- package/transport/dist/node-bridge.d.ts.map +0 -1
- package/transport/dist/node-bridge.js +0 -181
- package/transport/dist/node-bridge.js.map +0 -1
- package/transport/dist/node-prover.d.ts +0 -39
- package/transport/dist/node-prover.d.ts.map +0 -1
- package/transport/dist/node-prover.js +0 -124
- package/transport/dist/node-prover.js.map +0 -1
- package/transport/dist/node-runtime.d.ts +0 -11
- package/transport/dist/node-runtime.d.ts.map +0 -1
- package/transport/dist/node-runtime.js +0 -120
- package/transport/dist/node-runtime.js.map +0 -1
- package/transport/dist/node-socket.d.ts +0 -17
- package/transport/dist/node-socket.d.ts.map +0 -1
- package/transport/dist/node-socket.js +0 -109
- package/transport/dist/node-socket.js.map +0 -1
- package/transport/dist/node-worker.d.ts +0 -2
- package/transport/dist/node-worker.d.ts.map +0 -1
- package/transport/dist/node-worker.js +0 -75
- package/transport/dist/node-worker.js.map +0 -1
package/pkg/README.md
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
# client-wasm — browser-extension prover (wasm `cdylib`)
|
|
2
2
|
|
|
3
|
-
> **
|
|
4
|
-
>
|
|
5
|
-
>
|
|
6
|
-
>
|
|
7
|
-
>
|
|
3
|
+
> **Status — bindings + packaging shipped; live e2e deferred to its own scope.**
|
|
4
|
+
> The `#[wasm_bindgen]` surface (`initialize` / `prove` / `present` +
|
|
5
|
+
> `ProveOutput`), the tsify DTOs, and the JS-injected IO adapter (`src/io.rs`
|
|
6
|
+
> `JsIo`/`JsIoAdapter`) are all in place and the crate links for
|
|
7
|
+
> `wasm32-unknown-unknown`. `build.sh` packages it with `wasm-pack` into `pkg/`,
|
|
8
|
+
> and the WebSocket transport lives in [`ts/`](ts/README.md). The **automated
|
|
9
|
+
> end-to-end run is deferred to a later, separately-scoped effort** — both host
|
|
10
|
+
> paths carry real cost (Node needs a single-threaded rebuild; headless Chrome
|
|
11
|
+
> pulls in Chromium). The manual recipe is kept in [`RUN_E2E.md`](RUN_E2E.md).
|
|
12
|
+
> (Branch journal `feature/DMA-61/wasm-client`, entries 10–12.)
|
|
8
13
|
|
|
9
14
|
This crate is the wasm `cdylib` half of the prover: it injects a JS-backed
|
|
10
15
|
futures-io transport and calls `client-core`'s issuance + presentation flow. It
|
|
@@ -26,12 +31,10 @@ signature source; in brief:
|
|
|
26
31
|
| --- | --- | --- |
|
|
27
32
|
| `initialize(logging?, threadCount)` | `Promise<void>` | installs logging + the panic hook, starts the `web-spawn` spawner, builds the rayon MPC pool. **Await once** before `prove`. |
|
|
28
33
|
| `prove(notaryIo, serverIo, config, request, progressCb?)` | `Promise<ProveOutput>` | runs MPC-TLS + the length-prefixed phase-2 exchange → `client_core::issue_with_progress`. |
|
|
29
|
-
| `proveProxy(notaryIo, proxyConfig, request, progressCb?)` | `Promise<ProveOutput>` | one-channel proxy TLS → `client_core::issue_proxy_with_progress`; requires an enabled, routed notary. |
|
|
30
34
|
| `ProveOutput` | `{ attestation, secrets: Uint8Array; response: HttpResponse }` | the two opaque `postcard` blobs to persist together, plus the target's HTTP response. `Uint8Array` (not tsify `number[]`) so the large blobs don't bloat — journal 08. |
|
|
31
35
|
| `present(attestation, secrets, policy?)` | `Uint8Array` | offline (no notary/network, no `initialize`) → `client_core::present`; omit `policy` for the safe default redactions. |
|
|
32
36
|
|
|
33
|
-
DTOs (`src/types.rs`, tsify): `IssuanceConfig`, `
|
|
34
|
-
`ProxyLimits`, `HttpRequest`, `HttpResponse`,
|
|
37
|
+
DTOs (`src/types.rs`, tsify): `IssuanceConfig`, `HttpRequest`, `HttpResponse`,
|
|
35
38
|
`RevealPolicy`, `RootStore` (`"mozilla" | { pem }`), `BodyReveal` (`"all" |
|
|
36
39
|
"none" | { jsonPaths }` — `jsonPaths` reveals each field **with its key path**,
|
|
37
40
|
is not directly `JSON.parse`-able, and widens to the whole array for any path
|
|
@@ -47,14 +50,6 @@ Both deliver raw bytes; the prover performs MPC-TLS. The client consumes the
|
|
|
47
50
|
injected `IoChannel` (the interface is exported into the `.d.ts` from a
|
|
48
51
|
`typescript_custom_section` in `src/io.rs` — the single source of truth).
|
|
49
52
|
|
|
50
|
-
Proxy mode uses only the notary channel; the notary authorizes and dials the
|
|
51
|
-
target. `ProxyIssuanceConfig` has `serverName`, optional `rootStore`, and optional
|
|
52
|
-
`limits` with independently defaulted finite capture ceilings. The existing
|
|
53
|
-
signature/client-auth defaults and result/presentation formats are unchanged.
|
|
54
|
-
`createProxyProver(wasm)` and `createNodeProxyProver()` expose this through the
|
|
55
|
-
extended JS facades. Both modes require the threaded build and worker assets.
|
|
56
|
-
`connectProxy` continues to mean the separate MPC target transport relay.
|
|
57
|
-
|
|
58
53
|
## Build & packaging
|
|
59
54
|
|
|
60
55
|
`./build.sh` runs `wasm-pack build --profile wasm --target web` and emits `pkg/`
|
|
@@ -87,19 +82,20 @@ For native mobile Rust clients, enable `client-core`'s `tcp` feature and pass
|
|
|
87
82
|
The caller still supplies the authenticated notary channel and a Tokio runtime.
|
|
88
83
|
Other mobile runtimes can supply their own futures-io stream instead.
|
|
89
84
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
Transport support does not change the WASM execution environment: the shipped
|
|
86
|
+
threaded package still needs browser Web Workers and cross-origin isolation.
|
|
87
|
+
Electron can run it in a suitable renderer with TCP supplied by the host; plain
|
|
88
|
+
Node needs a compatible WASM worker/bootstrap integration. This change does not
|
|
89
|
+
add mobile platform bindings to the scaffolded `client-cffi` crate.
|
|
93
90
|
|
|
94
|
-
## Running end-to-end → [`RUN_E2E.md`](RUN_E2E.md)
|
|
91
|
+
## Running end-to-end → [`RUN_E2E.md`](RUN_E2E.md) (deferred scope)
|
|
95
92
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
large responses, failures and recovery as well as successful validation.
|
|
93
|
+
The live run — wasm `prove()`/`present()` against the in-repo notary + echo
|
|
94
|
+
server through the ws→tcp proxy, verified by the validator — is **deferred to its
|
|
95
|
+
own future effort**. `RUN_E2E.md` holds the manual recipe, the two host options
|
|
96
|
+
(A: Node single-threaded — needs a rebuild dropping the threading rustflags +
|
|
97
|
+
`tlsn default-features=false`; B: headless Chrome + COOP/COEP), and the
|
|
98
|
+
`wrangler`/proxy prerequisite, as the starting point when that scope opens.
|
|
103
99
|
|
|
104
100
|
## Integrator note (cross-origin isolation)
|
|
105
101
|
|
package/pkg/client_wasm.d.ts
CHANGED
|
@@ -32,23 +32,6 @@ export interface CrateLogFilter {
|
|
|
32
32
|
*/
|
|
33
33
|
export type BodyReveal = "all" | "none" | { jsonPaths: string[] };
|
|
34
34
|
|
|
35
|
-
/**
|
|
36
|
-
* Local proxy capture ceilings. Every omitted field keeps its finite default;
|
|
37
|
-
* these values are not policy negotiated with the notary.
|
|
38
|
-
*/
|
|
39
|
-
export interface ProxyLimits {
|
|
40
|
-
maxSentData?: number;
|
|
41
|
-
maxRecvData?: number;
|
|
42
|
-
maxSentCiphertext?: number;
|
|
43
|
-
maxRecvCiphertext?: number;
|
|
44
|
-
maxCiphertext?: number;
|
|
45
|
-
maxSentRecords?: number;
|
|
46
|
-
maxRecvRecords?: number;
|
|
47
|
-
maxRecordPayload?: number;
|
|
48
|
-
maxHandshakeBytes?: number;
|
|
49
|
-
maxCertificateBytes?: number;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
35
|
/**
|
|
53
36
|
* Logging configuration passed from JS to [`crate::initialize`].
|
|
54
37
|
*/
|
|
@@ -71,16 +54,6 @@ export interface LoggingConfig {
|
|
|
71
54
|
*/
|
|
72
55
|
export type RootStorePreset = "mozilla";
|
|
73
56
|
|
|
74
|
-
/**
|
|
75
|
-
* Proxy issuance takes only a notary channel. No target address or MPC
|
|
76
|
-
* preprocessing settings; signature/client-auth defaults match the MPC DTO.
|
|
77
|
-
*/
|
|
78
|
-
export interface ProxyIssuanceConfig {
|
|
79
|
-
serverName: string;
|
|
80
|
-
limits?: ProxyLimits;
|
|
81
|
-
rootStore?: RootStore;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
57
|
/**
|
|
85
58
|
* The HTTP request to prove.
|
|
86
59
|
*
|
|
@@ -227,8 +200,8 @@ export class WorkerData {
|
|
|
227
200
|
* `web-spawn`'s spawner would start a second worker if re-run. Extension
|
|
228
201
|
* lifecycle code can easily call `initialize` more than once, so a duplicate
|
|
229
202
|
* call here is a no-op that returns `Ok(())`. On failure the one-time claim is
|
|
230
|
-
* released,
|
|
231
|
-
*
|
|
203
|
+
* released, so a genuine retry (e.g. after the page adds the COOP/COEP headers
|
|
204
|
+
* `start_spawner` needs) can proceed.
|
|
232
205
|
*
|
|
233
206
|
* A near-verbatim port of upstream `dep/tlsn/crates/wasm/src/lib.rs`, with the
|
|
234
207
|
* idempotency guard added and logging configured locally rather than via
|
|
@@ -274,13 +247,6 @@ export function present(attestation_bytes: Uint8Array, secrets_bytes: Uint8Array
|
|
|
274
247
|
*/
|
|
275
248
|
export function prove(notary_io: IoChannel, server_io: IoChannel, config: IssuanceConfig, request: HttpRequest, progress_cb?: Function | null): Promise<ProveOutput>;
|
|
276
249
|
|
|
277
|
-
/**
|
|
278
|
-
* Issue through an enabled proxy notary using exactly one channel. The notary
|
|
279
|
-
* authorizes and dials the target; this call never opens a target relay or
|
|
280
|
-
* falls back to MPC. The threaded module must be initialized first.
|
|
281
|
-
*/
|
|
282
|
-
export function proveProxy(notary_io: IoChannel, config: ProxyIssuanceConfig, request: HttpRequest, progress_cb?: Function | null): Promise<ProveOutput>;
|
|
283
|
-
|
|
284
250
|
/**
|
|
285
251
|
* Starts the thread spawner on a dedicated worker thread.
|
|
286
252
|
*/
|
|
@@ -297,7 +263,6 @@ export interface InitOutput {
|
|
|
297
263
|
readonly initialize: (a: number, b: number) => any;
|
|
298
264
|
readonly present: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
299
265
|
readonly prove: (a: any, b: any, c: any, d: any, e: number) => any;
|
|
300
|
-
readonly proveProxy: (a: any, b: any, c: any, d: number) => any;
|
|
301
266
|
readonly proveoutput_attestation: (a: number) => [number, number];
|
|
302
267
|
readonly proveoutput_response: (a: number) => any;
|
|
303
268
|
readonly proveoutput_secrets: (a: number) => [number, number];
|
package/pkg/client_wasm.js
CHANGED
|
@@ -130,8 +130,8 @@ if (Symbol.dispose) WorkerData.prototype[Symbol.dispose] = WorkerData.prototype.
|
|
|
130
130
|
* `web-spawn`'s spawner would start a second worker if re-run. Extension
|
|
131
131
|
* lifecycle code can easily call `initialize` more than once, so a duplicate
|
|
132
132
|
* call here is a no-op that returns `Ok(())`. On failure the one-time claim is
|
|
133
|
-
* released,
|
|
134
|
-
*
|
|
133
|
+
* released, so a genuine retry (e.g. after the page adds the COOP/COEP headers
|
|
134
|
+
* `start_spawner` needs) can proceed.
|
|
135
135
|
*
|
|
136
136
|
* A near-verbatim port of upstream `dep/tlsn/crates/wasm/src/lib.rs`, with the
|
|
137
137
|
* idempotency guard added and logging configured locally rather than via
|
|
@@ -208,21 +208,6 @@ export function prove(notary_io, server_io, config, request, progress_cb) {
|
|
|
208
208
|
return ret;
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
/**
|
|
212
|
-
* Issue through an enabled proxy notary using exactly one channel. The notary
|
|
213
|
-
* authorizes and dials the target; this call never opens a target relay or
|
|
214
|
-
* falls back to MPC. The threaded module must be initialized first.
|
|
215
|
-
* @param {IoChannel} notary_io
|
|
216
|
-
* @param {ProxyIssuanceConfig} config
|
|
217
|
-
* @param {HttpRequest} request
|
|
218
|
-
* @param {Function | null} [progress_cb]
|
|
219
|
-
* @returns {Promise<ProveOutput>}
|
|
220
|
-
*/
|
|
221
|
-
export function proveProxy(notary_io, config, request, progress_cb) {
|
|
222
|
-
const ret = wasm.proveProxy(notary_io, config, request, isLikeNone(progress_cb) ? 0 : addToExternrefTable0(progress_cb));
|
|
223
|
-
return ret;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
211
|
/**
|
|
227
212
|
* Starts the thread spawner on a dedicated worker thread.
|
|
228
213
|
* @returns {Promise<any>}
|
|
@@ -635,10 +620,6 @@ function __wbg_get_imports(memory) {
|
|
|
635
620
|
const ret = arg0.node;
|
|
636
621
|
return ret;
|
|
637
622
|
},
|
|
638
|
-
__wbg_now_86c0d4ba3fa605b8: function() {
|
|
639
|
-
const ret = Date.now();
|
|
640
|
-
return ret;
|
|
641
|
-
},
|
|
642
623
|
__wbg_now_cace042f68c814d8: function(arg0) {
|
|
643
624
|
const ret = arg0.now();
|
|
644
625
|
return ret;
|
|
@@ -797,17 +778,17 @@ function __wbg_get_imports(memory) {
|
|
|
797
778
|
return ret;
|
|
798
779
|
}, arguments); },
|
|
799
780
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
800
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
781
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1081, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
801
782
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_1fa5c626ec3a32f9___convert__closures_____invoke___wasm_bindgen_1fa5c626ec3a32f9___JsValue______true_);
|
|
802
783
|
return ret;
|
|
803
784
|
},
|
|
804
785
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
805
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
786
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2300, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
806
787
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_1fa5c626ec3a32f9___convert__closures_____invoke___wasm_bindgen_1fa5c626ec3a32f9___JsValue__core_b7b33017ae0f8bb5___result__Result_____wasm_bindgen_1fa5c626ec3a32f9___JsError___true_);
|
|
807
788
|
return ret;
|
|
808
789
|
},
|
|
809
790
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
810
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
791
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2302, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
811
792
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_1fa5c626ec3a32f9___convert__closures_____invoke___js_sys_27d0ccca2911ffcd___futures__task__wait_async_polyfill__MessageEvent______true_);
|
|
812
793
|
return ret;
|
|
813
794
|
},
|
package/pkg/client_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -4,7 +4,6 @@ export const __wbg_proveoutput_free: (a: number, b: number) => void;
|
|
|
4
4
|
export const initialize: (a: number, b: number) => any;
|
|
5
5
|
export const present: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
6
6
|
export const prove: (a: any, b: any, c: any, d: any, e: number) => any;
|
|
7
|
-
export const proveProxy: (a: any, b: any, c: any, d: number) => any;
|
|
8
7
|
export const proveoutput_attestation: (a: number) => [number, number];
|
|
9
8
|
export const proveoutput_response: (a: number) => any;
|
|
10
9
|
export const proveoutput_secrets: (a: number) => [number, number];
|
|
@@ -17,7 +17,7 @@ registerMessageListener(self, 'web_spawn_start_spawner', async (data) => {
|
|
|
17
17
|
);
|
|
18
18
|
const [module, memory, spawnerPtr] = data;
|
|
19
19
|
const pkg = await import('../../../client_wasm.js');
|
|
20
|
-
const exports = await pkg.default({
|
|
20
|
+
const exports = await pkg.default({ module, memory });
|
|
21
21
|
|
|
22
22
|
const spawner = pkg.web_spawn_recover_spawner(spawnerPtr);
|
|
23
23
|
postMessage('web_spawn_spawner_ready');
|
|
@@ -33,7 +33,7 @@ registerMessageListener(self, 'web_spawn_start_worker', async (data) => {
|
|
|
33
33
|
const [module, memory, workerPtr] = data;
|
|
34
34
|
|
|
35
35
|
const pkg = await import('../../../client_wasm.js');
|
|
36
|
-
const exports = await pkg.default({
|
|
36
|
+
const exports = await pkg.default({ module, memory });
|
|
37
37
|
|
|
38
38
|
pkg.web_spawn_start_worker(workerPtr);
|
|
39
39
|
|
package/pkg/spawn.js
CHANGED
|
@@ -16,8 +16,8 @@ registerMessageListener(self, 'web_spawn_start_spawner', async (data) => {
|
|
|
16
16
|
import.meta.url
|
|
17
17
|
);
|
|
18
18
|
const [module, memory, spawnerPtr] = data;
|
|
19
|
-
const pkg = await import('
|
|
20
|
-
const exports = await pkg.default({
|
|
19
|
+
const pkg = await import('../../../client_wasm.js');
|
|
20
|
+
const exports = await pkg.default({ module, memory });
|
|
21
21
|
|
|
22
22
|
const spawner = pkg.web_spawn_recover_spawner(spawnerPtr);
|
|
23
23
|
postMessage('web_spawn_spawner_ready');
|
|
@@ -32,8 +32,8 @@ registerMessageListener(self, 'web_spawn_start_spawner', async (data) => {
|
|
|
32
32
|
registerMessageListener(self, 'web_spawn_start_worker', async (data) => {
|
|
33
33
|
const [module, memory, workerPtr] = data;
|
|
34
34
|
|
|
35
|
-
const pkg = await import('
|
|
36
|
-
const exports = await pkg.default({
|
|
35
|
+
const pkg = await import('../../../client_wasm.js');
|
|
36
|
+
const exports = await pkg.default({ module, memory });
|
|
37
37
|
|
|
38
38
|
pkg.web_spawn_start_worker(workerPtr);
|
|
39
39
|
|
package/transport/README.md
CHANGED
|
@@ -18,11 +18,9 @@ wasm pkg — a load-bearing invariant, see below):
|
|
|
18
18
|
| export | kind | purpose |
|
|
19
19
|
| --- | --- | --- |
|
|
20
20
|
| `createProver(wasm)` | façade | wraps an injected pkg module in the `Prover` surface below |
|
|
21
|
-
| `createProxyProver(wasm)` | façade | adds `proveProxy(notaryIo, proxyConfig, request, onProgress?)` to the existing surface |
|
|
22
|
-
| `ProxyClientWasmModule` / `ProxyProver` | types | extend the old module/facade interfaces without adding required old members |
|
|
23
21
|
| `Prover` | type | `initialize(logging?, threads?)` / `prove(notaryIo, serverIo, config, request, onProgress?)` / `present(attestation, secrets, policy?)` |
|
|
24
22
|
| `ClientWasmModule` | type | the injected-module contract (`import * as wasm from ".../pkg/client_wasm.js"` satisfies it) |
|
|
25
|
-
| `connectNotary(url, token, opts?)` | transport | the notary channel
|
|
23
|
+
| `connectNotary(url, token, opts?)` | transport | the notary MPC channel, authenticated by the `Sec-WebSocket-Protocol` bearer subprotocol |
|
|
26
24
|
| `connectProxy(proxyBase, host, port, opts?)` | transport | the target byte pipe, tunnelled `WS → p2p-wss-proxy → TCP` |
|
|
27
25
|
| `connectTcp(host, port, { connect })` | transport | direct target TCP through an injected host connector |
|
|
28
26
|
| `TcpIoChannel` / `TcpSocket` / `TcpConnectOptions` | transport / types | adapt host Web Streams to `IoChannel` |
|
|
@@ -72,53 +70,6 @@ const presentation = prover.present(out.attestation, out.secrets, {
|
|
|
72
70
|
// POST `presentation` (Uint8Array) to your validating backend.
|
|
73
71
|
```
|
|
74
72
|
|
|
75
|
-
## Proxy issuance
|
|
76
|
-
|
|
77
|
-
Choose proxy explicitly when the notary has enabled it and authorized the target
|
|
78
|
-
DNS identity. It uses only the notary channel; the notary owns target DNS and
|
|
79
|
-
dialing. The same attestation/secrets, presentation and redaction APIs apply.
|
|
80
|
-
|
|
81
|
-
```ts
|
|
82
|
-
import * as wasm from "./pkg/client_wasm.js"; // keep loose and external
|
|
83
|
-
import { createProxyProver, connectNotary } from "@dmarket/steam-provenance";
|
|
84
|
-
|
|
85
|
-
const prover = createProxyProver(wasm); // checks the export before initialization
|
|
86
|
-
const notaryIo = await connectNotary("wss://notary.example/", bearerToken);
|
|
87
|
-
try {
|
|
88
|
-
const out = await prover.proveProxy(notaryIo,
|
|
89
|
-
{ serverName: "api.example.com", limits: { maxRecvData: 128 * 1024 } },
|
|
90
|
-
{ method: "GET", uri: "/v1/resource" });
|
|
91
|
-
// Persist out.attestation and out.secrets together; present later as usual.
|
|
92
|
-
} finally {
|
|
93
|
-
await notaryIo.close();
|
|
94
|
-
}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
`ProxyIssuanceConfig` accepts `serverName`, `rootStore` and `limits`. Omitted
|
|
98
|
-
limits retain finite defaults: 16/128 KiB sent/received application plaintext,
|
|
99
|
-
64/256/320 KiB sent/received/combined TLS wire bytes, 512 records per direction,
|
|
100
|
-
18 KiB record payload, and 64 KiB handshake/certificate budgets. Byte caps include
|
|
101
|
-
HTTP headers or TLS record headers as applicable. Invalid or inconsistent limits
|
|
102
|
-
fail before protocol IO; the notary independently enforces its own limits.
|
|
103
|
-
Proxy has no MPC preprocessing settings and emits `PROXY_SETUP` and `PROOF`
|
|
104
|
-
stages through the existing progress-event shape.
|
|
105
|
-
|
|
106
|
-
Both modes require the threaded WASM build, workers and browser isolation.
|
|
107
|
-
`connectProxy` remains the MPC WebSocket-to-TCP transport relay; it is not used
|
|
108
|
-
by TLSN proxy mode. `createProver` and old injected modules retain their existing
|
|
109
|
-
MPC behavior. Proxy factories reject a module missing `proveProxy` explicitly;
|
|
110
|
-
issuance failures never trigger automatic MPC replay. Browser hosts own channel
|
|
111
|
-
cleanup and worker cancellation as with the existing facade.
|
|
112
|
-
|
|
113
|
-
For plain Node, import `createNodeProxyProver` from
|
|
114
|
-
`@dmarket/steam-provenance/node`. Its `proveProxy(notaryIo, config, request,
|
|
115
|
-
options?)` takes exactly one channel, with the same validation, one-operation
|
|
116
|
-
limit, cancellation, timeout and disposal rules as `createNodeProver` below.
|
|
117
|
-
Accepted channels close on success or failure; pre-aborted, invalid-option,
|
|
118
|
-
busy and disposed calls retain caller ownership. A failed or cancelled operation
|
|
119
|
-
discards the worker tree and a later call initializes a fresh one. The extended
|
|
120
|
-
object also retains `prove` and asynchronous `present`.
|
|
121
|
-
|
|
122
73
|
## Direct TCP for desktop and native hosts
|
|
123
74
|
|
|
124
75
|
In a Node-capable host, replace the target proxy channel with:
|
|
@@ -174,7 +125,10 @@ when an issuance fails.
|
|
|
174
125
|
errors, copies outgoing bytes before yielding, and waits for pending writes
|
|
175
126
|
before closing. Repeated `close()` calls share the same promise.
|
|
176
127
|
|
|
177
|
-
|
|
128
|
+
This adds a transport for desktop npm hosts; the shipped WASM binary still
|
|
129
|
+
uses browser Web Workers. Electron needs a suitable renderer and host bridge;
|
|
130
|
+
plain Node needs a compatible WASM worker/bootstrap integration. A TCP adapter
|
|
131
|
+
alone does not supply that runtime. Native mobile Rust integrations can use
|
|
178
132
|
`client-core` with `features = ["tcp"]`, a Tokio runtime, and
|
|
179
133
|
`client_core::connect_tcp((host, port))` as the target stream for `issue()`.
|
|
180
134
|
|
|
@@ -257,9 +211,9 @@ queue in `io.rs` is satisfied immediately here).
|
|
|
257
211
|
The generated wasm package (`../pkg`) must exist first — `src/wasm-compat.ts`
|
|
258
212
|
asserts this package's locally-declared types against the generated
|
|
259
213
|
`client_wasm.d.ts` (resolved via the `paths` mapping in `tsconfig.json`).
|
|
260
|
-
|
|
261
|
-
type-only and erased
|
|
262
|
-
|
|
214
|
+
There is **no runtime dependency** on `../pkg`: every import of it is
|
|
215
|
+
type-only and erased, so the emitted `dist/` imports nothing from it (verify
|
|
216
|
+
with `grep -rE 'from "client-wasm"' dist/` → nothing).
|
|
263
217
|
|
|
264
218
|
```sh
|
|
265
219
|
../build.sh # 1. build the wasm pkg (produces ../pkg/client_wasm.d.ts)
|
|
@@ -269,159 +223,18 @@ npm run build # emit dist/ (ESM + .d.ts)
|
|
|
269
223
|
npm test # build + adapter and loopback TCP tests
|
|
270
224
|
```
|
|
271
225
|
|
|
272
|
-
##
|
|
273
|
-
|
|
274
|
-
The Node worker prover requires Node 24.18.0 or later; Node 26.7.0 is also tested
|
|
275
|
-
on macOS arm64. Its factories reject older runtimes before starting workers or
|
|
276
|
-
accepting channels. Package installation and browser-entry imports retain the
|
|
277
|
-
published Node >=18 requirement. CI uses Node 24.18.0 for worker tests.
|
|
278
|
-
|
|
279
|
-
Import `@dmarket/steam-provenance/node` from the installed npm package. The
|
|
280
|
-
transport package also exposes these APIs at `client-wasm-transport/node` when
|
|
281
|
-
staged alongside `pkg/`. Keep the Node entry and its worker files on disk;
|
|
282
|
-
do not inline them into an application bundle. The browser entry stays separate.
|
|
283
|
-
|
|
284
|
-
```js
|
|
285
|
-
import { createConnection } from "node:net";
|
|
286
|
-
import { once } from "node:events";
|
|
287
|
-
import { createNodeProver, wrapTcpSocket, connectNotary }
|
|
288
|
-
from "@dmarket/steam-provenance/node";
|
|
289
|
-
|
|
290
|
-
const prover = createNodeProver({ threadCount: 2, operationTimeoutMs: 120_000 });
|
|
291
|
-
let socket, serverIo, notaryIo;
|
|
292
|
-
try {
|
|
293
|
-
await prover.initialize();
|
|
294
|
-
notaryIo = await connectNotary(notaryUrl, accessToken);
|
|
295
|
-
socket = createConnection({ host: endpointAddress, port: 443 });
|
|
296
|
-
socket.on("error", error => console.error("endpoint socket error", error.code));
|
|
297
|
-
const connectionTimer = setTimeout(() => socket.destroy(new Error("connect timeout")), 10_000);
|
|
298
|
-
try { await once(socket, "connect"); }
|
|
299
|
-
finally { clearTimeout(connectionTimer); }
|
|
300
|
-
serverIo = wrapTcpSocket(socket);
|
|
301
|
-
const out = await prover.prove(notaryIo, serverIo,
|
|
302
|
-
{ serverName: "api.example.com" },
|
|
303
|
-
{ method: "GET", uri: "/v1/resource" },
|
|
304
|
-
{ signal: AbortSignal.timeout(120_000), onProgress: event => console.log(event.step) });
|
|
305
|
-
const presentation = await prover.present(out.attestation, out.secrets, {
|
|
306
|
-
redactRequestHeaderValues: ["authorization", "cookie", "user-agent"],
|
|
307
|
-
revealRequestTarget: false,
|
|
308
|
-
revealResponseHeaders: true,
|
|
309
|
-
revealResponseBody: "all",
|
|
310
|
-
});
|
|
311
|
-
// Send presentation to your validator; persist attestation + secrets together.
|
|
312
|
-
} finally {
|
|
313
|
-
await prover.dispose();
|
|
314
|
-
await serverIo?.abort();
|
|
315
|
-
socket?.destroy();
|
|
316
|
-
await notaryIo?.close();
|
|
317
|
-
}
|
|
318
|
-
```
|
|
226
|
+
## Running outside a browser (Node)
|
|
319
227
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
handoff, the adapter owns IO and may close/destroy the socket. Unread buffered
|
|
326
|
-
bytes are retained. It enables `TCP_NODELAY` and `allowHalfOpen`: peer EOF ends
|
|
327
|
-
reads while accepted writes can still drain. Normal close is idempotent and
|
|
328
|
-
drains writes; after five seconds it destroys a blocked connection. `abort()`
|
|
329
|
-
destroys it immediately. Reusing this connection after a proof is not supported.
|
|
330
|
-
|
|
331
|
-
MPC-TLS runs inside the prover, so do not call `tls.connect()` or perform a TLS
|
|
332
|
-
handshake before handoff. `serverName` controls certificate identity and SNI and
|
|
333
|
-
can differ from the routing address. The notary uses its existing authenticated
|
|
334
|
-
WebSocket handshake; `connectNotary` also accepts an injected `WebSocketImpl`.
|
|
335
|
-
Application connection deadlines are separate from prover initialization and
|
|
336
|
-
issuance deadlines.
|
|
337
|
-
|
|
338
|
-
`createNodeProver` runs the existing threaded WASM inside dedicated
|
|
339
|
-
`worker_threads`, with no compatibility globals added to the application.
|
|
340
|
-
`initialize()` coalesces repeated/concurrent calls. `prove()` and `present()` are
|
|
341
|
-
asynchronous and allow one active operation per instance. A rejected concurrent
|
|
342
|
-
call, invalid options, or an already-aborted signal leaves ownership of the
|
|
343
|
-
channels with the caller. An accepted proof closes
|
|
344
|
-
both IO channels on success or failure. Custom channels must make `close()`
|
|
345
|
-
unblock IO; they can expose `abort()` for immediate cleanup. The bridge allows
|
|
346
|
-
one outstanding read, acknowledges write completion, splits messages at 64 KiB,
|
|
347
|
-
and limits queued writes to 8 MiB / 128 calls. Await writes for backpressure.
|
|
348
|
-
|
|
349
|
-
Initialization defaults to 30 seconds; proof/presentation calls default to
|
|
350
|
-
120 seconds including initialization, configurable per instance or call. An
|
|
351
|
-
AbortSignal, timeout, worker failure, or failed proof discards the entire worker
|
|
352
|
-
module; a later call initializes a fresh one. `dispose()` is terminal and
|
|
353
|
-
idempotent, settles outstanding calls, terminates the complete worker tree, and
|
|
354
|
-
bounds custom-channel cleanup to five seconds. Progress callback errors cannot
|
|
355
|
-
strand a proof. Logging defaults to Off; progress contains stages, not proof data.
|
|
356
|
-
|
|
357
|
-
Separate instances can run independently. Each uses a prover worker, a spawner,
|
|
358
|
-
a Rayon pool, and additional MPC workers; budget CPU and shared memory per
|
|
359
|
-
instance. `threadCount` defaults to available CPUs capped at 8 (range 1–32) and
|
|
360
|
-
also controls the parallelism reported to the MPC executor. A one-thread pool
|
|
361
|
-
still requires workers. No serial WASM rebuild or browser is involved.
|
|
228
|
+
`connectNotary` / `connectProxy` use the global `WebSocket` by default. To use
|
|
229
|
+
another implementation, pass
|
|
230
|
+
`connectNotary(url, token, { WebSocketImpl: WsFromNodePackage })`.
|
|
231
|
+
Use the `/node` entry above for a direct TCP target. See its runtime caveat
|
|
232
|
+
before attempting to initialize the browser WASM package in plain Node.
|
|
362
233
|
|
|
363
234
|
## Integrator note (cross-origin isolation)
|
|
364
235
|
|
|
365
236
|
The multi-threaded wasm build uses `SharedArrayBuffer`, so the embedding
|
|
366
237
|
page/extension **must be cross-origin isolated** (COOP: `same-origin` + COEP:
|
|
367
238
|
`require-corp`). Plan the extension/page headers accordingly. A failed
|
|
368
|
-
`initialize()` releases the façade's memo
|
|
369
|
-
|
|
370
|
-
The Node facade performs that replacement automatically.
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
### Opt-in Worker egress for proxy issuance
|
|
374
|
-
|
|
375
|
-
Use `connectEgressNotary(workerUrl, token, options?)` when the operator selects
|
|
376
|
-
reverse Worker egress. It returns the ordinary `IoChannel` consumed by
|
|
377
|
-
`proveProxy`; the proof, presentation and validator APIs are unchanged.
|
|
378
|
-
`connectNotary` continues to select the existing direct notary protocol.
|
|
379
|
-
|
|
380
|
-
```ts
|
|
381
|
-
import { connectEgressNotary, createProxyProver } from "@dmarket/steam-provenance";
|
|
382
|
-
const prover = createProxyProver(wasm);
|
|
383
|
-
await prover.initialize(null, 2);
|
|
384
|
-
const io = await connectEgressNotary(
|
|
385
|
-
"wss://worker.example/notary/egress/v1", bearerToken,
|
|
386
|
-
{ timeoutMs: 240_000 },
|
|
387
|
-
);
|
|
388
|
-
try {
|
|
389
|
-
const result = await prover.proveProxy(io, proxyConfig, request);
|
|
390
|
-
// Existing presentation/disclosure API consumes result.attestation/secrets.
|
|
391
|
-
} finally {
|
|
392
|
-
await io.abort();
|
|
393
|
-
}
|
|
394
|
-
```
|
|
395
|
-
|
|
396
|
-
The connector is also exported from `/node`; use it with
|
|
397
|
-
`createNodeProxyProver`. `WebSocketImpl` injection supports Node WebSocket
|
|
398
|
-
implementations and gateway signing headers. For a signed gateway flow, omit
|
|
399
|
-
`token`, inject a constructor that signs the actual Worker-facing request URL,
|
|
400
|
-
and configure the gateway to mint `Authorization` before forwarding. The Worker
|
|
401
|
-
accepts that user credential; it never validates original API-key signatures or
|
|
402
|
-
forwards those signing headers. A raw API key is not a notary token. Service
|
|
403
|
-
credentials belong only in Worker/notary configuration, never in this API.
|
|
404
|
-
|
|
405
|
-
The frontend requires `tlsn.notary.egress.v1` and implements bounded binary
|
|
406
|
-
framing/credits with 64 KiB per-direction windows and a 16 KiB maximum payload.
|
|
407
|
-
It restricts all traffic to the client channel; the client cannot select an
|
|
408
|
-
upstream notary or send server-leg frames. The total timeout includes the
|
|
409
|
-
WebSocket handshake, admission, TLS, proof and signing (default 240 seconds,
|
|
410
|
-
maximum 600 seconds, reduced by the notary's advertised budget). WSS is required;
|
|
411
|
-
plain WS is allowed only for loopback fixtures. URL credentials, query parameters
|
|
412
|
-
and fragments are rejected.
|
|
413
|
-
|
|
414
|
-
One read and up to 16 writes (at most 1 MiB total) may be pending, matching the
|
|
415
|
-
existing WASM adapter's bounded batching. Writes copy their input and serialize;
|
|
416
|
-
only 64 KiB may be outstanding on the wire until consumption credits arrive.
|
|
417
|
-
Exceeding the local write queue fails the session. `close()` sends a directional FIN after queued writes;
|
|
418
|
-
`abort()` immediately stops a failed or cancelled session and clears pending IO.
|
|
419
|
-
On browser error/cancellation call `abort()` or terminate the owning worker.
|
|
420
|
-
The Node prover uses `abort()` during failed-operation disposal. Target EOF keeps
|
|
421
|
-
the client channel alive for the signing exchange. There is no direct-target,
|
|
422
|
-
transport or mode fallback. The MPC `proxyBaseUrl` setting remains separate.
|
|
423
|
-
|
|
424
|
-
The operator-controlled Worker is part of the notary's trusted observation path.
|
|
425
|
-
It sees the user credential and disclosed proof fields after outer WSS
|
|
426
|
-
termination. The inner target TLS remains between prover and target. This route
|
|
427
|
-
does not guarantee a source-IP country or Steam acceptance.
|
|
239
|
+
`initialize()` (e.g. missing those headers) releases the façade's memo, so
|
|
240
|
+
calling it again after fixing the environment retries for real.
|
|
@@ -2,31 +2,11 @@ import type { IoChannel } from "./types.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Injectable `WebSocket` constructor. Defaults to the global browser
|
|
4
4
|
* `WebSocket`. Supplying one lets the transport run under a polyfill (e.g. the
|
|
5
|
-
* `ws` package in Node),
|
|
5
|
+
* `ws` package in Node for the deferred single-threaded run — see RUN_E2E.md),
|
|
6
6
|
* without any code change.
|
|
7
7
|
*/
|
|
8
|
-
export interface WebSocketEvents {
|
|
9
|
-
open: unknown;
|
|
10
|
-
error: unknown;
|
|
11
|
-
close: {
|
|
12
|
-
code: number;
|
|
13
|
-
};
|
|
14
|
-
message: {
|
|
15
|
-
data: unknown;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export interface WebSocketLike {
|
|
19
|
-
binaryType: string;
|
|
20
|
-
readonly readyState: number;
|
|
21
|
-
readonly protocol: string;
|
|
22
|
-
send(data: Uint8Array<ArrayBuffer>): void;
|
|
23
|
-
close(): void;
|
|
24
|
-
addEventListener<K extends keyof WebSocketEvents>(type: K, listener: (event: WebSocketEvents[K]) => void, options?: {
|
|
25
|
-
once?: boolean;
|
|
26
|
-
}): void;
|
|
27
|
-
}
|
|
28
8
|
export type WebSocketCtor = {
|
|
29
|
-
new (url: string, protocols?: string | string[]):
|
|
9
|
+
new (url: string, protocols?: string | string[]): WebSocket;
|
|
30
10
|
};
|
|
31
11
|
/**
|
|
32
12
|
* Adapts a browser `WebSocket` into the wasm prover's `IoChannel`.
|
|
@@ -56,7 +36,7 @@ export type WebSocketCtor = {
|
|
|
56
36
|
*/
|
|
57
37
|
export declare class WsIoChannel implements IoChannel {
|
|
58
38
|
#private;
|
|
59
|
-
constructor(ws:
|
|
39
|
+
constructor(ws: WebSocket);
|
|
60
40
|
/** Resolves once the socket is open; rejects if it fails to open. */
|
|
61
41
|
whenReady(): Promise<void>;
|
|
62
42
|
/** The subprotocol the server selected (`""` until open / if none). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../src/channel.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../src/channel.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;CAC7D,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,WAAY,YAAW,SAAS;;IAW3C,YAAY,EAAE,EAAE,SAAS,EAgCxB;IAED,qEAAqE;IACrE,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAEzB;IAED,uEAAuE;IACvE,IAAI,QAAQ,IAAI,MAAM,CAErB;IAyBD,IAAI,IAAI,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAKjC;IAEK,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAe3C;IAED,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAcrB;CACF"}
|
|
@@ -40,7 +40,7 @@ export class WsIoChannel {
|
|
|
40
40
|
// ArrayBuffer (not Blob); safe to set synchronously right after construction.
|
|
41
41
|
ws.binaryType = "arraybuffer";
|
|
42
42
|
this.#ready = new Promise((resolve, reject) => {
|
|
43
|
-
if (ws.readyState ===
|
|
43
|
+
if (ws.readyState === WebSocket.OPEN) {
|
|
44
44
|
resolve();
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
@@ -103,7 +103,7 @@ export class WsIoChannel {
|
|
|
103
103
|
}
|
|
104
104
|
async write(data) {
|
|
105
105
|
await this.#ready;
|
|
106
|
-
if (this.#closed || this.#ws.readyState !==
|
|
106
|
+
if (this.#closed || this.#ws.readyState !== WebSocket.OPEN) {
|
|
107
107
|
// Fail loud: a silently-dropped write would strand a protocol frame and
|
|
108
108
|
// deadlock the notary (it never replies) — the exact hazard the io.rs
|
|
109
109
|
// write-completion fix guards against on the Rust side.
|
|
@@ -118,7 +118,7 @@ export class WsIoChannel {
|
|
|
118
118
|
this.#ws.send(data.slice());
|
|
119
119
|
}
|
|
120
120
|
close() {
|
|
121
|
-
if (this.#closed || this.#ws.readyState ===
|
|
121
|
+
if (this.#closed || this.#ws.readyState === WebSocket.CLOSED) {
|
|
122
122
|
this.#onEof();
|
|
123
123
|
return Promise.resolve();
|
|
124
124
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel.js","sourceRoot":"","sources":["../src/channel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"channel.js","sourceRoot":"","sources":["../src/channel.ts"],"names":[],"mappings":"AA0BA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,OAAO,WAAW;IACb,GAAG,CAAY;IACxB,kEAAkE;IACzD,MAAM,GAAiB,EAAE,CAAC;IACnC,gEAAgE;IACvD,QAAQ,GAA2C,EAAE,CAAC;IAC/D,8EAA8E;IACrE,MAAM,CAAgB;IAC/B,+EAA+E;IAC/E,OAAO,GAAG,KAAK,CAAC;IAEhB,YAAY,EAAa;QACvB,IAAI,CAAC,GAAG,GAAG,EAA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