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
feat(node): don't reactively top up a near-expiry channel; open a fresh channel mid-pull #1603
The reactive mid-pull top-up (#1600) funds the existing channel and resumes, but top_up_channel checks only spendable headroom, not remaining time to expires_at. topUp deliberately does not extend expiry (the contract forbids it). So a reactive top-up on a near-expiry channel can escrow a fresh working-deposit into a channel that expires before it can be spent — stranding capital until reclaim, and risking the pull failing anyway.
The proactive refill path only runs behind the try_reuse_live non-expired gate; the reactive leg has no equivalent expiry guard.
Proposed direction
Add a config knob, in seconds, for a minimum remaining-time-to-expiry margin (e.g. defaulting to roughly a day). Seconds so operators can tune it per chain lane.
Before a reactive top-up, if the channel has less than that margin to expires_at, do not top up the near-expiry channel.
Instead, open a fresh channel and continue streaming the remainder through it (mid-flight channel switch), rather than escrowing into a channel that cannot spend the deposit before expiry.
Mid-flight opening of a new channel and continuing the stream through it may warrant its own separate issue if it turns out to be substantial; splitting is fine. The near-expiry guard (don't fund a channel about to expire) is the immediate correctness piece.
Context
Follow-up from the review of #1600 (reactive mid-pull deposit top-up, #1530). Merged as-is. Prior top-up PRs repeatedly treated "topUp does not extend expiry" as load-bearing, so the reactive leg needs an explicit expiry posture.
Activity
docs(node): correct near-expiry remedy wording — wedged, not retired
feat(node): don't reactively top up a near-expiry channel mid-pull (#…
feat(client-pull,cache,node): node serve-miss pull-leg foundation (B2…