You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Node-to-node buyer-side openChannel for cache-miss settlement #744
design:economicsToken economics, pricing, fee split, bond sizingkind:featureNew capability or a change to current behaviorrustDependabot: a Cargo update; use area: labels for Rust code otherwise
Split out from #327 (PR #743), which implemented the seller/provider on-chain PaymentChannel path. The buyer-side path is deferred.
Per ADR 003 §node→node, when a node pulls content from another node (typically an origin-backed node) on a cache miss, it pays via the same channel mechanism — i.e. it acts as the client: opens a channel against the upstream provider, signs cumulative vouchers as bytes arrive, and tops up / lets the upstream close & settle.
USDC approve handling for the channel deposit (first-channel one-time approval per ADR 003 § Deposit Economics).
Voucher signing on the buyer side (the decdn_incentive::voucher signing primitives already exist).
Channel lifecycle/bookkeeping for buyer-held channels (distinct from the seller-held channels the current PaymentChannelService tracks): deposit accounting, top-up, and reclaimExpired fallback if an upstream abandons a channel.
Decide the open-channel trigger policy (lazy on first miss to a given provider; channel reuse across misses).
This is a well-scoped follow-on task split from #327/PR #743, implementing the buyer side of node-to-node payment channels in crates/incentive. It covers openChannel, USDC approve, voucher signing, channel lifecycle (top-up, reclaimExpired), and the open-channel trigger policy — complementing the already-merged seller/provider path. All referenced ADRs and prior code are in place.
📊 Assessment
Dimension
Value
Reasoning
Type
Feature/Task
New implementation of a defined subsystem; no bug, no design ambiguity
Labels
enhancement, technical, rust, economics
Rust incentive crate, payment-channel economics per ADR 003
Coding agent
Suitable
Requirements and scope are clearly enumerated; existing bindings and voucher primitives are already in-tree; success criteria are explicit (openChannel + lifecycle calls wired into cache-miss path)
🔗 Similar issues
No duplicates found. Directly related: #327 (parent), #317 (cache-miss client_requester), #324 (dispute monitor, explicitly out of scope).
💡 Notes and suggestions
Implementation entry points:
crates/incentive/src/payment_channel.rs — add openChannel, topUp, reclaimExpired to the sol! binding surface.
New BuyerChannelService (or extend existing service with a buyer role) to hold HashMap<Address, ChannelState> keyed by upstream provider address.
Hook into the cache-miss requester (#317 client_requester) to lazily open/reuse a channel on first pull to each provider.
Key decision to land: Lazy-open trigger policy. The issue suggests lazy on first miss + channel reuse — that's the natural default given USDC approve gas overhead is amortized over many pulls.
USDC approve: One-time approval per ADR 003 § Deposit Economics. Recommend a large but bounded approval (e.g. type(uint256).max) issued once at node startup if a USDC balance is present, or per-channel if the node prefers tighter allowances.
design:economicsToken economics, pricing, fee split, bond sizingkind:featureNew capability or a change to current behaviorrustDependabot: a Cargo update; use area: labels for Rust code otherwise
Activity
github-actions commentedon May 31, 2026
🎯 Triage report
This is a well-scoped follow-on task split from #327/PR #743, implementing the buyer side of node-to-node payment channels in
crates/incentive. It coversopenChannel, USDCapprove, voucher signing, channel lifecycle (top-up,reclaimExpired), and the open-channel trigger policy — complementing the already-merged seller/provider path. All referenced ADRs and prior code are in place.📊 Assessment
enhancement,technical,rust,economics🔗 Similar issues
No duplicates found. Directly related: #327 (parent), #317 (cache-miss
client_requester), #324 (dispute monitor, explicitly out of scope).💡 Notes and suggestions
Implementation entry points:
crates/incentive/src/payment_channel.rs— addopenChannel,topUp,reclaimExpiredto thesol!binding surface.BuyerChannelService(or extend existing service with a buyer role) to holdHashMap<Address, ChannelState>keyed by upstream provider address.#317 client_requester) to lazily open/reuse a channel on first pull to each provider.Key decision to land: Lazy-open trigger policy. The issue suggests lazy on first miss + channel reuse — that's the natural default given USDC
approvegas overhead is amortized over many pulls.USDC approve: One-time approval per ADR 003 § Deposit Economics. Recommend a large but bounded approval (e.g.
type(uint256).max) issued once at node startup if a USDC balance is present, or per-channel if the node prefers tighter allowances.Suggested sub-tasks:
sol!bindings:openChannel,topUp,reclaimExpiredBuyerChannelService: state tracking (deposit, nonce, provider address)approveflow (startup or first-channel)decdn_incentive::voucher)reclaimExpiredfallback path (upstream abandonment)client_requester(Implement cdn/client/v1 paid delivery protocol (StreamRequest, StreamResponse, ChunkData, vouchers) #317) cache-miss pathAnti-panic reminder: all new
incentivecrate code must useResult/Option— nounwrap/expect(clippy denies workspace-wide).Add this agentic workflows to your repo
To install this agentic workflow, run
feat(node): buyer-side PaymentChannel openChannel for cache-miss sett…
feat: auto-open/track/reuse payment channels for decdn fetch (#940) (#…
feat(node): idle buyer-channel cooperative-close reconcile sweep (#987)
feat(cli): auto-topUp a reused fetch payment channel when its deposit…