-
Notifications
You must be signed in to change notification settings - Fork 972
Switch from random-lib 2.1.0 to brave-crypto 0.2.0. #14843
Conversation
364cc32
to
77364ca
Compare
package-lock.json
Outdated
"version": "2.1.0", | ||
"resolved": "https://registry.npmjs.org/random-lib/-/random-lib-2.1.0.tgz", | ||
"integrity": "sha1-PrOXD/J8Gvc8WIq5EHXY8KBDjfU=", | ||
"version": "3.0.0", |
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.
@riastradh-brave do you know why this diff is here?
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.
@diracdeltas It is because upstream bat-* packages were updated to use random-lib 3.0.0. I filed PRs to remove those dependencies. Once they are merged, I expect it will go away. We can hold off until those PRs are merged and double-check if you like:
brave-intl/bat-client#92
brave-intl/bat-ledger-spec#27
brave-intl/bat-publisher#41
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.
i think we should merge the upstream ones first so that this only requires one browser-laptop PR
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.
bat-ledger-spec appears to be not used in this repo; the others have been merged
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.
done in 2dae1d5
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.
lgtm. want to open an issue and assign it to a milestone?
I picked 0.23.x release 4 arbitrarily since it's such a minor low-risk change; feel free to move it to a later one if need be. |
moving to release 5 since release 4 is almost out the door |
Update bat-client and bat-publisher.
2dae1d5
to
e6b9f0c
Compare
@riastradh-brave approved and merged! for future reference the workflow should be:
|
@riastradh-brave @diracdeltas does this PR fix #6944? Also: no manual QA needed for this right? |
this does not address #6944 - that requires more browser-laptop changes but should be straightforward i'm ok with no QA needed |
@bsclifton @diracdeltas Correct -- this does not address #6944, but #14851 does. |
And yes, no QA needed here; unit tests are adequate. |
random-lib 2.1.0 samples from nonuniform distributions when we want uniform distributions.
brave-crypto 0.2.0 has a drop-in replacement for the randomInt function of random-lib 2.1.0, so this is just a matter of changing package.json and the require call. random-lib 3.0.0 also fixes the distribution, but introduces a (minor) performance regression and is still an additional third-party dependency to carry.
fix #14845
Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
npm run unittest
Reviewer Checklist:
Tests