Repository navigation
Closed
Labels
area:nodedecdn-node daemon: runtime, handlers, admin RPC, serve patharea:paymentsPools, vouchers, redeem, reclaim, staking (incentive crate and chain)kind:bugSomething does not behave as documentedprio:mediumScheduledrustDependabot: a Cargo update; use area: labels for Rust code otherwise
Description
Problem
ResolvingPoolView::status (crates/node/src/payment_settlement.rs) puts a pool into one negative cache in two cases:
- Verdict:
getPoolanswers, and the pool is absent or closed. - Fault:
getPoolreturns an RPC error, or times out underchain_events::timed(10 s). The timeout comes from node: admit-path chain reads have no timeout, so a hanging RPC skips the getAuthorization fallback #2271 / fix(node): bound admit-path chain reads and keep the RPC failure class in logs #2278.
Both cases use the same entry (negative: Mutex<HashMap<B256, Instant>>) and the same TTL (RESOLVE_NEGATIVE_TTL = 1 min). A fault says nothing about the pool. But one slow or failed read on a live, solvent pool refuses every request on that pool for the next 60 s.
The refusal is also hard to see:
- The client gets the same refusal as for a pool that does not exist.
decdn_serve_stream_rejected_pool_unconfirmed_totalcounts it with real verdicts.- The cache-hit path (
negative_cache_hit) returnsNoneand logs nothing. The operator sees one WARN, then 60 s of silent refusals.
Proposal
- Store why each entry exists:
VerdictorFault. - Keep
RESOLVE_NEGATIVE_TTLfor a verdict. - Give a fault a shorter TTL, for example a few seconds. Do not make it zero. During an RPC outage the cache still has to stop each request from waiting 10 s for its own
getPool. A short TTL still limits that to one read per pool per window. - Add a
debug!on the cache-hit path that names the reason. - Optional: count fault refusals separately from verdict refusals, so an operator can tell an RPC problem from a missing pool. The doc on the
pool_unconfirmedrejection inhandlers/client/mod.rssets that goal.
remember_negative and negative_cache_hit are pure helpers, so the TTL split is unit-testable without a provider. A paused-clock test with chain_events::test_support::hanging_provider can show that a timed-out pool is admitted again after the fault TTL.
Metadata
Metadata
Assignees
Labels
area:nodedecdn-node daemon: runtime, handlers, admin RPC, serve patharea:paymentsPools, vouchers, redeem, reclaim, staking (incentive crate and chain)kind:bugSomething does not behave as documentedprio:mediumScheduledrustDependabot: a Cargo update; use area: labels for Rust code otherwise
Type
Fields
Priority
None yet
Projects
- StatusShow more project fieldsDone
Activity
fix(node): give an admit getPool fault a short negative-cache window