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
contracts: FeeRouter pause freezes the client-refund leg of PaymentChannel.settleChannel #849
PaymentChannel's pause design deliberately keeps every channel-exit path open so funds are never trapped. But settleChannel calls into FeeRouter.routeSettlement, which is whenNotPaused. When FeeRouter is paused, settling a Closing channel that has a non-zero provider amount reverts the entire transaction — including the client refund that executes earlier in the same call.
Where
PaymentChannel.settleChannel (contracts/src/PaymentChannel.sol:455-475): sets status = Closed, transfers clientRefund to the client, then _route(...) → FeeRouter.routeSettlement when settleAmount != 0.
FeeRouter.routeSettlement (contracts/src/FeeRouter.sol:195-201) is whenNotPaused.
_route (PaymentChannel.sol:648-655) has no pause-tolerant path; a revert there reverts the whole settleChannel.
Impact
A channel already in Closing cannot be settled while FeeRouter is paused, and the client refund is blocked along with it. reclaimExpired is not an escape hatch — it requires Status.Open (PaymentChannel.sol:480-494). Impact is bounded (pause is emergency-multisig-gated and temporary), but it reintroduces a fund-freeze for already-closing channels, contrary to PaymentChannel's "exits always open" intent.
Suggested fix
Make the settle/refund path tolerate a paused router — e.g. pay the client refund unconditionally and let the provider-share routing be retried/settled separately, or allow a closing channel to fall back to a client-reclaim path when the router is paused.
Notes
Found during a full-repo audit; verified against the contract source.
A medium-severity correctness bug in the PaymentChannel × FeeRouter interaction: when FeeRouter is paused, settleChannel reverts atomically — taking the already-executed client USDC refund with it — leaving a Closing channel with no escape hatch, since reclaimExpired requires Status.Open. This directly violates the stated "exits always open" invariant of PaymentChannel. The reporter has provided exact file/line references and verified against the contract source.
📊 Assessment
Dimension
Value
Reasoning
Type
Bug
Correctness invariant violation with fund-freeze consequence
Labels
bug, security, medium
Fund-freeze under emergency pause; reporter-stated Medium severity; directly ties to contract security invariants
Coding agent
Suitable
Root cause is pinpointed to specific lines; fix scope is contained to PaymentChannel._route / settleChannel; two concrete fix strategies are provided; no design ambiguity beyond choosing between them
🔗 Similar issues
No open duplicates or closely related issues found.
reclaimExpired (L480-494) explicitly gates on ch.status == Open, so a Closing channel has zero exit options while FeeRouter is paused.
Two fix approaches to choose between:
Split the client refund from routing (recommended): Execute usdc.safeTransfer(ch.client, clientRefund) unconditionally and only attempt _route after. If the router is paused, either (a) skip routing and store the provider's owed amount for later claiming, or (b) emit an event and allow a separate retryRoute(channelId) function to drain it once FeeRouter unpauses. This preserves the "client exits always work" invariant at the cost of deferring provider payment.
Pause-tolerant settlement escape hatch: Add a settleChannelEmergency(channelId) that is callable when FeeRouter is paused, returns the entire deposit to the client, and marks the channel closed. Provider foregoes their portion during the emergency window (or it's queued). Simpler to reason about atomicity, but less favourable to providers.
Design questions to resolve before implementing:
Should deferred provider amounts accrue interest/penalties? (Probably not for a temporary pause.)
Should the stored provider payable be tracked in PaymentChannel or a separate escrow?
Is it acceptable for the provider to receive their share post-pause via a pull mechanism, or must it remain push?
Suggested sub-tasks:
Decide which fix approach to adopt (team call / ADR note)
Implement the chosen fix in PaymentChannel.sol
Add a test: FeeRouter paused while channel is Closing → settleChannel must still successfully refund the client
Add a test: after FeeRouter unpauses, provider share is retrievable
Review whether withdraw has a similar pause-interaction issue (it also calls _route)
Confirm slither/aderyn are clean after the fix
Scope note: Also worth checking withdraw (it calls _route as well) to see if a paused FeeRouter blocks mid-channel withdrawals in a similar way.
Activity
github-actions commentedon Jun 9, 2026
🎯 Triage report
A medium-severity correctness bug in the
PaymentChannel×FeeRouterinteraction: whenFeeRouteris paused,settleChannelreverts atomically — taking the already-executed client USDC refund with it — leaving aClosingchannel with no escape hatch, sincereclaimExpiredrequiresStatus.Open. This directly violates the stated "exits always open" invariant ofPaymentChannel. The reporter has provided exact file/line references and verified against the contract source.📊 Assessment
bug,security,mediumPaymentChannel._route/settleChannel; two concrete fix strategies are provided; no design ambiguity beyond choosing between them🔗 Similar issues
No open duplicates or closely related issues found.
💡 Notes and suggestions
Root cause path (confirmed in source):
reclaimExpired(L480-494) explicitly gates onch.status == Open, so aClosingchannel has zero exit options whileFeeRouteris paused.Two fix approaches to choose between:
Split the client refund from routing (recommended): Execute
usdc.safeTransfer(ch.client, clientRefund)unconditionally and only attempt_routeafter. If the router is paused, either (a) skip routing and store the provider's owed amount for later claiming, or (b) emit an event and allow a separateretryRoute(channelId)function to drain it once FeeRouter unpauses. This preserves the "client exits always work" invariant at the cost of deferring provider payment.Pause-tolerant settlement escape hatch: Add a
settleChannelEmergency(channelId)that is callable whenFeeRouteris paused, returns the entire deposit to the client, and marks the channel closed. Provider foregoes their portion during the emergency window (or it's queued). Simpler to reason about atomicity, but less favourable to providers.Design questions to resolve before implementing:
PaymentChannelor a separate escrow?Suggested sub-tasks:
PaymentChannel.solFeeRouterpaused while channel isClosing→settleChannelmust still successfully refund the clientFeeRouterunpauses, provider share is retrievablewithdrawhas a similar pause-interaction issue (it also calls_route)slither/aderynare clean after the fixScope note: Also worth checking
withdraw(it calls_routeas well) to see if a pausedFeeRouterblocks mid-channel withdrawals in a similar way.Add this agentic workflows to your repo
To install this agentic workflow, run
fix(contracts): address PR #889 review — event param order + router p…
fix(contracts): don't let a paused FeeRouter freeze the settleChannel…