perf(wallet): accelerate createAction funding pipeline - #425
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
ty-everett
marked this pull request as ready for review
August 3, 2026 02:35
ty-everett
requested review from
BraydenLangley,
sirdeggen and
tonesnotes
as code owners
August 3, 2026 02:35
|
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.



What
createActionfunding completely in memory before inserting its transaction row@bsv/sdk@2.2.18and Wallet Toolbox/client/mobile2.4.22Why
Recent successful wallet telemetry showed
createActionaround 2.16 s p50, with storage planning/creation around 2.145 s p50 and BEEF merging around 1.795 s p50. The old allocator performed one storage transaction per selected input; fragmented wallets could therefore turn a single action into hundreds of queries and more than 100 write transactions. It also inserted a transaction before proving economic sufficiency.This keeps the historical exact / least-over / largest-under selection policy and fee model, but separates read-only planning from one atomic claim.
Measured impact
Identical SQLite benchmark against unmodified
c212b5ee7:The representative fragmented case is 12.4x faster locally, with storage work flat as selected-input count grows. The retained SDK benchmark also reduces 50 unchanged sorts of a 20k-transaction BEEF from a 235.86 ms median to 9.72 ms (24.3x); cold-sort behavior is unchanged.
Compatibility and privacy
There are no changes to:
Trace context remains local to existing telemetry carriers/sinks. Attributes are bounded counts, sizes, flags, fees, and timings only—never txids, outpoints, scripts, payloads, identity keys, or secrets. Existing external storage providers remain source-compatible through concrete fallback methods.
Storage migrations
2026-08-02-001 add createAction funding selection indexVerification
pnpm check-versionsstill reports four existing declaration-dependency findings for Paymail, Auth Express, Payment Express, and Wallet Relay. The same four findings reproduce on untouchedorigin/main; this PR does not expand into unrelated dependency declarations.Dependency evidence
@bsv/sdk2.2.17→2.2.18;@bsv/wallet-toolbox,@bsv/wallet-toolbox-client, and@bsv/wallet-toolbox-mobile2.4.21→2.4.22.