-
Notifications
You must be signed in to change notification settings - Fork 151
use random byte array instead of process_id and machine_id #114
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
Conversation
@kyeah i opened this new PR instead of the previous wasm-only one. thanks! |
970dd94
to
3355faa
Compare
3355faa
to
a1e7aa0
Compare
@saghm would you have time to give this a review some time this week? |
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.
hey @lrlna — super super sorry for the delay, thank you for waiting. This looks correct to specification (5-digit PRNG-generated number with OS-level entropy.)
Thank you for the change. I'll be more responsive next time :)
Two notes:
|
@kyeah thanks so much for the review! \o/
|
@lrlna That's another way to do it! Or we could use random bytes only for WASM, and then make it the default everywhere after a deprecation period. I think it's unlikely that people are using the machine_id and process_id methods though, and we'll eventually need a major semver bump (or minor based on the lax versioning in the crates community), so I'd be fine doing a hard cut for this release. I'll let @zonyitoo chime in if there's thoughts on how careful we want to be here w/ the public API. |
Of course, these changes have to be in a major version bump. |
hello! Sorry I am the one who's been quiet now!! The reason travis wasn't passing is because Decimal128 library upstream is a wrapper around C, and is therefore not compatible with WASM. Although I am currently working on a Decimal128 implementation that doesn't involve using C code, it might take a bit more time. And it would be beneficial for this code to be in master regardless of whether it's WASM compatible or not. Once I fix up my new Decimal128 implementation, I can put this check back into travis, and we should be back in fully operational in WASM land 🎉 |
It looks like the nightly tests are failing due to the |
Pinging @kyeah again? |
@saghm yes I think that's right, thank you for the followup ping! |
@saghm let me know if you end up making a PR. I will rebase |
Yep, I'll make a PR now. Thanks for the response Kevin! |
Just opened #120; hopefully the CI will pass and then we can merge it |
Merged into master, I'll let you merge/rebase @lrlna and then this should be good to go, thanks 🙏 |
Merged. right? @kyeah |
One test is failed in nightly:
Hmm.. |
woo! Thanks for merging! I thought @saghm 's fix should have cleared that error up? That seems to be a similar error that was on master before 🤔 |
Hello o/
I made a PR last week to compat for WASM compilation, adding a WASM specific method to use random bytes arrays to substitute a call to
libc
and gettinghostname
. In the discussion there, @saghm pointed out MongoDB drivers are now transitioning to use 5 random bytes instead ofprocess_id
andmachine_id
(spec). This PR implements that.In addition to using random bytes, this PR also:
process_id
andmachine_id
entirelyThis would be probably a semver major in semver terms, but I am not sure how you'd want to handle that (or deprecation for that matter).
Thank you for your time!