Repository navigation
Description
Evidence
pkgs/id/src/serve_proxy.rs:52-56 defines finite initial stream and connection credits, but CreditWindow::grant at lines 415-418 uses saturating_add with no upper bound or error result. Each decoded WINDOW_UPDATE can grant a u32 amount (window_update_amount, lines 234-247); repeated valid updates can therefore grow available credit arbitrarily up to u64::MAX. Once the mux uses this primitive, the sender can be authorized to exceed the receiver's bounded in-flight buffers. Saturation only hides integer overflow; it does not enforce a finite credit ceiling.
The relay backpressure design explicitly requires hard finite per-stream and aggregate per-connection byte limits, and says credit returns only as bounded buffer space is released (doc/2026-11-08T11-08-53Z_design_id5813_relay_proxy_protocol/2026-11-08T11-08-53Z_design_id5813_relay_proxy_protocol.md:85-100). The serve-proxy issue #7569 is closed and #5792 remains the protocol design tracker, but neither specifically tracks a maximum-credit guard. All-state searches for CreditWindow, WINDOW_UPDATE, and bounded flow control found no matching implementation issue. The currently open #8951 concerns frame stream/sequence semantics, not credit accounting; no open PR implements this guard.
Why it matters
A peer can repeatedly send valid credit updates and defeat the flow-control bound that is supposed to keep per-stream and per-connection buffering finite. This risks unbounded queued/in-flight data or inconsistent accounting rather than pausing at the receiver's actual capacity.
Acceptance criteria
- Give each credit window an explicit finite ceiling tied to the effective per-stream/per-connection limits (do not invent a universal deployment limit where the design delegates it to configuration).
- Make a grant that would exceed the ceiling or overflow an explicit protocol/resource error; do not silently saturate or mutate the window.
- Ensure mux-level accounting enforces both per-stream and aggregate per-connection limits before accepting DATA or returning credit.
- Add tests for normal credit return, exact-ceiling grants, over-ceiling/repeated
WINDOW_UPDATEgrants, and unchanged state after refusal.
Activity
developing-today commentedon Nov 12, 2026
CODE-2730
dezren39 commentedon Nov 12, 2026
Triage update against current main
be6bf9a3af0e04cde337b40c33974601cbcde106:CreditWindow::grantis unbounded (pkgs/id/src/serve_proxy.rs:378-418);WINDOW_UPDATEamounts decode asu32(:234-245). The current code has no mux/channel/DATA-buffer path that applies this primitive, so this is a latent authorization-boundary gap, not a reproduced live buffer-limit bypass.STREAM_WINDOW/CONNECTION_WINDOWare initial credits, not specified maxima. The design requires finite per-stream and aggregate connection ceilings, but this slice has no effective configured/negotiated ceiling source. Setting the initial credit as the maximum would be an unrecorded protocol decision.serve_proxy.rs; I left it untouched and will not open an overlapping PR.The gap is confirmed in the standalone primitive, but implementation is blocked until the effective ceiling source / mux scope is settled and the overlapping PR is no longer Drew-owned. Keeping the issue open; no code change or competing PR.
11 remaining items
dezren39 commentedon Nov 23, 2026
Lane felix picking up #8970 for a fresh done-check against current origin/main (the primitive fix landed via PR #10977; verifying what remains).
dezren39 commentedon Nov 23, 2026
Verification / disposition record — lane felix, 2026-11-23, against origin/main
1845798b7f.Criteria 1, 2, and 4 are met on current main (landed by PR #10977, merged 2026-11-17,
9701c173600d; re-verified in source today):CreditWindowcarries a construction-timeceiling. The built-inper_stream()/per_connection()windows are fixed-size at their configured initial credit, so aWINDOW_UPDATEcan only return credit the sender actually consumed; a deployment that negotiates a larger maximum constructs the window with that ceiling viaCreditWindow::new(initial, ceiling). No universal deployment limit is invented — the ceiling is parameterized from the effective configuration, as the criterion requires.grant()useschecked_addand returns an error when the grant would overflow or push the window past its ceiling; the window is left unchanged on refusal. The old unboundedsaturating_addis gone.pkgs/id/src/serve_proxy.rscarries the ceiling unit tests plus thecredit_is_never_exceededproptest covering normal credit return, exact-ceiling grants, over-ceiling/repeatedWINDOW_UPDATEgrants, and unchanged state after refusal. Fresh remote evidence: fleet-command run 45183677781 (developing-today/fleet), conclusion success:cargo test --lib serve_proxyat1845798b7f— 15 passed / 0 failed.Criterion 3 (mux-level accounting) remains open, gated on the mux slice. Verified fresh today: nothing in the repository consumes this primitive yet —
CreditWindowis referenced only insideserve_proxy.rs, there is noserve_proxy::consumer, and no mux/channel DATA path exists in the source. The code's own doc comments assign the remaining work to that future slice ("the leg's reaction to a peer that overruns is an ERROR frame withErrorReason::CreditOverrun, built by the mux slice"; "grant()… the mux slice maps it toErrorReason::CreditOverrun"). There is no bounded slice to land here: criterion 3 can only be implemented inside the mux when it lands.Resume condition: when the mux slice lands (protocol design tracker #5792), wire the per-stream and aggregate per-connection
CreditWindows into its DATA-accept and credit-return paths and mapgrant()errors toErrorReason::CreditOverrun; that wiring closes this issue. Until then the issue stays open for criterion 3 only. Lane felix claim released.dezren39 commentedon Nov 23, 2026
Picked up by
felix— working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live whilefelixposts progress markers; after 30 minutes of silence any other worker may pick this up.)dezren39 commentedon Nov 23, 2026
Released by
felix(outcome: free). Criteria 1/2/4 verified landed on main (PR #10977; fresh remote run 45183677781: serve_proxy 15/15). Criterion 3 (mux-level accounting) remains, gated on the mux slice landing (tracker #5792); resume then.dezren39 commentedon Nov 23, 2026
Picked up via
fleet agent next(shortlist rank 5) and re-verified against origin/main69645882c: criteria 1/2/4 remain landed (PR #10977, merged 2026-11-17). Criterion 3 (mux-level per-stream + aggregate DATA accounting) is still not startable — no mux/channel/DATA consumer exists on current main (onlypkgs/id/src/serve_proxy.rsmentions mux, and only in docs); the credit primitive has no DATA path to attach accounting to. Releasing as blocked on the mux slice landing; resume when a mux consumer exists.dezren39 commentedon Nov 23, 2026
Lane any-n — done-check against current
origin/main(2026-11-23 ~09:30 CST). No PR cut; no repo changes.Criteria 1, 2, 4 — hold verified on main (confirming lane felix; PR #10977 remains the landing):
pkgs/id/src/serve_proxy.rs:466-535—CreditWindowcarries construction-timeceiling;grant()useschecked_add, errors on overflow or over-ceiling, leaves the window unchanged.per_stream()/per_connection()fixed-size windows (lines 492-496).credit_is_never_exceededproptest covering normal return, exact-ceiling, over-ceiling/repeatedWINDOW_UPDATE, unchanged state on refusal.Criterion 3 (mux-level accounting) — still not landable, with one correction to the standing note:
CreditOverrunis referenced only insideserve_proxy.rs, and the only "mux" mentions are comments naming the mux as the future consumer. No open issue tracks building it (open-issue search for mux/relay returns only this issue plus unrelated items).status:done2026-11-17 with the decision posted), not a mux implementation landing. Criterion 3 needs a mux-implementation slice that does not exist yet; recommend filing it as a build issue (blocked-by nothing, effort above xs) rather than "resume when id: design: id broker / serve-proxy role (from #5671) #5792 lands".Remote test evidence — attempted, infra-blocked (4 runs, 0 usable):
developing-today-forks/fleetruns 45193794602 (cargo: command not found— default image has no toolchain), 45194898985 (failed, logs unarchived), 45201497822 (failed:rustlsbuild-script ENOENT from the sharedcargo-targetcache — poisoned cache path, not repo code), 45202698259 (cleanCARGO_TARGET_DIR, compiled ~10 min, then failed; logs andfleet-outputartifact unretrievable).pkgs/idis flaky right now. Latest good measured evidence stands: lane felix remote run 45183677781,serve_proxy15/15.Next slice: file the mux-accounting build issue (criterion 3, with
Requires:on the mux consumer), or re-runcargo test serve_proxyvia a venue with warm cache (laptop lane / nightly) once the runner cache is healthy.