-
-
Notifications
You must be signed in to change notification settings - Fork 227
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
Replace heavy crypto packages for lighter noble implementations via upgrading ethereumjs-util
to latest (now called @ethereumjs/util
)
#260
Conversation
1709cf6
to
546c992
Compare
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.
as possible try to remove toBuffer calls where we know the input type
@kumavis this currently appears to be increasing the size of the package... 🤦 |
This is just true of the dist/ folder, not the overall impact on the consumer and its dependency tree, so yeah its gonna be bigger with all those added utility functions I'm trying to evaluate the impact upstream using |
Updating ethereumjs-util is also useful for the reasons noted here around getting consistent types from bn.js after a recent breaking-change update adopted elsewhere. |
Why are you keeping |
I'm using |
@adonesky1 understood, so it's basically copy-pasting code from other lib. I've noticed about 5 lines that use |
cb9490a
to
1ed5ceb
Compare
Yeah looking into this now. Will try to make it work in a subsequent PR. |
ethereumjs-util
to latest (now called @ethereumjs/util
)
f767905
to
0c7cac4
Compare
5094d73
to
b85ac7e
Compare
Removes
secp256k1
andkeccak
via as dependencies by upgrading from[email protected]
to its latest (beta) version@ethereumjs/[email protected]
which uses noble implementations for crypto. Replaces keccak hashing withkeccak256
fromethereum-cryptography/keccak
To achieve this I've copied functions from
ethereumjs-abi
(rawEncode and solidityPack) that we use to pack the values before hashing them with the newly addedkeccak256
implementation from ethereum-cryptography/keccak, and removed theethereumjs-abi
dependency. I've extracted these functions and more or less preserved their implementations (solidityPack, rawEncode) minus the references toethereumjs/[email protected]
methods, which, if left intact would keepsecp256k1
andkeccak
in our dependency tree.Next steps:
bn.js
forBigInt
(per this comment: Replace heavy crypto packages for lighter noble implementations via upgradingethereumjs-util
to latest (now called@ethereumjs/util
) #260 (comment))