-
-
Notifications
You must be signed in to change notification settings - Fork 11
chore: update deps #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
chore: update deps #175
Conversation
|
Warning MetaMask internal reviewing guidelines:
Ignoring alerts on:
|
… related functions
…tils, and metadataUtils
…eplacing BN with bigint and enhancing encoding/decoding methods
…lass for improved type consistency and utility functions
|
@cursor review |
|
Skipping Bugbot: Bugbot is disabled for this repository |
src/torus.ts
Outdated
| @@ -66,20 +73,24 @@ class Torus { | |||
| allowHost, | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove allowHost
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactor /allow endpoint call to use post method and convert the headers to params + source param pointing to authorizationServerUrl's endpoint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
|
@cursor review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
|
@SocketSecurity ignore npm/@isaacs/brace-expansion@5.0.0 |
Motivation and Context
Jira Link
https://consensyssoftware.atlassian.net/browse/W3APD-5248
Description
Stack upgrade:
Summary
elliptic,bn.js,Buffer) with modern alternatives (@noble/curves, nativebigint,Uint8Array) across the entire codebase for improved security, bundle size, and ESM compatibility.@toruslabs/constantsv16,@toruslabs/eccryptov7,@toruslabs/http-helpersv9,vitestv4,typescriptv5.9, and more.sourceandauthorizationServerUrlas new optional parameters toTorusCtorOptions.Change Patterns
Crypto Library Migration
new EC("secp256k1")/new EC("ed25519")→secp256k1/ed25519from@noble/curvesecCurve.keyFromPrivate(sk).getPublic()→ecCurve.Point.BASE.multiply(sk).toAffine()ecCurve.keyFromPublic({x, y})→ecCurve.Point.fromAffine({x, y})ecCurve.genKeyPair().getPrivate()→ecCurve.utils.randomSecretKey()ecCurve.n→ecCurve.Point.CURVE().necCurve.sign(msg, key)→secp256k1.sign(msg, key, { prehash: false })Data Type Replacements
BN→bigint(all arithmetic uses native operators +mod()/invert()from@noble/curves/abstract/modular)new BN(x, "hex")→toBigIntBE(x)bn.toString("hex", 64)→bigintToHex(bn)bn.add/sub/mul/umod→+/-/*/mod()bn.invm(n)→invert(bn, n)bn.cmp(other)→ native comparison operators (===,<,>)Buffer → Uint8Array
Buffer.from(hex, "hex")→hexToBytes(hex)buffer.toString("hex")→bytesToHex(bytes)Buffer.from(str, "utf8")→utf8ToBytes(str)(viaTextEncoder)buffer.toString("base64")→bytesToBase64(bytes)(viabtoa)Buffer.from(b64, "base64")→base64ToBytes(b64)(viaatob)Buffer.concat([...])→concatBytes(...)Buffer.from(keccakHash(...))→bytesToHex(keccakHash(...))Type Definitions
ECtype →Curve(typeof secp256k1 | typeof ed25519)BNString→BigIntString(string | bigint)curve.base.BasePoint→Point2D({ x: bigint; y: bigint })Edge Case Handling
0nscalar inPoint.multiply()(noble-curves rejects zero scalar)secp256k1.sign()called with{ prehash: false }to avoid double-hashingBreaking Changes
BN→bigintin all public APIs (Point,Share,Polynomial, utility functions)Buffer→Uint8Arrayin all public APIsEC→Curvetype for curve parametersellipticandbn.jsremoved from dependenciesTypes of changes
Checklist
Note
Low Risk
Small repo-maintenance changes (Node version pin, docs, lint ignores) with minimal runtime impact; main risk is CI/dev env mismatch if consumers aren’t on Node 24+.
Overview
Updates the repo’s Node version requirement by changing
.nvmrcfrom>=18.xto>=24.x.Removes the README mention of the
umdbuild, aligning docs with the remainingesm/cjsoutputs.Adjusts
eslint.config.mjsto ignoredist/**andbabel.config.js, and relaxesimport/no-extraneous-dependenciesfortest/**files.Written by Cursor Bugbot for commit 32e9a61. This will update automatically on new commits. Configure here.