wai-quantum-serve 0.5.1: limits a request cannot pass, and a body is read whole or refused #235

Merged
dcharlot merged 1 commit from wai/quantum-serve-limits into main 2026-10-13 06:38:19 -04:00

2026-10-13

Transaction Science
wai-quantum-serve 0.5.1: limits a request cannot pass, and a body is read whole or refused
All checks were successful
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 53s
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 2m45s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 1m30s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 4m39s
standards workspaces build + test / aac-rs (pull_request) Successful in 2m44s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 57s
standards workspaces build + test / mesh-rs (pull_request) Successful in 56s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 1m33s
standards workspaces build + test / map-rs (pull_request) Successful in 59s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 2m0s
standards workspaces build + test / openpay (pull_request) Successful in 2m56s
lockfiles / every Cargo.lock is current (pull_request) Successful in 35s
no-vanity-metrics / Scan committed Markdown for vanity metrics (pull_request) Successful in 3s
no-vanity-metrics / WAI public text names no comparison (pull_request) Successful in 3s
no-vanity-metrics / WAI public text names no company or product (pull_request) Successful in 3s
standards workspaces build + test / arl-rs (pull_request) Successful in 1m14s
standards workspaces build + test / eoc-rs (pull_request) Successful in 2m8s
standards workspaces build + test / jcp-rs (pull_request) Successful in 1m38s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 1m15s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 1m17s
standards workspaces build + test / proof-rs (pull_request) Successful in 1m28s
standards workspaces build + test / sense-rs (pull_request) Successful in 1m9s
standards workspaces build + test / sandbox-rs (pull_request) Successful in 2m24s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 2m36s
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 4m18s
A circuit the algorithm library builds is small (its builders clamp to 12
qubits), but a caller's own OpenQASM could name 26 qubits and any number
of gates, and a receipt any number of shots: one request could hold a
host's memory and CPU. Every such request is now refused before it is
simulated or sealed:

- a POST body over 256 KiB: 413. Before, the body was cut at 4 MiB and the
  cut text parsed as if it were the request;
- a circuit on more than 20 qubits, or of more than 2^27 amplitude
  updates (gates × 2^n): 422. Served as a component on an M4 Max core,
  2^30 took 15 s and 2^27 about 2 s;
- a measurement of more than 1,000,000 shots: 422;
- top above 1024 is read as 1024.

GET / states the limits. The module docs say a host should bound the
component too: time per request, memory per instance, instances at once.

Checked under wasmtime serve 49.0.1 with a 10 s timeout, a 256 MiB memory
limit and a pool of 8 memories: every endpoint, every refusal, a tampered
receipt refused, a circuit at the work limit run in 1.9 s, and of 14
concurrent requests at that limit 8 served and 6 refused at once by the
pool, the server unaffected after.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 02:43:12 -04:00