fix(master-express): forward walletPubs in consolidateUnspents and accelerate#200
Open
bitgo-ai-agent-dev[bot] wants to merge 2 commits intomasterfrom
Open
Conversation
b1caf30 to
e7341a9
Compare
consolidateUnspents and accelerate were failing for UTXO coins with "pubs are required for fixed script signing" after the SDK bump added assert(params.pubs) in abstract-utxo BitGoPsbt signing path. Update makeCustomSigningFunction to accept and forward walletPubs to awmClient.signMultisig. Update handleConsolidateUnspents and handleAccelerate to fetch all 3 keychains (user, backup, bitgo) and pass them as walletPubs, matching the sendMany flow. Ticket: WCN-447 Session-Id: 79c78e55-7d60-4e54-b656-da465c33eb23 Task-Id: 7abc45de-23d0-4914-8dad-885882f82710
The walletPubs logic fetches all 3 keychains after getWalletAndSigningKeychain. Tests using nock.disableNetConnect() were missing mocks for the backup and bitgo keychain requests, causing 500s in success-path tests. Ticket: WCN-447 Session-Id: 79c78e55-7d60-4e54-b656-da465c33eb23 Task-Id: 7abc45de-23d0-4914-8dad-885882f82710
7598526 to
8935385
Compare
pranishnepal
reviewed
May 7, 2026
| KeyIndices, | ||
| }); | ||
|
|
||
| const [userKeychain, backupKeychain, bitgoKeychain] = await Promise.all([ |
Contributor
There was a problem hiding this comment.
can we create a util func for this:
const [userKeychain, backupKeychain, bitgoKeychain] = await Promise.all([
baseCoin.keychains().get({ id: wallet.keyIds()[KeyIndices.USER] }),
baseCoin.keychains().get({ id: wallet.keyIds()[KeyIndices.BACKUP] }),
baseCoin.keychains().get({ id: wallet.keyIds()[KeyIndices.BITGO] }),
]);
const walletPubs =
userKeychain?.pub && backupKeychain?.pub && bitgoKeychain?.pub
? [userKeychain.pub, backupKeychain.pub, bitgoKeychain.pub]
: undefined;
return walletPubs;
and use it in both the places so we can just edit things in one place later?
| const coin = req.params.coin; | ||
|
|
||
| const { wallet, signingKeychain } = await getWalletAndSigningKeychain({ | ||
| const { baseCoin, wallet, signingKeychain } = await getWalletAndSigningKeychain({ |
Contributor
There was a problem hiding this comment.
should we do the same at handleConsolidate or no?
advanced-wallets/src/masterBitgoExpress/handlers/handleConsolidate.ts
Lines 85 to 89 in dcee4fc
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.
Summary
consolidateUnspentsandacceleratewere failing for UTXO coins (BTC/tBTC) with"pubs are required for fixed script signing"becausemakeCustomSigningFunctiondid not forwardwalletPubstoawmClient.signMultisigwalletPubsintomakeCustomSigningFunction, matching the fix already in place forsendManymakeCustomSigningFunctioninutils.tsupdated to accept and forward the optionalwalletPubsparameterRoot Cause
makeCustomSigningFunctiononly forwardedtxPrebuild,source, andpubto the AWM client. WithoutwalletPubs,coin.signTransaction()on the AWM side was called withoutpubs, hitting the assertion added in commitc25b99b.Test Plan
consolidateUnspents.test.ts: verifywalletPubsis passed to AWM sign request, and verify it is omitted when any keychain lacks a pubaccelerate.test.tswith identical coverageTicket: WCN-447