Repository navigation
fix(wallet-toolbox): StorageIdb empty array filters match everything, like StorageKnex - #792
Merged
ty-everett merged 18 commits intoOct 10, 2026
Merged
Conversation
…ry JSON carries it binaryRequests encodes only Uint8Array values, but the toolbox built its largest storage payloads as number[]: StorageClientBase.createAction set inputBEEF from pruned.toBinary(), and the signer's internalizeAction passed ab.toBinaryAtomic(txid). They travelled as JSON number arrays even with binary negotiated, and a BEEF over ~100 KB exceeded the auth middleware's 100,000-value request limit. Use the SDK's toUint8Array() / toUint8ArrayAtomic() for createAction and no-send-expiry inputBEEF and internalizeAction AtomicBEEF, and return listOutputs BEEF, createAction sourceTransaction and competingBeef as Uint8Array from Knex storage. BEEF and AtomicBEEF already allow Uint8Array, and the server's byte validation accepts it. Legacy peers that have not negotiated binary still receive number arrays.
BRC-177 Prefunding step 2 requires the anchor to be large enough both to fund the protected action and to be reclaimed, net of a reclaim fee. The anchor was sized for the protected action only, so value-neutral actions (e.g. a 1-sat token transfer) were refused because the anchor could not pay for its own reclaim. Size the anchor as the larger of the protected action's need and the reclaim floor (reclaim fee plus minimum reclaim output). The protected action carries no change, so the funding planner now runs with a zero change cap and pays any surplus as fee. generateChangeSdk accepts maxChangeOutputs: 0 to mean "create no change". Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R53QzSzGv4LkfmxBd4URiD
Replace the "maxChangeOutputs: 0 means no change" overload with a dedicated GenerateChangeSdkParams.surplusToFee flag. When set, the planner creates no change output and pays any surplus beyond the required fee as fee. maxChangeOutputs keeps its original rule (minimum 1, default 8); the BRC-177 protected branch goes back to a cap of 1 and sets surplusToFee. The protected funding plan is the only setter. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R53QzSzGv4LkfmxBd4URiD
Compute the change-output cap as before, then zero it when surplusToFee is set. No behaviour change (SonarCloud typescript:S3358). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R53QzSzGv4LkfmxBd4URiD
… JSON StorageServer converts the byte columns of findOutputsAuth and findProvenTxReqs results when the client negotiated binary JSON, as it already does for getSyncChunk. Clients convert them back to number[] in validateEntities. Restore competingBeef to number[] in createAction's WERR_REVIEW_ACTIONS. Thrown errors are serialized with stringifyBRC100, so it never reached the binary codec.
filterCertificates (certifiers, types), filterOutputTagMaps (tagIds) and filterTransactions (status) rejected every row when the array was empty. StorageKnex and the other StorageIdb filters skip an empty array. Guard the four checks with `.length > 0`. Fixes bsv-blockchain#791 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R53QzSzGv4LkfmxBd4URiD
shruggr
marked this pull request as ready for review
October 4, 2026 08:00
shruggr
requested review from
BraydenLangley,
sirdeggen,
tonesnotes and
ty-everett
as code owners
October 4, 2026 08:00
shruggr
added a commit
to shruggr/ts-stack
that referenced
this pull request
Oct 4, 2026
Adds bsv-blockchain#792 (StorageIdb empty array filters) to the interim repack. Not for upstream. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R53QzSzGv4LkfmxBd4URiD
shruggr
added a commit
to yours-org/yours-wallet
that referenced
this pull request
Oct 4, 2026
StorageIdb empty array filters (bsv-blockchain/ts-stack#792), so listCertificates by type works on local storage. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R53QzSzGv4LkfmxBd4URiD
2 tasks done
# Conflicts: # docs/reference/package-api-migrations.md # governance/package-release-notes.json # packages/wallet/wallet-toolbox/CHANGELOG.md
ty-everett
marked this pull request as draft
October 10, 2026 23:42
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
ty-everett
marked this pull request as ready for review
October 10, 2026 23:53
ty-everett
approved these changes
Oct 10, 2026
This was referenced Oct 10, 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.



Program and scope
IndexedDB now treats empty certificate certifier/type arrays, output-tag ID arrays and transaction status arrays as omitted optional filters, matching Knex. Nonempty filters, partial predicates and user ownership are still enforced.
Includes the preceding merged David fixes. The main integration changed ancestry only; the qualified candidate tree is identical. Exact reviewed head:
c59d6d812d6e704fe47401ee564d6382bf614f96.Impact
Verification
pnpm health:check,pnpm lint,pnpm format:check,pnpm build,pnpm typecheck, documentation build and governed wallet property suite: passed.pack:checkcontracts passed: conditional/wildcard exports, declarations, source maps, publint, strict type resolution and clean consumers.git diff --checkand owned documentation generation passed. No generated test report committed.codecov/patchreport is 75.00% and failed its reporting target; it is explicitly informational in the existing CI workflow. No gate, skip, suppression or baseline was changed.Hosted CI 38096012347, conformance 38096012335 and CodeQL 38096012339 passed; existing scope skips were validated by the merge gate. Sonar zero-findings and both Socket checks passed. The advisory coverage discrepancy is recorded above.
Security and dependencies
Release and operations
Completion evidence
Original implementation explanation
Fixes #791.
StorageIdbrejected every row when an array filter was present but empty:certifiersandtypesinfilterCertificates,tagIdsinfilterOutputTagMaps,statusinfilterTransactions.StorageKnexand the otherStorageIdbfilters skip an empty array.listCertificatesalways passescertifiers: [], so a lookup by type returned nothing on IndexedDB.Adds the
.length > 0guard to the four checks and two assertions totest/storage/idb/find.test.ts.🤖 Generated with Claude Code
https://claude.ai/code/session_01R53QzSzGv4LkfmxBd4URiD