Batch scrape_wallet transactions to handle large wallets#7721
Draft
Copilot wants to merge 3 commits intodevelopmentfrom
Draft
Batch scrape_wallet transactions to handle large wallets#7721Copilot wants to merge 3 commits intodevelopmentfrom
Copilot wants to merge 3 commits intodevelopmentfrom
Conversation
When a wallet has many UTXOs, a single transaction cannot hold all of them as inputs (limit is TRANSACTION_INPUTS_LIMIT = 4000). This change fixes scrape_wallet to batch the outputs into groups of TRANSACTION_INPUTS_LIMIT and create one transaction per batch. Changes: - output_manager_service/service.rs: scrape_wallet now batches outputs by TRANSACTION_INPUTS_LIMIT, generating a TxId per batch, and returns Vec<(TxId, TransactionBuilder)> - output_manager_service/handle.rs: removed tx_id from ScrapeWallet request, added TransactionBuildersToSend response variant, updated handle method to return Vec<(TxId, TransactionBuilder)> - transaction_service/service.rs: scrape_wallet loops through batches creating a transaction per batch, returns Vec<TxId> - transaction_service/handle.rs: scrape_wallet returns Vec<TxId>, uses TransactionsSent response variant - automation/commands.rs: updated to monitor all TxIds from scrape_wallet - wallet_ffi/lib.rs: returns first TxId for backward compatibility, updated doc to note multiple transactions may be created Co-authored-by: SWvheerden <2579813+SWvheerden@users.noreply.github.com>
Co-authored-by: SWvheerden <2579813+SWvheerden@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix scraping for large wallets to handle multiple transactions
Batch scrape_wallet transactions to handle large wallets
Mar 16, 2026
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.
scrape_walletconstructed a single transaction from all unspent outputs, which fails when a wallet has more inputs than the protocol limit (TRANSACTION_INPUTS_LIMIT = 4000).Changes
Output Manager Service
scrape_walletno longer takes atx_idparameter — IDs are now generated internally per batchTRANSACTION_INPUTS_LIMITusing.chunks(), each batch producing its ownTransactionBuilderand encumberanceVec<(TxId, TransactionBuilder)>instead of a single builderTransactionBuildersToSendresponse variant added toOutputManagerResponseTransaction Service
scrape_walletloops over batches, generating fresh crypto keys (sender offset, shared secret, spending key) per transactionVec<TxId>; request handler uses the existingTransactionsSentresponse variantCallers
TxIds tomonitor_transactionsscrape_wallet): returns the firstTxIdfor backward compatibility; docs updated to note that large wallets may produce multiple transactions and that0without an error indicates an empty walletOriginal prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.