Repository navigation
Description
Severity: MEDIUM — a load-shed refusal costs the refusing node reputation on one layer and nothing on the other. Verified against main @ 8b437de.
Location
Emitters (all genuine limiter rejections, no catch-alls):
crates/node/src/handlers/client/dispatch.rs:46—limiter.acquire(&conn)reject →conn.close(VarInt::from_u32(APP_ERR_RATE_LIMITED), reason)crates/node/src/handlers/client/dispatch.rs:210— per-connection stream cap →reset_stream(.., APP_ERR_RATE_LIMITED)crates/node/src/handlers/probe.rs:255and:300—ConnectionLimiterand the three-layer probe limiter (Global/PerIp/PerPeer)crates/node/src/handlers/dht.rs:194,:257,:312
The node spends a 250 ms REJECTION_CLOSE_TIMEOUT ack-wait (probe.rs:38, client/dispatch.rs:50) specifically "so the peer reliably observes the 0x10 RATE_LIMITED code and the layer-label reason byte".
Consumers: none. rg 'ApplicationClose|ConnectionError::|close_reason|error_code\(\)' across crates/client-pull/src, crates/node/src/node_origin, crates/node/src/client_requester returns zero hits. Every APP_ERR_RATE_LIMITED reference outside the emitters is the definition (crates/protocol/src/lib.rs:61), a doc, or a test assertion.
Where the code is destroyed: crates/client-pull/src/probe.rs:129-132 — the close arrives at open_bi() and is flattened to anyhow!("open_bi failed: {e}").
Where it becomes a penalty: crates/node/src/node_origin/mod.rs:942-947 — the catch-all Err(err) arm of probe_candidate records Outcome::Unreachable, which crates/reputation/src/local.rs:402 scores as a fully negative 0.0 sample.
Impact
The handler-level shed already honours ADR 041:13 ("Refusing is not slashable. A refused client re-routes ... and pays only a latency cost") and #1756 ("Refusing carries no penalty"): LoadShedHit / LoadShedMiss collapse to a signed NotFound (handlers/client/mod.rs:723-728), which the requester maps to RefusalVerdict::Transient (node_origin/mod.rs:2019) — 30 s suppression, no reputation effect. The comment at that line says Overloaded is backpressure "which the code's own policy says to respect rather than punish".
The connection-level shed reaches the requester as a bare transport failure and costs a 0.0 sample. Same condition, opposite verdict, decided by which layer shed.
RejectReason::GlobalFull (crates/node/src/dispatch.rs:95) is node-wide semaphore exhaustion — not the fault of the caller at all — yet every peer probing during that window records the penalty simultaneously. Under the quadratic term in ADR 001 the down-ranking is self-reinforcing; recovery is the 3-day half-life only.
ADR 013:314 already concedes the receiving-side backoff layer is "yet to be built" for 0x00 and that without it the clause "is purely normative"; line 318 states the 0x10 MUST NOT with no such caveat.
Complication
probe.rs:303-311 deliberately skips the ack-wait on ProbeRejectLayer::Global ("a flood would otherwise park a task per rejection"). A requester-side consumer would therefore repair the PerSource / PerIp / PerPeer cases, but GlobalFull — the case with the least peer culpability — would still often arrive as a bare transport drop.
Fix direction
Either:
- Consume the close code requester-side (
client-pull/src/probe.rs,node_origin) and treat0x10the way the handler-level shed is already treated — brief suppression, noOutcome— accepting thatGlobalFullstays partially indistinguishable; or - Delete the emitters and the ack-wait, and amend ADR 013:318 to carry the same caveat as line 314.
Today the emitter is the dead code. Reading it adds no mechanism — it completes one the protocol already pays for on the wire — and a peer cannot abuse it to dodge scoring, since dodging by refusing service means receiving no traffic.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsDone
Activity