You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
node: the per-stream credit floor is free, with no cross-stream debt, so a client can download without ever paying #2767
The node keeps no memory of unpaid delivered bytes across streams. Every stream opens with a free credit floor, and nothing bounds how many streams a never-paying client opens in sequence.
crates/node/src/handlers/client/mod.rs:2270-2277 — credit_window at paid = 0 returns the floor: one voucher interval (CHUNK_BYTES = 1 MiB, crates/protocol/src/client.rs:56) plus VERIFY_LAG_BYTES (16 KiB, crates/client/src/pacer.rs:57).
crates/node/src/handlers/client/delivery.rs:370 and serve_leg.rs:344 — that window opens every stream.
crates/node/src/handlers/client/mod.rs:544-555 — FloorReservation's drop releases the reservation with no surviving charge: "bounding un-vouchered floor is the admission-time job of the pool ceiling and the per-signer live cap". Those two gates bound concurrent floors only, never sequential ones.
Attack
A client with any working lane (own pool with a tiny deposit, self-signed binding, own capability):
Request byte_offset = k·1 MiB, byte_len = 1 MiB. The whole range fits the opening window, so the node sends all of it.
Never pay. Reset the stream, move to k+1.
The pool is never debited, so the deposit stays fully reclaimable. The only brake is the per-peer request rate limit — and peer NodeIds cost nothing, and the per-source/per-IP layers do not bind relay-only connections (#2505). On a cache miss it is worse: the window pull-through path (crates/node/src/handlers/client/window.rs) pays the upstream node real USDC for the window before the client pays anything, so the victim loses buyer funds on every request.
ADR 003 §Credit window states "a payer that abandons stream after stream gets no more unpaid bytes than the paid total allows". That claim is false at paid = 0, where the floor is granted per stream for free.
Fix
Track unpaid-delivered bytes per lane (and per signer) across streams; while debt is outstanding, shrink or refuse the floor, or require the debt paid at the next admission
Loopback test: a never-paying client that opens streams in a loop gets a bounded cumulative free-byte total
Reconcile the ADR 003 §Credit window claim with the implemented bound
Activity
fix(node): keep an abandoned stream's free floor as floor debt (decdn…