Repository navigation
feat(minter): let deposit_sol yield to a deposit queued by a scan during its balance read - #286
Merged
gregorydemay merged 0 commit intoOct 15, 2026
Conversation
gregorydemay
added this pull request to stack #288
October 14, 2026 08:50
gregorydemay
force-pushed
the
DEFI-2780-11-deposit-sol-yields-to-scan
branch
from
October 14, 2026 09:04
d0e451a to
57bcefc
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A formatting error will fail the repository’s mandatory formatting check.
1 open finding
What changed in this PR
Prevents deposit_sol from duplicating deposits queued concurrently by automatic scans.
Changes:
- Detects deposits queued during balance reads.
- Charges only RPC costs when yielding to a scan.
- Adds concurrency tests and realistic mocked-call suspension.
| File | Description |
|---|---|
minter/src/deposit/sweep/mod.rs |
Handles concurrently queued deposits. |
minter/src/deposit/sweep/tests.rs |
Tests successful and rejected read races. |
minter/src/test_fixtures/runtime.rs |
Simulates inter-canister call suspension. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| #[tokio::test] | ||
| async fn should_return_the_deposit_a_scan_queued_during_a_rejected_balance_read_and_charge_the_read_only() | ||
| { |
gregorydemay
force-pushed
the
DEFI-2780-11-deposit-sol-yields-to-scan
branch
from
October 14, 2026 09:18
57bcefc to
6a46dec
Compare
gregorydemay
force-pushed
the
DEFI-2780-11-deposit-sol-yields-to-scan
branch
from
October 14, 2026 09:20
6a46dec to
cae6c83
Compare
gregorydemay
force-pushed
the
DEFI-2780-11-deposit-sol-yields-to-scan
branch
from
October 14, 2026 09:35
cae6c83 to
5fa681f
Compare
gregorydemay
force-pushed
the
DEFI-2780-11-deposit-sol-yields-to-scan
branch
from
October 14, 2026 09:56
5fa681f to
4907c46
Compare
gregorydemay
force-pushed
the
DEFI-2780-11-deposit-sol-yields-to-scan
branch
from
October 14, 2026 11:19
4907c46 to
50baeb3
Compare
gregorydemay
force-pushed
the
DEFI-2780-11-deposit-sol-yields-to-scan
branch
from
October 14, 2026 14:58
b34b3f8 to
421f424
Compare
gregorydemay
force-pushed
the
DEFI-2780-11-deposit-sol-yields-to-scan
branch
from
October 15, 2026 09:04
421f424 to
578ee32
Compare
gregorydemay
force-pushed
the
DEFI-2780-11-deposit-sol-yields-to-scan
branch
from
October 15, 2026 09:54
578ee32 to
823cc11
Compare
gregorydemay
force-pushed
the
DEFI-2780-11-deposit-sol-yields-to-scan
branch
from
October 15, 2026 11:28
823cc11 to
c84f09c
Compare
Contributor
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.
Still open (1)
- 🔴 minter/src/deposit/sweep/tests.rs#L166 — The opening brace has an extra leading space, so the repository's
cargo fmt --all -- --checklint…
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.

deposit_soland the scan of the automatic deposit flow of #272 may read the balance of the same address concurrently.deposit_solnow records the latest deposit of the account before its read and, if a scan queued a deposit in the meantime, returns that deposit and charges only the read, so that the same balance is never queued twice. Covered by two unit tests interleaving the two paths.🤖 Generated with Claude Code