Skip to content

redeemer: no close-deadline wake, so the pool-close margin's last sweep can miss #2813

Not planned

Description

@yigitdot

Found while reviewing #2812 (#2805).

The mid-stream pool-close stop (#2812) stops a stream once a Closing pool's dispute deadline falls inside the capability expiry margin (one redeem interval + REDEEM_LANDING_SLACK_SECS), and its docs say this leaves the redeemer one interval to sweep the last voucher. That is a window, not a guarantee: capability expiry has a scheduled cutoff wake (lane_cutoff_wake in crates/node/src/payment_settlement.rs), but a pool's close deadline has none.

  • The serve loop stops up to one re-check interval (2 s) plus coarse-clock lag after the margin starts.
  • A periodic redeemer tick that falls in those first seconds can miss the stream's last vouchers.
  • The next tick lands at or after deadline − REDEEM_LANDING_SLACK_SECS, which pool_is_redeemable skips, so those vouchers are never redeemed.
  • A lane below the redeem floor is not forced through either.

Exposure is bounded (at most about one credit window per lane on the closing pool), so prio:low.

Proposal: give the redeemer a close-deadline wake, symmetric with lane_cutoff_wake: when a pool folds PoolCloseInitiated, schedule a sweep of its lanes at deadline − margin + 1, so the final claim is swept before pool_is_redeemable's slack filter drops the pool.

Done when a closing pool's lanes are swept once after the serve cutoff and before the slack filter drops them, with a unit test on the wake computation.

Activity

  1. added
    kind:security
    prio:low
    area:node
    area:payments
    on Nov 1, 2026
  2. moved this from Backlog to In progress in deCDNon Nov 26, 2026
  3. alpergundogdu commented on Nov 26, 2026

    @alpergundogdu
    Contributor

    Superseded by #3006: the node stops serving at Closing, so the periodic sweep runs many times inside the dispute window and no close-deadline wake is needed.

  4. moved this from In progress to Done in deCDNon Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:nodearea:paymentskind:securityprio:low

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions