Skip to content

client: separate --data-dir runs adopt the same on-chain pool and collide on lane watermarks (UnderFold) #2468

Closed

Description

@thiras

Summary

Following the advice in StoreError::AlreadyOpen to run concurrent pulls, which is to give each invocation a separate --data-dir, makes the processes collide on one on-chain pool. A fresh data dir has no pool row, so adopt_owned_pool (crates/client/src/funding.rs) adopts the wallet's newest solvent pool. Every process then signs vouchers for the same (pool, signer, provider) lanes from its own independent watermark. Nodes reject the ones that fall behind as UnderFold. Clients burn their resume budget, abandon the lane, and re-fetch the bytes elsewhere.

Repro (testnet, 2026-10-15 20:45 UTC, decdn 0.1.0)

  1. Run three decdn get 'decdn:<hash>/?ns=1' (mistral, gpt-oss, whisper) at once with the default data dir. Two of them fail at once with:
    another decdn process is using the pool store at ~/.decdn/client/buyer-pools.redb — run one fetch/pull at a time per --data-dir, or give each invocation a separate --data-dir
  2. Rerun those two with --data-dir ~/.decdn/client-<name>, each holding a copy of the same keystore.json. Both log
    adopted a live buyer pool this wallet already owns on chain, instead of opening a second one pool_id=0xcb59860b….
    That is the same pool the default-dir process uses.

Observed

  • Node side: decdn_serve_stream_voucher_rejected_total rose by ~67 across the fleet in the first 10 min. The hour before it was 0. Every sampled line is rejecting a payment proof proof=voucher reason=UnderFold pool_id=0xcb59860b… signer=0x4eeA….
  • Client side: each run logged ~1,900–2,100 WARNs. The main ones are a lane faulted … with error=the lane ledger healed, but this source spent its resume budget (770–974 per run at the 18-minute mark), plus delivery refused: NotFound (270–550 per run).
  • All three runs finished with 0 failed and the usual byte counts, but:
    • whisper took 31m22s, mistral 29m43s and gpt-oss 31m43s. Solo runs take ~6–8 min each, so the concurrent batch was slower than three back-to-back runs (~20 min).
    • The NIC received 71.7 GB for 52.6 GB of downloaded payload, so ~36% of the traffic was wasted on abandoned streams.

Expected

Either of these:

  • A process with its own data dir does not adopt a pool that another live process is spending from. For example, adoption could skip pools that another data dir has claimed, or open a fresh pool when the adopted lanes' on-chain watermark races ahead.
  • Or the AlreadyOpen message and its doc comment (crates/incentive/src/store.rs) stop recommending a separate --data-dir for concurrent pulls from one wallet. They would point at a single-process multi-pull path instead. The gateway worker from feat(cli): decdn gateway runs pulls at once on one long-lived worker #2462 is browser-only today.

Unsafe advice is the immediate bug. The store lock exists to stop two processes from corrupting one voucher watermark (#942), and the recommended workaround reproduces exactly that, only one level up, on chain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions