Repository navigation
Description
Component
node (decdn-node daemon)
Version
Testnet binary decdn-node 0.0.0 (BuildID 257f6a5c06c8…). The source analysis below is against main at 2b3d8e47.
Operating system
Ubuntu 26.04 x86_64, DigitalOcean droplets with 2 vCPUs (fra1, lon1)
Steps to reproduce
Observed on the Arbitrum Sepolia testnet. There is no deterministic repro yet. Here is the mechanism, read from the source:
- A client opens a paid
cdn/client/v1stream that the node serves from cache, so it goes throughClientHandler::deliver(crates/node/src/handlers/client/delivery.rs:195). - The client answers a completed interval with a proof whose watermark advance is smaller than the interval's
delta.credit_advance(crates/node/src/handlers/client/voucher.rs:119) caps the credit at the watermark:credited_bytes = min(paid_credited + delta, watermark) − paid_credited, so0 < credited_bytes < delta. - The recoup phase takes the
credited_bytes > 0arm (delivery.rs:410). It adds onlycredited_bytestopaid, but it pops the wholedeltafrompending(delivery.rs:412). The shortfalldelta − credited_bytesstays indelivered − paid, butpendingno longer tracks it. - The shortfalls add up. Once
delivered − paid ≥ windowwhilependingis empty andnext_chunkis stillSome, the outerloopatdelivery.rs:310does this on every pass:- The deliver phase breaks on the window check before any
.await. - The recoup phase has nothing to collect, because
pendingis empty. - It calls
release_if_repaid(min_payment(paid, rate_per_mb)), and thendoneisfalse. - The pool/signer re-checks are gated on
collected_any(false), and so is the takedown check. - The loop goes around again.
- The deliver phase breaks on the window check before any
No branch awaits, so the task never yields. It spins forever on a tokio worker thread. Every stream that hits this takes one worker. With worker_threads == nproc, two such streams on a 2-vCPU node stall the whole runtime: serving, watchers, logging, and the /metrics endpoint all stop.
The miss path, serve_leg (crates/node/src/handlers/client/serve_leg.rs), has the same pop-the-whole-delta accounting (serve_leg.rs:327). There, the no-progress guard (serve_leg.rs:492) turns the same state into a clean ClientAbandoned stop. deliver has no equivalent guard.
A paying client decides how far each voucher moves the lane watermark. So this state can probably be triggered on purpose: a client can wedge one worker per stream it opens, which is a remote liveness DoS against any node that serves it from cache. Concurrent streams on one lane may also reach it by accident, because they share the watermark.
Expected behavior
- A proof that credits less than the outstanding interval leaves the unpaid remainder owed. The loop keeps collecting proofs for it, up to
MAX_PROOFS_PER_CHUNK, instead of dropping it frompending. - No iteration of the serve loop can go around without either making delivery/payment progress or awaiting. An iteration that does neither ends the stream, as
serve_legalready does.
Actual behavior
On 2026-09-23, two testnet nodes wedged in this state about 20 minutes apart:
| node | last log line (UTC) | CPU | up |
|---|---|---|---|
| fra1 | 19:47:50 | 57% at ~19:30 → 100% by ~19:50 | 0 |
| lon1 | 20:05:12 | 56% at ~20:00 → 100% by ~20:15 | 0 |
- CPU rose in steps: one worker at a time locked up, until no worker was left for logging or metrics.
- systemd still reports
decdn-node.serviceasactive/runningon both nodes, withNRestarts=0. There was no panic, OOM kill, or exit. Memory was flat. - On lon1,
top -Hshows bothtokio-runtime-workerthreads at ~100% CPU, with ~2.5 h of CPU time each.perf record -g -t <worker tids>for 10 s gives:
28.65% ruint::mul::<impl ruint::Uint<_,_>>::overflowing_mul
25.22% ruint::div::<impl ruint::Uint<_,_>>::div_rem_by_ref
21.96% decdn_incentive::rate::min_payment
14.42% decdn_node::handlers::client::dispatch::<impl ClientHandler>::serve_stream::{{closure}}
7.65% decdn_node::handlers::client::FloorReservation::release_live_repaid
That is exactly the body of the empty loop: min_payment (U256 mul/div) plus release_if_repaid → release_live_repaid, whose repaid.swap short-circuits and returns at once. Nothing else runs.
The fleet overview dashboard's "Nodes up" (sum(up)) dropped from 7 to 5. That is the only signal, because both nodes look healthy to systemd.
Logs
# fra1 — last decdn-node line before the silence (DEBUG)
2026-09-23T19:47:50.440410Z DEBUG decdn_node::handlers::client::dispatch: client stream ended with error
error="proof stream read failed: connection lost: peer-side fault"
span=serve_stream{direction=inbound outcome=failed hash=4e302437…1014 pool_id=0xdb5db181…447d}
# lon1 — last lines (INFO/WARN)
2026-09-23T20:03:26.935876Z INFO decdn_node::fee_shares_watcher: operator fee share updated from chain bps=6000
2026-09-23T20:05:12.771084Z WARN decdn_node::payment_settlement: pre-redeem watermark reconciliation failed; submitting on the contract's own no-op guard error="429 Too Many Requests"
# ...then nothing, while the process keeps running at 100% CPUProposed fix
- Accounting (
delivery.rsandserve_leg.rs): on0 < credited_bytes < delta, subtractcredited_bytesfrom the frontpendingentry instead of popping it, and pop only once the entry reaches zero. Keep theMAX_PROOFS_PER_CHUNKbudget per entry so a payer that keeps crediting slivers still hits the bound. - Liveness (
delivery.rs): add theserve_legno-progress guard todeliver, so an iteration that delivers nothing and credits nothing stops the stream instead of spinning. - Regression test: a
deliverstream whose proofs credit partial deltas, capped at the watermark, must either finish fully paid or stop. It must never loop without yielding, which you can check with atokio::time::timeouton acurrent_threadruntime.
Operational note: a wedged node looks active to systemd, so nothing restarts it. fra1 and lon1 stay down until someone restarts them by hand.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsDone
Activity
fix(node): meter serve-loop payment faults by cause and deflake the h…
feat(node): heartbeat the systemd watchdog from the runtime and test …