Skip to content

perf: lazy load ecc#205

Merged
matthewjablack merged 2 commits into
masterfrom
lazy-load-ecc
May 5, 2026
Merged

perf: lazy load ecc#205
matthewjablack merged 2 commits into
masterfrom
lazy-load-ecc

Conversation

@bennyhodl

Copy link
Copy Markdown
Collaborator
  • perf: lazy load ecc
  • perf: lazy load ecc

@changeset-bot

changeset-bot Bot commented Apr 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a92f09a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
Name Type
@atomicfinance/bitcoin-js-wallet-provider Patch
@atomicfinance/bitcoin-ddk-provider Patch
@atomicfinance/bitcoin-dlc-provider Patch
@atomicfinance/client Patch
@atomicfinance/utils Patch
@atomicfinance/bitcoin-cfd-address-derivation-provider Patch
@atomicfinance/bitcoin-cfd-provider Patch
@atomicfinance/bitcoin-ddk-address-derivation-provider Patch
@atomicfinance/bitcoin-esplora-api-provider Patch
@atomicfinance/bitcoin-esplora-batch-api-provider Patch
@atomicfinance/bitcoin-node-wallet-provider Patch
@atomicfinance/bitcoin-rpc-provider Patch
@atomicfinance/bitcoin-utils Patch
@atomicfinance/bitcoin-wallet-provider Patch
@atomicfinance/crypto Patch
@atomicfinance/errors Patch
@atomicfinance/jsonrpc-provider Patch
@atomicfinance/node-provider Patch
@atomicfinance/provider Patch
@atomicfinance/types Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@bennyhodl bennyhodl force-pushed the lazy-load-ecc branch 2 times, most recently from 8d18ced to c831511 Compare April 29, 2026 02:26

@matthewjablack matthewjablack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit

Other than that LGTM

Comment thread packages/utils/lib/lazyEcc.ts Outdated
Comment thread packages/utils/lib/lazyEcc.ts
Comment thread packages/utils/lib/lazyEcc.ts
@matthewjablack

Copy link
Copy Markdown
Contributor

Types look good now, thanks! Two remaining items:

  1. BitcoinNodeWalletProvider.ts still uses eager ECCimport * as ecc + const ECPair = ECPairFactory(ecc) at top level (lines 16/25). Any consumer importing this provider still pays the full ~1.6s Hermes cost at module load. Needs the same getECPair() migration as the other three providers.

  2. utils/package.json missing peerDependencieslazyEcc.ts calls require('@bitcoin-js/tiny-secp256k1-asmjs') and require('ecpair') at runtime but neither is declared in utils's dependencies. Works via monorepo hoisting but will break standalone consumers. Add both as optional peerDependencies.

@matthewjablack

matthewjablack commented May 5, 2026

Copy link
Copy Markdown
Contributor

Both items addressed in a92f09a. LGTM — approving.

- Migrate remaining provider to use getECPair() from utils
- Add ecpair and tiny-secp256k1-asmjs as optional peerDeps in utils
@matthewjablack matthewjablack merged commit 82c2f2b into master May 5, 2026
2 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.

2 participants