Repository navigation
Description
Summary
Three small hardening and test items for capability handling in the cdn/client/v1 handler (crates/node/src/handlers/client/). None of them changes the wire format.
1. Give the admission refusal for an expired capability its own outcome
The admission gate in dispatch.rs refuses a lane whose capability is inside the node expiry margin with ServeRejectReason::SignerCapExhausted. The voucher and preimage paths refuse the same condition with VoucherRejectReason::CapabilityExpired.
The client sees no difference: both admission causes go out as StreamError::Unfunded. The operator does see one. Both land in the signer_cap_exhausted outcome, and the remedy text for that outcome says to raise the signer cap. For an expired capability, the remedy is a fresh capability.
Proposed:
- Add a node-local
ServeRejectReason::CapabilityExpiredthat maps toStreamError::Unfunded, so the wire stays unchanged. - Record it under its own outcome label.
- Update the outcome docs and the remedy text.
2. Meter capability intake drops
intake_capability drops a capability whose owner signature is not a recoverable EOA signature, is malformed, or recovers to an address other than the pool owner. Each drop only logs: at debug, or at warn for a wrong owner. No drop has a metric.
To the client, a dropped capability looks like an unknown-lane refusal, which is the same as an ordinary miss. So the operator cannot see how often intake drops capabilities, or why.
Proposed:
- Add a labeled counter, for example
decdn_capability_intake_dropped_total{reason}, with one label value per drop arm. - Keep the current log levels.
3. Add a wire-level test for an intake rejection
Intake rejections are covered only by unit tests that call intake_capability directly. Add a crates/node/tests/client_loopback.rs test that:
- sends a bound request through dispatch, with a pool view wired, that carries a capability intake refuses (for example one signed by a key other than the pool owner);
- asserts the refusal on the wire (unknown lane);
- asserts that the lane store holds no row for the lane.
This guards against a future registration path that skips intake.
Acceptance criteria
- An admission refusal for a capability inside the expiry margin records a distinct outcome label. The wire response is unchanged.
- Each intake drop arm increments a labeled counter, and a unit test covers each label.
- A loopback test covers one intake rejection end to end, including the lane-store check.
-
cargo clippy --workspace --all-targets -- -D warningsandcargo nextest run --workspace --no-fail-fastpass.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsDone
Activity
fix(cache,node): review follow-ups for #2631/#2801 — fault-cause fide…
fix(node,cache): capability intake/expiry visibility and fs origin fa…