Repository navigation
Closed
Labels
area:nodedecdn-node daemon: runtime, handlers, admin RPC, serve patharea:paymentsPools, vouchers, redeem, reclaim, staking (incentive crate and chain)kind:testTest coverage, flakes, fixtures or the e2e harnessprio:lowWhen convenient
Description
Hardening and test follow-ups for the mid-stream pool-solvency re-check in the paid delivery loops. Line refs are against current main.
- Loop-level solvency test for the serve-miss leg.
drained_pool_stops_stream_after_its_floor_is_repaid(crates/node/tests/client_loopback.rs:6761) drives the cache-hit delivery loop (crates/node/src/handlers/client/delivery.rs:615). The mirror re-check in the serve-miss leg (crates/node/src/handlers/client/serve_leg.rs:659) has no loop-levelPoolExhaustedtest. Both sites call the same unit-tested helper,pool_funds_committed(crates/node/src/handlers/client/mod.rs:2381). A test would pair the serve-miss fixtures withDrainingPoolView(crates/node/tests/client_loopback.rs:6533) andspawn_handler_server_with_draining_pool(crates/node/tests/client_loopback.rs:6561). - Observability of the mid-stream re-check.
- When
pool_view_status_cached(crates/node/src/handlers/client/mod.rs:1662) returnsNone, the re-check is skipped by design (fail-open; the on-chain redeem is the backstop), but nothing records the skip. Add a debug log or counter in that arm so an operator can tell "check passed" from "check did not run". Sites:delivery.rs:614,serve_leg.rs:658. - On the stop path,
write_reject(...).await?(delivery.rs:617,serve_leg.rs:661) runs before theServeEnd::Stoppedreturn. If the client has already gone, the write error routes throughlog_stream_end(crates/node/src/handlers/client/dispatch.rs:284), soserve_stream_midstream_pool_exhausted(crates/node/src/handlers/client/outcome.rs:149) does not count the stop and its warn does not fire. Log and meter before the write.
- When
- (optional) Zero-rate edge.
min_payment(crates/incentive/src/rate.rs:104) prices a floor at zero whenrate_per_mb == 0, so admission (try_reserve_floor,crates/node/src/handlers/client/mod.rs:2403) and the direct-serve re-validation (crates/node/src/handlers/client/dispatch.rs:1422) pass at anyremaining. Nothing billable is at stake at a zero rate, and thepool_funds_committeddoc states the caveat. For uniformity, the re-validation could route throughpool_funds_committedtoo.
Metadata
Metadata
Assignees
Labels
area:nodedecdn-node daemon: runtime, handlers, admin RPC, serve patharea:paymentsPools, vouchers, redeem, reclaim, staking (incentive crate and chain)kind:testTest coverage, flakes, fixtures or the e2e harnessprio:lowWhen convenient
Type
Fields
Priority
None yet
Projects
- StatusShow more project fieldsDone
Activity