feat(platform-wallet): let a Core build fund from only the inputs it was given - #4548
Draft
romchornyi wants to merge 1 commit into
Draft
feat(platform-wallet): let a Core build fund from only the inputs it was given#4548romchornyi wants to merge 1 commit into
romchornyi wants to merge 1 commit into
Conversation
…was given The wallet-aware finalizers add every unreserved UTXO of the funding account to the candidate pool, so seeding a subset through `core_wallet_tx_builder_add_inputs_from_outpoints` does not restrict what gets selected. A caller draining an account in batches that each stay under the standard-transaction input limit therefore achieves nothing: every batch sees the whole account and fails with a too-many-inputs error, and an account above the cap cannot be drained at all. That is the iOS CoinJoin sweep. A wallet with 589 mixed UTXOs reports "Too many inputs for a standard transaction: 589 (max 500)" on every attempt and every retry; its ~101 DASH cannot be moved by any route the app offers. Exposes key-wallet's opt-in through the FFI and the Swift SDK, and moves the rust-dashcore pin onto a branch carrying it. The pin continues the existing cherry-pick lineage rather than following dev: `chore/sync-fixes-filter-rescans-and-added-inputs` is the current pin (4db5c367) plus dash-spv #866 and #974 — committed-filter-range rescans for newly derived scripts, which address the launch-dependent balances seen on heavily mixed wallets — plus the four key-wallet commits. Pinning dev instead would drag in the sweep-event chain, whose platform-side handling is #4406's subject and which breaks this workspace on seven non-exhaustive matches today.
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Issue being fixed or feature implemented
The wallet-aware finalizers add every unreserved UTXO of the funding account to the candidate pool, so
seeding a subset through
core_wallet_tx_builder_add_inputs_from_outpointsdoes not restrict what getsselected. A caller that drains an account in batches each staying under the standard-transaction input
limit therefore achieves nothing — every batch still sees the whole account and fails with a
too-many-inputs error, and an account above the cap cannot be drained at all, however it is chunked.
This is live. The iOS CoinJoin sweep chunks exactly this way; a user with 589 mixed UTXOs gets
Too many inputs for a standard transaction: 589 (max 500)on every attempt and every retry, and their~101 DASH cannot be moved by any route the app offers. The failure is at build time, so nothing is
broadcast and nothing changes between attempts.
What was done?
core_wallet_tx_builder_use_only_added_inputsinrs-platform-wallet-ffi, andCoreTransactionBuilder.useOnlyAddedInputs()in the Swift SDK, exposing key-wallet's opt-in.Opt-in throughout: no existing caller changes behaviour.
About the pin
It continues the existing cherry-pick lineage rather than following
dev.chore/sync-fixes-filter-rescans-and-added-inputsis the current pin (4db5c367) plus:use_only_added_inputswork (dashpay/rust-dashcore#994)#866/#974 are included because they bear on the same reports: a heavily mixed wallet recognises a
different transaction set on each launch, so its balance moves without a spend. Both touch only
dash-spv/src/sync/filters/, so they carry nothing else with them.Pinning
devinstead was tried first and does not build: it drags in the sweep-event chain, and thisworkspace does not handle
WalletEvent::TransactionsSwept— six non-exhaustive matches plus a changedMnemonic::from_phrasesignature, seven errors. Handling that event is #4406's subject, and #4406 isopen and conflicting. The same wall #4459 documented; the same answer it used.
How Has This Been Tested?
cargo check -p platform-wallet -p platform-wallet-ffiagainst the pinned revision — clean.cargo test -p key-wallet --lib— 666 passed, 0 failed.TooManyInputsunbounded and builds its 500-input chunk with the opt-in (feat(key-wallet): let a build fund from only the inputs it was given rust-dashcore#994).Not yet exercised end-to-end on device: that needs the iOS side, which is a one-line follow-up in
sweepCoinJoin, and a rebuiltDashSDKFFI.xcframework.Breaking Changes
None. New FFI entry point and a dependency revision; existing callers are unaffected.
Checklist:
For repository code-owners and collaborators only