Repository navigation
fix(node): wake the redeemer at a closing pool's deadline - #3004
Closed
alpergundogdu wants to merge 1 commit into
Closed
alpergundogdu wants to merge 1 commit into
alpergundogdu wants to merge 1 commit into
Conversation
A lane's serve cutoff is its capability expiry, or its pool's dispute deadline when the projection holds the pool `Closing` and the deadline comes first. The redeemer's cutoff sweep then runs one second after the mid-stream re-check stops a stream on the closing pool, so the final claim is swept before `pool_is_redeemable`'s landing-slack filter drops the pool. A lane on a pool that cannot pay gets no wake. Closes #2813 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
Superseded by #3006: a live stream now stops as soon as its pool turns Closing, so the node keeps the whole dispute window to redeem and needs no close-deadline wake. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2813
What
A lane's serve cutoff is now the earlier of its capability
expiryand, when the pool projection holds the poolClosing, the pool's dispute deadline. The redeemer's existing cutoff sweep (serve_cutoff_wake/next_serve_cutoff) therefore also fires atdeadline - margin + 1: one second after the mid-stream re-check (#2812) stops a stream on the closing pool, and one redeem interval beforepool_is_redeemable's landing-slack filter drops the pool.lane_cutoff_waketakes the lane's pool status;serve_cutoff_wakealso requirespool_is_redeemable(pool, now), so a drained pool or one inside the slack gets no wake.next_serve_cutoffreads each lane's pool from thePoolProjection; the hint path (redeem_one) does the same, so a live stream's hint pulls the close cutoff forward.Floor
The cutoff sweep does not force sub-floor lanes through, and neither does the close sweep: it packs every owed lane like the capability cutoff sweep does (ADR 003: a node does not force sub-threshold dust through the sweep). Forcing dust would be a separate policy change.
Tests
Unit tests on the wake computation: close deadline first vs. expiry first, no re-schedule after the sweep, due-now after an unscanned cutoff, none inside the slack or on a drained pool, the wake sits one second after
inside_capability_expiry_marginstarts and the pool is still redeemable there, andnext_serve_cutoffpicks the deadline up from the projection.cargo nextest run -p decdn-node(1628 passed),cargo clippy --workspace --all-targets --all-featuresclean. No pub signature changed.🤖 Generated with Claude Code