Skip to content
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

update secp256k1 to v4.0 #32

Merged
merged 1 commit into from
May 28, 2020
Merged

update secp256k1 to v4.0 #32

merged 1 commit into from
May 28, 2020

Conversation

homura
Copy link
Contributor

@homura homura commented Mar 30, 2020

Since secp256k1 v4.0 use the N-API, this can avoid some unexpected situations similar to when worker_thread calls binding and use Pure JS version

Try the following code, and run with secp256k1@3.8 and secp256k1@4.0, you will find that in the worker_thread, the error caused by Module did not self-register will cause its performance to decrease due to the implementation of the JS version

const { Worker, isMainThread } = require("worker_threads");

process.env.DEBUG = "*";

if (isMainThread) {
  new Worker(__filename);
  const secp256k1 = require("secp256k1");

} else {
  const secp256k1 = require("secp256k1");
}

@homura homura changed the title update secp256k1 to v4.0 with nAPI update secp256k1 to v4.0 Mar 30, 2020
@RyanZim RyanZim requested a review from jprichardson March 30, 2020 14:41
@junderw
Copy link
Member

junderw commented Apr 10, 2020

utACK it looks good to me.

@junderw
Copy link
Member

junderw commented Apr 10, 2020

Bonus: found #33 when verifying this code change.

@holgerd77
Copy link

Any chance this gets merged and released soon?

@holgerd77
Copy link

Hi, just wanted to give this a cautious iteration: we have an outstanding release - see ethereumjs/ethereumjs-wallet#113 - and a merge and subsequent release here would substantially improve the installation experience since one main part was to update the secp256k1 dependencies to v4.0 coming with the pre-build binaries.

If not possible so be it but otherwise a release here would be super cool! 😄

@jprichardson
Copy link
Member

@holgerd77 thanks. I had no idea this was used in ethereumjs-wallet. Will have this merged and updated.

@holgerd77
Copy link

@jprichardson Thanks, that's so great! 😄

@RyanZim RyanZim merged commit 6bd6cb9 into cryptocoinjs:master May 28, 2020
RyanZim added a commit that referenced this pull request May 28, 2020
Needed because of #32
@RyanZim RyanZim mentioned this pull request May 28, 2020
jprichardson pushed a commit that referenced this pull request May 28, 2020
Needed because of #32
@RyanZim
Copy link
Member

RyanZim commented May 29, 2020

Published in v2.0.0 🎉

@holgerd77
Copy link

Thanks for the release, great! 😄

We have some tests failing now with the updated version. Didn't get a chance to have a look yet, but just to already raise some awareness here.

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.

5 participants