fix(unspents): pin varuint-bitcoin as explicit direct dependency - #9453
Draft
bitgo-ai-agent-dev[bot] wants to merge 2 commits into
Draft
fix(unspents): pin varuint-bitcoin as explicit direct dependency#9453bitgo-ai-agent-dev[bot] wants to merge 2 commits into
bitgo-ai-agent-dev[bot] wants to merge 2 commits into
Conversation
src/inputWeights.ts directly imports varuint-bitcoin for encodingLength used in all fee/vsize calculations, but it was previously declared with a caret range (^1.0.4) that could resolve unexpected 1.x releases. Tighten the declared range to ~1.1.2 (patch-level tilde) so the version this package executes is controlled by its own range — not by whatever @bitgo/utxo-lib's transitive copy happens to resolve to. This also eliminates the phantom-dependency risk under strict linkers (pnpm default, Yarn PnP) where hoisting is not guaranteed. Ticket: WCN-2005 Session-Id: 246d0476-a850-4ced-ba5e-27978aa7cc08 Task-Id: 11c93817-9a0a-4fbb-b685-5cf43507b89a
Replace the ^1.0.4 key alias in the yarn.lock stanza with ~1.1.2 to match the updated package.json range. Resolved version remains 1.1.2; only the declared range key changes. Required so --frozen-lockfile CI installs do not fail on the mismatch. Ticket: WCN-2005 Session-Id: 246d0476-a850-4ced-ba5e-27978aa7cc08 Task-Id: 11c93817-9a0a-4fbb-b685-5cf43507b89a
Contributor
ralph-bitgo
Bot
force-pushed
the
WCN-2005-varuint-bitcoin-explicit-dependency
branch
from
August 7, 2026 20:06
01adf83 to
8979d28
Compare
bitgo-ai-agent-dev
Bot
force-pushed
the
WCN-2005-varuint-bitcoin-explicit-dependency
branch
from
August 7, 2026 20:06
8979d28 to
3c3dda7
Compare
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
varuint-bitcoinversion range inmodules/unspents/package.jsonfrom^1.0.4to~1.1.2yarn.lockstanza key to replace the^1.0.4alias with~1.1.2Why
src/inputWeights.tsdirectly importsvaruint-bitcoinforencodingLength(), which is used in every fee/vsize calculation in the package — but previously the resolved version and pinning were effectively owned by@bitgo/utxo-lib's transitive dependency range, not by@bitgo/unspentsitselfMODULE_NOT_FOUND— an availability loss for any consumer using a strict package manager~1.1.2ensures@bitgo/unspentscontrols which patch-level version of this consensus-serialization function it executes, independent of future changes to@bitgo/utxo-lib's dependency tree1.1.2(already locked); this change only makes the ownership explicit and defensiveTest plan
yarn workspace @bitgo/unspents unit-testpassesyarn install --frozen-lockfilesucceeds (lock file stanza updated to include~1.1.2key)Ticket: WCN-2005