Repository navigation
feat(minter): scan the watched deposit addresses on a timer and queue the detected deposits - #283
Draft
gregorydemay wants to merge 11 commits into
Draft
gregorydemay wants to merge 11 commits into
gregorydemay wants to merge 11 commits into
Conversation
gregorydemay
added this pull request to stack #288
October 14, 2026 08:50
gregorydemay
force-pushed
the
DEFI-2780-08-scan-timer
branch
from
October 14, 2026 09:04
a51206a to
0f2515d
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A concurrent manual deposit can race with the scan and trigger the duplicate in-flight deposit assertion.
1 open finding
What changed in this PR
Adds timer-driven scanning of watched Solana deposit addresses and queues eligible deposits automatically.
Changes:
- Adds batched balance scanning with scheduling and concurrency guards.
- Adds scan metrics and unit/integration coverage.
- Updates automatic-deposit design documentation.
| File | Description |
|---|---|
minter/src/storage/mod.rs |
Stores scan outcome counters. |
minter/src/state/mod.rs |
Adds scan task and deposit-call lookup. |
minter/src/rpc/mod.rs |
Enables the balance batching helper. |
minter/src/metrics.rs |
Exposes scan outcome metrics. |
minter/src/main.rs |
Registers the scan timer. |
minter/src/deposit/automatic/scan/tests.rs |
Tests scan behavior and scheduling. |
minter/src/deposit/automatic/scan/mod.rs |
Implements watched-address scanning. |
minter/src/deposit/automatic/mod.rs |
Exports scan functionality. |
minter/src/constants.rs |
Defines the scan interval. |
integration_tests/tests/tests.rs |
Tests timer-based deposit detection. |
integration_tests/src/fixtures.rs |
Adds batched-account RPC mocks. |
docs/src/development/design.md |
Updates scan behavior and cost bounds. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
gregorydemay
force-pushed
the
DEFI-2780-08-scan-timer
branch
from
October 14, 2026 09:18
0f2515d to
3dd1c23
Compare
gregorydemay
force-pushed
the
DEFI-2780-08-scan-timer
branch
from
October 14, 2026 09:20
3dd1c23 to
bea3e02
Compare
gregorydemay
force-pushed
the
DEFI-2780-08-scan-timer
branch
from
October 14, 2026 09:35
bea3e02 to
762ac1e
Compare
gregorydemay
force-pushed
the
DEFI-2780-08-scan-timer
branch
from
October 14, 2026 09:56
762ac1e to
1759edf
Compare
gregorydemay
force-pushed
the
DEFI-2780-08-scan-timer
branch
from
October 14, 2026 11:19
1759edf to
ff97862
Compare
gregorydemay
force-pushed
the
DEFI-2780-08-scan-timer
branch
from
October 15, 2026 09:54
3c7acd9 to
30ab415
Compare
gregorydemay
force-pushed
the
DEFI-2780-08-scan-timer
branch
from
October 15, 2026 11:28
30ab415 to
5aac9f7
Compare
… the detected deposits Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ort the first scan as due at the read Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…queues a deposit Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…name Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…counts parameters Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ing its balance read Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…e alone Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ee under the new name Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…endpoint Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
||
| #[tokio::test] | ||
| async fn should_return_the_deposit_a_scan_queued_during_a_rejected_balance_read_and_charge_the_read_only() | ||
| { |
This branch has not been deployed
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.



Adds the scan timer of the automatic deposit flow of #272: every minute, the due watched addresses are read in batches, a balance reaching the minimum deposit amount is queued exactly as
deposit_solwould queue it, with the fee in force, and a failed read counts as a scan so that the cost of a registration stays within its schedule. Covered by unit tests of the scan and a PocketIC test of a deposit detected and queued by the timer.🤖 Generated with Claude Code