refactor(cketh): move the sweeper pipeline into AutomaticDeposits - #11351
Queued
gregorydemay wants to merge 2 commits into
Queued
refactor(cketh): move the sweeper pipeline into AutomaticDeposits#11351gregorydemay wants to merge 2 commits into
gregorydemay wants to merge 2 commits into
Conversation
|
✅ No security or compliance issues detected. Reviewed everything up to 4dbc233. Security Overview
Detected Code Changes
|
Contributor
There was a problem hiding this comment.
Pull request overview
Moves the sweeper transaction pipeline into AutomaticDeposits, preserving replay, initialization, upgrade, and processing behavior.
Changes:
- Encapsulates sweeper transactions behind sweep-specific delegation methods.
- Preserves replay-aware state equivalence.
- Updates initialization, upgrades, processing, audit replay, and tests.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
sweep.rs |
Uses the nested sweeper pipeline API. |
state/tests.rs |
Updates state construction. |
state/automatic_deposits/mod.rs |
Owns and delegates the sweeper pipeline. |
state/audit.rs |
Routes sweeper events through AutomaticDeposits. |
state.rs |
Removes the standalone pipeline and updates equivalence/upgrades. |
lifecycle/tests.rs |
Updates nonce assertions. |
lifecycle/init.rs |
Initializes the nested pipeline nonce. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
mbjorkqvist
approved these changes
Aug 27, 2026
mbjorkqvist
left a comment
Contributor
There was a problem hiding this comment.
Thanks @gregorydemay!
gregorydemay
force-pushed
the
gdemay/DEFI-2926-move-sweeper-pipeline
branch
from
August 27, 2026 14:10
46e161d to
b0db3f1
Compare
The pipeline sits next to the sweep queue that feeds it, encapsulated the way WithdrawalTransactions encapsulates its own: the field stays private and callers reach it through delegating methods. State's replay equivalence check compared the pipeline with its own `is_equivalent_to`, which sorts a queue that `reschedule_request` reorders without recording an event. Nesting it under the strict `ensure_eq!` on `automatic_deposits` would have made replay fail after any reschedule, so AutomaticDeposits gained an `is_equivalent_to` of its own. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ence The pipeline's equivalence check compared every field except `processed_requests`, so a replay that rebuilt it differently still passed. The field is written only when a transaction is created and `reschedule_request` never touches it, so unlike the pending queue it needs no reordering allowance. Destructuring `Self` in the three equivalence checks makes the next forgotten field a compile error rather than a silent gap.
gregorydemay
force-pushed
the
gdemay/DEFI-2926-move-sweeper-pipeline
branch
from
August 27, 2026 15:08
46fcae8 to
4dbc233
Compare
gregorydemay
added this pull request to the merge queue
Aug 27, 2026
Any commits made after this event will not be merged.
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.
Why
State, away from the sweep queue that feeds it, and its field was public where every sibling aggregate keeps its own private.What
AutomaticDeposits, encapsulated the wayWithdrawalTransactionsencapsulates its own: the field is private and callers reach it through delegating methods, qualified withsweepso they cannot be confused with the deposit requests the same struct already holds.AutomaticDepositsgains anis_equivalent_to. Replay compared the pipeline with its own, which sorts a queue thatreschedule_requestreorders without recording an event; nesting it under the strict equality onautomatic_depositswould have made replay fail after any reschedule.