Skip to content

ADR 003 gap: client cannot release deposit when node fails before first voucher (90-day liquidity lock) #423

Closed

Description

@alpergundogdu

Gap

ADR 003's zero-voucher close path is provider-only:

"This is the provider's mechanism for releasing channels where no vouchers were ever signed."

But the client-side mirror case is real: a client opens a 10 USDC channel, the node fails (crash, deregistration, network loss) before the first 1 MB voucher boundary, and the client has no way to close. Their only escape is `reclaimExpired` after `expiresAt` — default 90 days.

This is a real liquidity lock with no malicious actor needed; ordinary node infrastructure failure is sufficient.

Failure Mode

Step State
1. Client `openChannel(provider, USDC, 10)` Channel `Open`, `deposit=10`, `claimedNonce=0`
2. Probe + StreamResponse signed; node serves <1 MB and crashes No voucher signed yet (1 MB cadence)
3. Client wants their 10 USDC back Cannot `closeChannel(amount=0, nonce=0, sig=empty)` — provider-only path. Cannot `closeChannel` with any other args — no valid voucher exists
4. Client waits 90 days until `reclaimExpired` is callable

The client's deposit is locked for the full `maxChannelDuration`. The 7-day governance floor on `maxChannelDuration` doesn't help — that's still a week of locked funds for a routine ops failure.

Proposed Fix

Make the zero-voucher close path symmetric. Drop the provider-only restriction on `closeChannel(amount=0, nonce=0, signature.length==0, claimedNonce==0)` so the client can trigger the same path.

// before
if (amount == 0 && nonce == 0 && signature.length == 0 && channel.claimedNonce == 0) {
    require(msg.sender == channel.provider, \"zero-voucher close is provider-only\");
    // ...
}

// after
if (amount == 0 && nonce == 0 && signature.length == 0 && channel.claimedNonce == 0) {
    require(msg.sender == channel.client || msg.sender == channel.provider, \"unauthorized\");
    // ...
}

After the call, the standard 48h dispute window applies. If the node holds any signed vouchers (because the client did sign some off-chain), they dispute with the highest within the window. If the node holds none, settlement refunds the full deposit to the client.

Why This Is Safe

The attack surface reduces to exactly the existing stale-close attack surface from ADR 003 §Stale close (a client closing with a stale low-amount voucher). The defenses already in place handle it:

A griefing client who signs vouchers off-chain and then tries the symmetric close gets disputed by the online node, same as a stale-close attempt today. No new attack surface.

Alternatives Considered

Option Verdict
Shorten `maxChannelDuration` default (90d → 30d) Hurts the channel-reuse amortization economics (ADR 003 §Deposit Economics). Partial fix only — still 30 days locked.
Inactivity-based early reclaim (`lastActivityAt + N days`) Requires on-chain activity tracking, additional storage, governance parameter. Heavier than necessary.
UX guidance: "fund minimally, top up after first delivery" Pushes a protocol gap onto user education. Doesn't fix the underlying asymmetry.
Symmetric zero-voucher close Trivial contract change, reuses existing defenses, closes the gap completely.

Refs

Why This Matters Now

The fix is contract-only and small. The PoC's `StablePaymentChannel` is on the critical path for the implementation — closing this gap before the contract is finalized avoids a future breaking change. As-is, every node ops failure on a fresh channel costs the client up to 90 days of locked liquidity, which will surface as a "deCDN locked my money" complaint the first time a node crashes mid-onboarding.

Origin

Surfaced during ADR review while tracing the channel-failure handling chain in the watchtower → fraud-detection refactor (#420 / #422).

Metadata

Metadata

Assignees

Labels

design:adrdesign:economicsprio:medium

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions