Repository navigation
fix(wallet-toolbox): reserve stored explicit inputs whose source is already in the batch BEEF - #1138
Draft
GenericCPU wants to merge 3 commits into
Conversation
…lready in the batch BEEF ActionBatchWorkspace.missingExplicitOutpoints skipped any explicit input whose source transaction was already in sharedBeef, for example because the caller passed it in inputBEEF. The planner then resolved the input from the BEEF instead of storage, and commitActionBatch rejected the batch with "input <outpoint> was not reserved by this action batch". Reserve every explicit input the workspace has not staged or reserved. Outpoints with no storage row still reserve nothing, so external inputs keep resolving from the BEEF. Co-authored-by: Cursor <cursoragent@cursor.com>
2 tasks done
…n the batch BEEF The previous commit reserved every explicit input the batch had not staged or reserved. An external input carried in inputBEEF then cost a storage call, reserved an extra change output and failed outright once the batch was full. Keep the main-branch skip for inputs whose source is already in sharedBeef, and reserve only those this wallet stores, found with a read-only findOutputs scoped to the authenticated user. Adds a negative test: an external input carried in inputBEEF is never sent for reservation and the batch commits. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
This branch has not been deployed
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
ActionBatchWorkspace.missingExplicitOutpointsskipped explicit inputs whose source transaction was already insharedBeef(for example frominputBEEF). The planner used the BEEF copy, nothing reserved the stored output, andcommitActionBatchrejected the batch withinput <outpoint> was not reserved by this action batch. The workspace keeps skipping inputs whose source is insharedBeef, except those this wallet stores, which it finds with a read-onlyfindOutputs(scoped to the authenticated user, served by everyStorageServerversion) and reserves. External inputs carried ininputBEEFare never sent for reservation, so they cost no extra change reservation and cannot hit the batch capacity limit.3e971254463fe2ae9c2504790c738b84e24ee4dbImpact
Affected packages/services and intended patch versions (publication occurs only
through the release workflow after approval):
@bsv/wallet-toolboxpatch.Verification
3e971254463fe2ae9c2504790c738b84e24ee4db):pnpm --filter @bsv/wallet-toolbox exec jest --watchman=false test/Wallet/action/actionBatch.test.ts: 61 passed, 61 total (wholeactionBatch.test.tssuite). New test: "a stored explicit input is reserved even when inputBEEF already carries its source" and the negative "an external input carried in inputBEEF reserves nothing" (the external source is created by a second wallet with separate storage). Without the source change it fails the stored-input test withWERR_INVALID_OPERATION: input <txid>.0 was not reserved by this action batch; a version that reserves every unclaimed input fails the negative test.cd packages/wallet/wallet-toolbox && pnpm exec tsc --noEmit -p tsconfig.json: exit 0pnpm exec oxlint <changed files>: exit 0, no warningspnpm exec prettier --check <changed files>: clean on every changed hunkcompatibility, public API, artifacts, dependencies, docs, and operations
scope-based skip is expected and validated by the merge gate
Security and dependencies
audit results were reviewed
(including accepted or false-positive issue states) and zero unreviewed hotspots;
Sonar's aggregate
Quality Gate passedverdict alone is not merge evidenceand removal condition
Release and operations
controlling program (deferred to the release workflow)
Completion evidence
passing checks, resolved alerts, measurements, or an approved exception
guidance are current or concretely not applicable
being handed to another contributor as "complete"
restriction is assumed