-
Notifications
You must be signed in to change notification settings - Fork 179
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
[randomness final part] Update math/rand
usage
#4052
Conversation
FVM Benchstat comparisonThis branch with compared with the base branch onflow:master commit 117fcc0 The command Collapsed results for better readability
|
Codecov Report
@@ Coverage Diff @@
## master #4052 +/- ##
==========================================
- Coverage 56.25% 54.40% -1.86%
==========================================
Files 653 914 +261
Lines 64699 85199 +20500
==========================================
+ Hits 36396 46351 +9955
- Misses 25362 35263 +9901
- Partials 2941 3585 +644
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Co-authored-by: Peter Argue <89119817+peterargue@users.noreply.github.com>
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.
looks good
@peterargue I'm thinking of adding a Makefile target that checks [Update]: I added this check. |
bac7d61
to
14df98f
Compare
b09f12b
to
e3447dc
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.
Thanks for the refactoring. I reviewed mostly the relevant parts to my domain.
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.
Looks great; thanks for refactoring.
This PR is the last of multiple small PRs updating the usage of
math/rand
in all the repo, for two purposes:math/rand
in production code (seed length is too short, randomness quality is low)math/rand
can be used in test files, the functionsSeed
andRead
are deprecated in Go1.20 and should not be used as the repo prepares to upgrade the Go version.Previous related PRs include:
This final PR of the list has the following changes:
Identifier
andIdentifierList
random functions to useutils/rand
(backed by securecrypto/rand
) instead of relying onmath/rand
. The random functions areSample
,Shuffle
,SamplePct
.math/rand
PRG inDefaultLibp2pBackoffConnectorFactory
by a secure PRG (cc @yhassanzadeh13)math/rand
functionsSeed
andRead
from test files (this means some tests are now deterministic! which is temporary till Go1.20 is used), and usecrypto/rand
in some tests.math/rand
is not imported in production code, to avoid the package is re-introduced in the future.