Skip to content

fix(unspents): pin varuint-bitcoin as explicit direct dependency - #9453

Merged
davidkaplanbitgo merged 1 commit into
masterfrom
WCN-2005-varuint-bitcoin-explicit-dependency
Aug 26, 2026
Merged

fix(unspents): pin varuint-bitcoin as explicit direct dependency#9453
davidkaplanbitgo merged 1 commit into
masterfrom
WCN-2005-varuint-bitcoin-explicit-dependency

Conversation

@bitgo-ai-agent-dev

Copy link
Copy Markdown
Contributor

What

  • Tighten varuint-bitcoin version range in modules/unspents/package.json from ^1.0.4 to ~1.1.2
  • Update the yarn.lock stanza key to replace the ^1.0.4 alias with ~1.1.2

Why

  • src/inputWeights.ts directly imports varuint-bitcoin for encodingLength(), 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/unspents itself
  • Under strict linkers (pnpm default, Yarn PnP) that do not hoist transitive deps, the import would fail with MODULE_NOT_FOUND — an availability loss for any consumer using a strict package manager
  • Tightening to ~1.1.2 ensures @bitgo/unspents controls which patch-level version of this consensus-serialization function it executes, independent of future changes to @bitgo/utxo-lib's dependency tree
  • Resolved version remains 1.1.2 (already locked); this change only makes the ownership explicit and defensive

Test plan

  • yarn workspace @bitgo/unspents unit-test passes
  • yarn install --frozen-lockfile succeeds (lock file stanza updated to include ~1.1.2 key)

Ticket: WCN-2005

@linear-code

linear-code Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

WCN-2005

@ralph-bitgo
ralph-bitgo Bot force-pushed the WCN-2005-varuint-bitcoin-explicit-dependency branch from 01adf83 to 8979d28 Compare August 7, 2026 20:06
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the WCN-2005-varuint-bitcoin-explicit-dependency branch from 8979d28 to 3c3dda7 Compare August 7, 2026 20:06
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
@davidkaplanbitgo
davidkaplanbitgo force-pushed the WCN-2005-varuint-bitcoin-explicit-dependency branch from 3c3dda7 to f4263a8 Compare August 26, 2026 00:06
@davidkaplanbitgo
davidkaplanbitgo marked this pull request as ready for review August 26, 2026 00:06
@davidkaplanbitgo
davidkaplanbitgo requested a review from a team as a code owner August 26, 2026 00:06
@davidkaplanbitgo
davidkaplanbitgo merged commit 7d6aed2 into master Aug 26, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants