Repository navigation
Description
Context
The two-tier buyer deposit feature (initial + working deposit, PR for claude/cli-config-auto-top-up-71bc18) ships:
- Config split:
buyer_initial_deposit_micro_usdc/buyer_working_deposit_micro_usdc - CLI: opens at initial, proactive low-water refill toward working, and a reactive mid-fetch top-up on genuine
InsufficientDeposit(with content-space paid-frontier resume, funder-gated) - Node node-to-node: opens at initial + proactive graduation toward working on reuse
The one piece intentionally deferred is the reactive mid-pull top-up on the node's node-to-node cache-miss buyer leg.
Why it was deferred (architecture)
The node's node-to-node buyer leg always calls stream_fetch_shared with byte_offset == 0 (crates/node/src/node_origin.rs, ~line 2000): it buffers the whole blob and has no partial/paid-frontier resume. A reactive top-up there would retry from zero and re-download + re-pay the entire delivered prefix — the same double/under-pay class the CLI leg had to solve with sink::content_paid_frontier. Worse, after genuine exhaustion, re-fetching from 0 re-spends the fresh working deposit on already-delivered bytes and can immediately re-exhaust, so it cannot make progress.
What it needs
Convert the node miss path from the buffered stream_fetch_shared (byte_offset==0) to a resumable progressive pull (as the CLI already uses via open_progressive_pull + content_paid_frontier), so the node can top up and resume at the paid frontier without re-paying. Then add the reactive top-up (funder-gated — the node is its own funder, so the gate passes) bounded by a top-up attempt budget, reusing the genuine_exhaustion validator and content_paid_frontier from crates/client-pull.
Scope note
Lower urgency than the CLI leg: the node already graduates channels across pulls (proactive refill on reuse handles the common "channel drains over many pulls" case). The gap is only a single node-to-node pull larger than the initial deposit.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
github-actions commentedon Jul 30, 2026
🎯 Triage report
This is a well-scoped, clearly deferred follow-up to the two-tier buyer deposit feature (initial + working). The node's node-to-node cache-miss buyer path currently buffers the entire blob via
stream_fetch_shared(byte_offset == 0), making reactive mid-pull top-up impossible without re-downloading and re-paying the already-delivered prefix. The fix requires converting the node miss path to the same resumable progressive pull mechanism the CLI already uses (open_progressive_pull+content_paid_frontier), then wiring in the reactive top-up bounded by an attempt budget. The issue author explicitly flags this as lower urgency — the proactive graduation on channel reuse already handles the common case; the gap is only a single node-to-node pull exceeding the initial deposit.📊 Assessment
enhancement,technical,prod-blocking,rust,medium💡 Notes and suggestions
Approach:
The CLI leg is the direct template. The path is:
crates/node/src/node_origin.rs(~line 2000), replace thestream_fetch_shared(byte_offset=0)+ buffered sink withopen_progressive_pullfromcrates/client-pull.content_paid_frontierto track the paid progress point.InsufficientDepositusinggenuine_exhaustionvalidator + the node-is-own-funder gate (already true, so the gate passes unconditionally).Key files:
crates/node/src/node_origin.rs— the miss path to convertcrates/client-pull/src/lib.rs—open_progressive_pull,content_paid_frontier,genuine_exhaustioncrates/client-pull/src/sink.rs—content_paid_frontierimplementationSuccess criteria (from issue):
Add this agentic workflow to your repo
To install this agentic workflow, run
feat(buyer): two-tier deposit — open small, graduate to a working bal…
fix(node): address #1600 review — frontier clamp, joinable refill slo…
feat(node): reactive mid-pull deposit top-up on the node-to-node buye…
fix(node): keep the post-top-up delivery leg in the delivery-speed sc…
feat(node): don't reactively top up a near-expiry channel mid-pull (#…