Skip to content

client: a delegated client's lane watermarks are never persisted #2435

Closed

Description

@thiras

Problem

A delegated client (one that pays under a dcap1 capability from a pool it does not own) never persists its lane watermarks.

After a fetch, the lanes record their progress through ProgressWrite::apply → BuyerPoolStore::{advance,rebase}_progress with owner = self_address. The redb store keys every lane write on the owner index (buyer_pool_table.rs, write_lane). A delegate owns no pool row, so each write returns AdvanceOutcome::UnknownPool and is dropped. The only trace is a warn! from persist_watermark.

This has two consequences:

  1. Resume. A delegated lane resumes from zero on the next run (build_delegated_pool_ctx reads get_by_pool_id(grant.pool_id) and finds nothing). The node then answers the first stale voucher, and the lane has to resync. That costs a round trip, and it fails outright once the resync budget runs out.
  2. Funding signal. ADR 039 § Client SDK funding signal says headroom is "the cap minus the vouchers signed under the key across all lanes, including earlier fetches in local records". There are no such local records for a delegate. So, across restarts, RunningLow undercounts the spend and can fire late. Within one run the CredentialSlot tracks spend in memory, so a single long run is unaffected. A bundle pull an embedder restarts is affected.

Proposed direction

Persist delegate lane progress keyed by (pool_id, signer, provider) with no owner row. This could be a delegate-lane table in the buyer store, or a row kind that carries lanes but no deposit. Then read it back in build_delegated_pool_ctx and in the slot's record_spend seed. This is a buyer-store schema change, so it reseeds lanes on the fleet. Pre-mainnet, it needs no migration.

Found while planning #2429. It is out of scope there, which moves the bundle pull into decdn-client and wires the live credential swap.

Activity

  1. added
    kind:feature
    rust
    on Oct 12, 2026
  2. self-assigned this
    on Oct 12, 2026
  3. assigned and unassigned on Oct 12, 2026
  4. moved this from Backlog to In progress in deCDNon Oct 12, 2026
  5. added a commit that references this issue on Oct 12, 2026
    21c06e1
  6. moved this from In progress to Done in deCDNon Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind:featurerust

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions