feat: process pending signatures queue and accept automatic deposits#176
Draft
lpahlavi wants to merge 3 commits intolpahlavi/unify-accepted-deposit-eventfrom
Draft
feat: process pending signatures queue and accept automatic deposits#176lpahlavi wants to merge 3 commits intolpahlavi/unify-accepted-deposit-eventfrom
lpahlavi wants to merge 3 commits intolpahlavi/unify-accepted-deposit-eventfrom
Conversation
4 tasks
7476c0a to
18d4ecf
Compare
c03a2cc to
691066e
Compare
d27a8ba to
bad6704
Compare
For each monitored account, pops signatures from the pending queue, calls
getTransaction, and emits AcceptedDeposit { source: Automatic } for valid
deposits. Invalid or already-processed signatures are silently discarded.
Reschedules immediately if more signatures remain after a round.
Adds an integration test verifying the end-to-end flow from update_balance
through poll and signature processing to AcceptedDeposit event emission.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bad6704 to
8b26721
Compare
Replaces the DepositRuntimeExt trait with direct methods on TestCanisterRuntime, and adds stub helpers for all RPC and ledger calls: getTransaction, getSignaturesForAddress, getSlot, getBlock, sendTransaction, getSignatureStatuses, icrc1_transfer, icrc2_transfer_from. Each helper has a doc comment identifying the RPC call it stubs. Updates all test files to use these methods, eliminating verbose MultiRpcResult::Consistent(...) boilerplate and local type aliases. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the imperative loop with a column-by-column flat_map: iterates round 0 across all accounts, then round 1, etc., and stops early via take(MAX_CONCURRENT_RPC_CALLS). Drains the taken count from each queue afterward. This eliminates the mutable capacity tracking and makes the interleaving intent explicit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
process_pending_signaturestimer function: iterates thePENDING_SIGNATURESqueue in round-robin order, pops one signature per account per round, validates each viafetch_and_validate_deposit, emitsAcceptedDeposit { source: Automatic }on success, silently discards invalid signatures, and reschedules itself atDuration::ZEROif more remainTaskType::ProcessPendingSignaturesto the task setdeposit_statusis alreadySome(_)to avoid double-processingPROCESS_PENDING_SIGNATURES_DELAYtimer inmain.rsupdate_balance→ poll → signature processing →AcceptedDepositevent flowStack
This PR stacks on top of:
AcceptedDepositevent #179 — add source field toAcceptedDepositevent (rebased on)Test plan
cargo test -p cksol_minter --lib— all tests pass🤖 Generated with Claude Code