Skip to content

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

Draft
bitgo-ai-agent-dev[bot] wants to merge 2 commits into
masterfrom
WCN-2005-varuint-bitcoin-explicit-dependency
Draft

fix(unspents): pin varuint-bitcoin as explicit direct dependency#9453
bitgo-ai-agent-dev[bot] wants to merge 2 commits 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

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
@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
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.

1 participant