Repository navigation
Description
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)
- 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 - Rerun those two with
--data-dir ~/.decdn/client-<name>, each holding a copy of the samekeystore.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_totalrose by ~67 across the fleet in the first 10 min. The hour before it was 0. Every sampled line isrejecting 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 …witherror=the lane ledger healed, but this source spent its resume budget(770–974 per run at the 18-minute mark), plusdelivery 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
AlreadyOpenmessage and its doc comment (crates/incentive/src/store.rs) stop recommending a separate--data-dirfor concurrent pulls from one wallet. They would point at a single-process multi-pull path instead. Thegatewayworker 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.
Activity
fix(client): count other signers' pool spend from chain before funding (
fix(client,cli)!: sign each data dir's owned lanes with a derived key (…