fix(crypto): replace elliptic with @noble/curves for secp256k1; retry RPC on 429; CI on Node 22 - #200
Open
pyramation wants to merge 2 commits into
Open
pyramation wants to merge 2 commits into
pyramation wants to merge 2 commits into
Conversation
… Node 22; fix migration link
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
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
Fixes #190. All secp256k1 signing, verification, recovery, and key derivation used
elliptic, which is flagged by GHSA-848j-6mx2-7j84 on every published version (latest 6.6.1, so bumping doesn't help). This switches it to@noble/curves(already used by the Ethereum package) and removesellipticfrom the install graph entirely.packages/crypto/src/secp256k1.ts:makeKeypair/createSignature/verifySignature/recoverPubkey/compressPubkey/uncompressPubkeynow usesecp256k1from@noble/curves/secp256k1. Same public API and output:r(32)||s(32)explicitly becauseExtendedSecp256k1Signature.toFixedLength()appends the recovery byte.packages/crypto/src/slip10.ts: BIP-32 parent point serialization usessecp256k1.getPublicKey(privkey, true);bn.jsstays for the scalar math.packages/auth/src/config/algorithms.ts: syncmakeKeypairusesgetPublicKey(privkey, false).@ethersproject/*deps fromethereumandinjective(no source imports them);@ethersproject/signing-keywas the remaining transitive path toelliptic.rg elliptic pnpm-lock.yamlis now empty.@noble/curvespinned to^1.9.7, not v2: noble v2 (and@scure/bip32v2) are ESM-only. They break the CJS build for consumers on Node < 20.19 and break Jest in this repo. That's why fix: dependency upgrades (bech32 v2, @noble/hashes v2, bs58 v6, @noble/curves v2, chain-registry v2) #198's CI is red. 1.9.7 ships CJS + ESM and already has the v2-style API.HttpRpcClientretries HTTP 429 (packages/utils/src/clients/http-client.ts). Run Tests was red because the Solana suite's live-devnet tests got429 Too Many Requestsfrom GitHub runners. Public devnet answers 429 withRetry-After: 10. Every user of the shared client (cosmos/ethereum/solana) hit the same wall, so the fix goes in the client, not the tests:http-client.spec.ts(Retry-After path, exhausted retries,maxRetries: 0, exponential backoff, no retry on 500)..mdx(403 → 200). Fixes Migration doc is not accessible #155.actions/checkout/setup-nodev4 → v5.Verification: Run Tests and E2E are green on CI. Locally (Node 24), full
pnpm run buildpasses, and these unit suites pass: crypto (131, including the existing pyca/cryptography vectors, deterministic signatures, recovery, compression, and SLIP-10 vectors), auth (42), utils (39), solana (181, against live devnet), amino, math, encoding, types, and pubkey.eslintcrashes on the repo config both here and on main (Failed to load plugin '@typescript-eslint'), so I didn't run lint.Link to Devin session: https://app.devin.ai/sessions/a02c84f654b94cbcb50936e98373fba5
Open in Devin Desktop: https://app.devin.ai/desktop/session/a02c84f654b94cbcb50936e98373fba5?variant=devin
Requested by: @pyramation