Skip to content

contracts: PaymentChannel.withdraw reverts under a paused FeeRouter (provider-only, no client funds stranded) #890

Closed

Description

@yigitdot

Follow-up to #849 / #889, kept out of that PR's scope per review convention.

Context

PaymentChannel.withdraw (contracts/src/PaymentChannel.sol:377) routes the provider's claimed delta through _route → FeeRouter.routeSettlement, which is whenNotPaused. While the router is paused, withdraw reverts entirely, so a provider cannot pull its earned share until the router is unpaused.

Unlike the settleChannel case fixed in #889, this strands no client funds and does not bundle a client refund — the channel stays Open, and the provider simply retries withdraw after unpause. So the impact is a temporary, provider-only delay during an emergency pause, not a fund-freeze.

Decision needed

Decide whether to (a) leave withdraw as-is (provider retries post-unpause — acceptable given pause is emergency-multisig-gated and temporary), or (b) apply the same deferred-settlement tolerance used for settleChannel so an in-progress withdraw doesn't revert under pause.

Recommendation: likely (a) — but worth an explicit call.

Refs

Activity

  1. added
    kind:bug
    prio:low
    on Jun 13, 2026
  2. added
    design:missing-decision
    on Jun 13, 2026
  3. github-actions commented on Jun 13, 2026

    @github-actions

    🎯 Triage report

    This is a well-scoped follow-up to #849, isolating the withdraw path of PaymentChannel as a second site where FeeRouter.routeSettlement (whenNotPaused) blocks operation during an emergency pause. Crucially, impact is materially lower than #849: no client funds are at risk, the channel stays Open, and the provider can simply retry after unpause. The issue is asking for an explicit architectural decision rather than reporting an unambiguous defect.

    📊 Assessment

    Dimension Value Reasoning
    Type Bug Behavioral regression under pause — consistent with #849's type; lower severity but same root
    Labels missing-decision added; bug, technical, low retained Issue explicitly requests a call between two design options before any fix is warranted
    Coding agent Needs more info The code path and both options are clearly described, but a maintainer must decide (a) vs (b) first; if (b), the fix closely mirrors #889's deferred-settlement pattern and would be well-suited for agent execution

    🔗 Similar issues

    💡 Notes and suggestions

    Code path (for reviewer reference):

    • PaymentChannel.withdraw (PaymentChannel.sol:377) → _route(...) (PaymentChannel.sol:648-655) → FeeRouter.routeSettlement (FeeRouter.sol:195-201, whenNotPaused)
    • Channel stays Open on revert; provider retries post-unpause. No reclaim path is blocked.

    Decision frame:

    • Option (a) — leave as-is: Acceptable given (1) pause is emergency-multisig-gated and expected to be temporary, (2) the channel stays Open so the provider is not permanently locked out, (3) no client funds are entangled. The author leans here.
    • Option (b) — deferred-settlement tolerance: Apply the same pattern used in fix(contracts): don't let a paused FeeRouter freeze the settleChannel client refund (#849) #889: separate the fund disbursement from the routing call, allow the routing leg to be retried/settled post-pause. More complex but brings withdraw fully in line with the "exits always open" invariant and eliminates the corner case.

    If (b) is chosen, the scope is narrow and well-defined:

    • Identify the exact _route call in withdraw and split out the provider-share routing as a retryable step
    • Verify no new reentrancy surface is introduced
    • Add a Foundry test: pause FeeRouter mid-withdraw, assert withdraw reverts (current), then test post-pause retry succeeds
    • Check whether any other PaymentChannel entry points call _route and need the same treatment (audit completeness)

    Suggested next step: A maintainer explicitly records the decision in this issue (or closes as wontfix if (a)) so the missing-decision label can be cleared.

    Generated by Agentic Triage for issue #890 · ◷

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/issue-triage.md@94ec5db57374c5b04a4b8eef8b4413f9af44d63f
    
  4. self-assigned this
    on Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

design:missing-decisionkind:bugprio:low

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions