Skip to content

feat: add pending-signatures queue for automated deposit flow#175

Merged
lpahlavi merged 3 commits intomainfrom
lpahlavi/defi-2780-pending-signatures-queue
Apr 27, 2026
Merged

feat: add pending-signatures queue for automated deposit flow#175
lpahlavi merged 3 commits intomainfrom
lpahlavi/defi-2780-pending-signatures-queue

Conversation

@lpahlavi
Copy link
Copy Markdown
Contributor

@lpahlavi lpahlavi commented Apr 24, 2026

Summary

  • Adds a module-level PENDING_SIGNATURES thread-local (BTreeMap<Account, VecDeque<Signature>>) to buffer discovered transaction signatures per account
  • Fills in poll_account's previously-stub Ok(signatures) arm: filters out failed transactions and pushes successful signatures into the queue
  • Exposes pending_signatures_for / reset_pending_signatures test helpers
  • Adds 3 new tests covering signature queuing, failed-tx filtering, and RPC errors; replaces local sig helper with test_fixtures::signature

🤖 Generated with Claude Code

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@lpahlavi lpahlavi force-pushed the lpahlavi/defi-2780-pending-signatures-queue branch from e1c1ba3 to 7476c0a Compare April 24, 2026 13:17
@lpahlavi lpahlavi changed the base branch from main to lpahlavi/defi-2780-insertion-ordered-set April 24, 2026 13:19
@lpahlavi lpahlavi marked this pull request as ready for review April 24, 2026 13:25
@lpahlavi lpahlavi requested a review from a team as a code owner April 24, 2026 13:25
lpahlavi and others added 2 commits April 24, 2026 15:27
Replace `monitored_accounts: BTreeSet<Account>` with a new
`InsertionOrderedSet<Account>` that preserves insertion order.
The set is backed by `InsertionOrderedMap<K, ()>` and exposes
only the methods needed at call sites: `insert`, `remove`,
`contains`, `len`, and `iter`.

Call sites in `deposit::automatic` are unchanged because
`InsertionOrderedSet` intentionally mirrors `BTreeSet`'s API.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
- Add module-level `PENDING_SIGNATURES` thread-local to buffer discovered
  transaction signatures per account
- Fill in `poll_account`'s signature arm: filter out failed transactions
  and push successful signatures into the queue
- Expose `pending_signatures_for` / `reset_pending_signatures` test helpers
- Replace local `sig` test helper with `test_fixtures::signature`

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@lpahlavi lpahlavi force-pushed the lpahlavi/defi-2780-insertion-ordered-set branch from 31bb588 to d653a1a Compare April 24, 2026 13:28
@lpahlavi lpahlavi force-pushed the lpahlavi/defi-2780-pending-signatures-queue branch from 7476c0a to 18d4ecf Compare April 24, 2026 13:28
@lpahlavi lpahlavi requested review from THLO and maciejdfinity April 27, 2026 09:02
Base automatically changed from lpahlavi/defi-2780-insertion-ordered-set to main April 27, 2026 09:22
@lpahlavi lpahlavi merged commit 153b371 into main Apr 27, 2026
11 checks passed
@lpahlavi lpahlavi deleted the lpahlavi/defi-2780-pending-signatures-queue branch April 27, 2026 10:55
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.

3 participants