Skip to content

feat(minter): re-arm the automatic deposits of a dropped sweep - #284

Draft
gregorydemay wants to merge 6 commits into
DEFI-2780-08-scan-timerfrom
DEFI-2780-09-rearm-dropped-sweeps
Draft

gregorydemay wants to merge 6 commits into
DEFI-2780-08-scan-timerfrom
DEFI-2780-09-rearm-dropped-sweeps

Conversation

@gregorydemay

@gregorydemay gregorydemay commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

When the sweep of a deposit detected by the automatic deposit flow of #272 fails or expires, the account is put back on the watchlist for a fresh window, if the watchlist has room, so that the funds still on the deposit address are swept again without the user's intervention. Covered by unit tests of the re-arm and of the replay of the event log.

🤖 Generated with Claude Code

@gregorydemay
gregorydemay added this pull request to stack #288 October 14, 2026 08:50
Copilot AI balanced review requested due to automatic review settings October 14, 2026 09:04
@gregorydemay
gregorydemay force-pushed the DEFI-2780-09-rearm-dropped-sweeps branch from cbcba4e to 0df76d9 Compare October 14, 2026 09:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Re-arm outcomes depend on transient watchlist capacity and therefore diverge during event replay.

1 open finding
What changed in this PR

Re-arms automatic deposits after failed or expired sweeps.

Changes:

  • Adds watchlist re-arm logic and failure handling.
  • Returns dropped deposits for re-registration.
  • Adds tests and updates design documentation.
File Description
minter/​src/​state/​watchlist/​tests.rs Tests re-arm behavior.
minter/​src/​state/​watchlist/​mod.rs Implements watchlist re-arming.
minter/​src/​state/​tests.rs Tests sweep failure and replay.
minter/​src/​state/​mod.rs Re-arms deposits when sweeps are dropped.
minter/​src/​state/​deposits/​tests.rs Tests returned dropped deposits.
minter/​src/​state/​deposits/​mod.rs Returns deposits from dropped sweeps.
minter/​src/​state/​audit.rs Passes event timestamps during replay.
docs/​src/​development/​design.md Documents restored watch windows.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread minter/src/state/mod.rs Outdated
/// addresses are swept again without the user's intervention.
fn drop_sweep(&mut self, signature: &Signature, timestamp: u64) {
for deposit in self.deposits.drop_swept(signature) {
let rearmed = self.watchlist.rearm(timestamp, &deposit);
@gregorydemay
gregorydemay force-pushed the DEFI-2780-09-rearm-dropped-sweeps branch from 0df76d9 to b76a77e Compare October 14, 2026 09:18
Copilot AI balanced review requested due to automatic review settings October 14, 2026 09:18
@gregorydemay
gregorydemay force-pushed the DEFI-2780-09-rearm-dropped-sweeps branch from b76a77e to be1849f Compare October 14, 2026 09:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Re-arm decisions can differ during event replay because watchlist capacity depends on unlogged transient registrations.

1 open finding

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 14, 2026 09:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation is deterministic under event replay and covers expiry, capacity, manual deposits, and both drop paths.

1 open finding

🧠 Review effort: Balanced

@gregorydemay
gregorydemay force-pushed the DEFI-2780-09-rearm-dropped-sweeps branch from be1849f to d1767df Compare October 14, 2026 09:35
Copilot AI balanced review requested due to automatic review settings October 14, 2026 09:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Re-arm admission depends on transient watchlist capacity and can produce different state during event replay.

1 open finding

🧠 Review effort: Balanced

@gregorydemay
gregorydemay force-pushed the DEFI-2780-09-rearm-dropped-sweeps branch from d1767df to e24f6a2 Compare October 14, 2026 09:56
Copilot AI balanced review requested due to automatic review settings October 14, 2026 09:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Re-arm admission is recomputed from unrecorded transient watchlist state, allowing replay to produce different behavior after an upgrade.

1 open finding

🧠 Review effort: Balanced

@gregorydemay
gregorydemay force-pushed the DEFI-2780-09-rearm-dropped-sweeps branch from e24f6a2 to faea046 Compare October 14, 2026 11:19
Copilot AI balanced review requested due to automatic review settings October 14, 2026 11:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Re-arm capacity decisions depend on transient watchlist state and can differ during event replay.

2 open findings

🧠 Review effort: Balanced

@gregorydemay
gregorydemay force-pushed the DEFI-2780-09-rearm-dropped-sweeps branch from 7355d82 to 5fc15da Compare October 15, 2026 09:04
Copilot AI balanced review requested due to automatic review settings October 15, 2026 09:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Upgrade replay does not preserve watchlist capacity decisions or subsequent scan progress.

2 open findings

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 15, 2026 09:54
@gregorydemay
gregorydemay force-pushed the DEFI-2780-09-rearm-dropped-sweeps branch from 5fc15da to 8468edb Compare October 15, 2026 09:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Missing watchlist persistence allows upgrade replay to change re-arm outcomes and reset scan progress.

2 open findings

🧠 Review effort: Balanced

@gregorydemay
gregorydemay force-pushed the DEFI-2780-09-rearm-dropped-sweeps branch from 8468edb to d5113cb Compare October 15, 2026 11:28
Copilot AI balanced review requested due to automatic review settings October 15, 2026 11:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Capacity-dependent re-arm decisions can differ during event replay because live watchlist registrations are not restored.

2 open findings

🧠 Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Upgrade replay can admit re-arms rejected by the live capacity check because transient watchlist registrations are not restored.

2 open findings

🧠 Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused changes preserve capacity limits and manual-deposit behavior, with tests covering failure, expiry, and replay.

2 open findings

🧠 Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The previously reported replay issue remains unresolved: transient watchlist capacity can produce different re-arm decisions after an upgrade.

2 open findings

🧠 Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Replay safety depends on watchlist persistence, which remains unverified.

2 open findings

🧠 Review effort: Balanced

gregorydemay and others added 6 commits October 15, 2026 14:07
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…re-arm test

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The re-arm registers the account again instead of restoring the window end recorded with
the deposit, so a drop after the original window re-arms as well and the window-closed
error disappears.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…w name

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Event replay can change re-arm decisions and reset scan progress because the live watchlist is not restored.

2 open findings

🧠 Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants