Repository navigation
Conversation
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.
Fixes #483.
The bug
signTxsWithAutoFetchcollected the reference inputs of every transaction in the batch, fetched them into one combinedreferenceUtxoslist, and passed that same list to each transaction's signing call.computeRequiredKeyHashesSyncthen derived native-script key hashes from those reference UTxOs regardless of which transaction they belonged to — so a native script referenced by one transaction caused an unrelated transaction in the batch to be signed. The single-transaction path (signWithAutoFetch) scopes reference UTxOs to that transaction's own inputs; the batch path did not.The fix
Two layers, both in
packages/evolution/src/sdk/client/internal/Signing.ts:referenceInputs, matching the single-transaction path.computeRequiredKeyHashesSynconly counts a reference UTxO's native script when the transaction actually references that UTxO. This also closes the same hole for a directsignTxcall handed an over-widereferenceUtxoscontext, instead of relying on every caller to scope the list.Tests
New file
Signing.BatchReferenceUtxos.test.ts(5 tests), each run one at a time against main first:[tx1, tx2]where only tx2 references a native script naming the wallet's payment key hash — on main, tx1's witness set wrongly contained the wallet's vkey witness (4eefc6f3…); after the fix it is empty and tx2's contains it. RED on main, GREEN after.signTxwith an over-widereferenceUtxoscontext for a transaction that does not reference the script UTxO — RED on main, GREEN after.signTxsigns for a reference UTxO the transaction does reference, and the single-transaction auto-fetch path signs for its own reference script.Full suite: 1683 passed / 75 skipped / 0 failed (files 102 passed / 1 skipped of 103 — exactly main's 1678 baseline + 5 new).
tsc --noEmitand eslint clean; the touched source file's prettier diff count is unchanged from main (10 = 10). A changeset is included (patch).@Kshot9000 (https://x.com/kshot9000) · ADA donations: addr1q8hnl6vl5a6k3rw3n5g3jtte696zcl76kfatzv7gpswa9r0dj7fma6klq55y4ffm7tf0em09udnyhuk4ah92pl5x9jpqjae44v
cc @cardano-foundation @IntersectMBO — independent builder, not affiliated with the Cardano Foundation, IOG or Intersect.