Skip to content

node: an under-folding voucher credits 0 bytes instead of rejecting with the resume bundle, stalling the stream 10s #2167

Closed

Description

@thiras

Summary

A node silently credits 0 bytes for a voucher that under-folds the lane's live hash chain, then waits for a proof the client never sends. The stream hangs until proof read timed out after 10s, the client sees frame I/O error: early eof, fails over, and re-fetches the entry from another provider. On the testnet every tiny bundle entry routed to an affected node cost ~10.9 s.

Evidence (testnet, 2026-09-26, nodes on 74b13a5c)

decdn bundle pull --hash 9194000d… --namespace 1 (mistral-7b-instruct-v0.3), pool 0xcb5986…:

  • Client: 9 of the first 10 entries fail at fra1 (0xa43d…) with frame read failed: frame I/O error: early eof, each ~10 s after start, then succeed on failover. A 116-byte entry takes 10.9 s.
  • fra1 Tempo serve_stream (trace 08110f426b81906e9083adffcf2e5c13): proof 2 of at most 8 for a 202-byte chunk (202 bytes owed, 0 more queued): proof read timed out after 10s. Proof 1 credited nothing.
  • The same shape hits nbg1 for an earlier client process on the same pool (peer 24b77e…, trace 6f8f7f03ff19ad1f596481770ea1c122: after payment: proof 1 … proof read timed out after 10s). Earlier CLI runs on this pool (0458fa…, 24b77e…) left live chains on the fleet's lanes.
  • Counter: decdn_serve_stream_client_declined_total on fra1 rises by 18–20 over the pull.

Cause

  1. The lane holds a live chain from an earlier client process (verified_index = k'). The new CLI process has no epoch loaded, so its first voucher carries a different (sealed) root, with an amount between the lane's signed last_amount and its live claim (last_amount + k'×price).
  2. LaneState::advance_presigned refuses it correctly as AmountRegression { last: live_claim } (crates/incentive/src/lane.rs:815-821). Its comment intends a loud rejection that carries the resume bundle.
  3. verify_voucher maps every AmountRegression to benign "already satisfied" (crates/node/src/handlers/client/voucher.rs:763-786). The only exception is same-amount-more-bytes. It then credits credit_advance(…) = 0.
  4. stale_resume_bundle (voucher.rs:839-851) compares against the signed prior_last_amount, not the live claim. The voucher is above that, so no bundle is sent.
  5. The node's recoup loop (delivery.rs recoup phase) waits for proof 2 and times out.

The benign arm conflates two different cases:

  • Sibling already settled. The amount is at or below last_amount. This is benign.
  • Under-folds the live chain. The amount is above last_amount but below the live claim, under a different root. The payer must be told the fold it owes.

Fix shape

  • In the AmountRegression arm, when amount > state.last_amount() or the voucher's root differs from the live one, reject with watermark_bundle_for_reject(AmountRegression, state) instead of crediting 0. Or make stale_resume_bundle compare against the live claim.
  • Separately, find out why the client's persisted accrual trails what the node verified. lane.rs:796 says no honest payer reaches this. A reveal whose send errored locally but still reached the node is the likely path. This part is unconfirmed.

Tests

No node-level test drives an under-folding voucher through commit_one_proof. The existing coverage is the lane-level refusal (lane.rs ~1786/1828) and the reason mapping only.

Metadata

Metadata

Assignees

Labels

area:nodearea:paymentskind:bugruststatus:mainnet-blocking

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions