-
Notifications
You must be signed in to change notification settings - Fork 984
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
feat(identity): make rand optional #4349
Conversation
Some restricted environments lack proper random source, and `getrandom` crate fails to compile. However, random sources is needed only for random key generation which is not always required. This change introduces `rand` feature flag that is gate to all the functionality that requires `rand` crate.
This pull request has merge conflicts. Could you please resolve them @monoid? 🙏 |
Thanks! This is unfortunately a breaking change so I'd like to hold off on it for a while. We've only just released a breaking change to Is this blocking you on something? Out of interest, what is your usecase where you don't have a randomness source? Do |
Well, we can live with git branch deps for some time. I've submitted it mostly because it can be useful for others.
We have bunch of (normal) peers who do some coordinated task and submit their result on a chain where a smartcontract validates their outputs. The smartcontract uses |
Thanks for sharing! Not sure if that is viable but perhaps other libraries also need randomness and the target should register a randomness source? See https://docs.rs/getrandom/latest/getrandom/index.html#custom-implementations. In any case we can leave this open until we are making another breaking change. |
Note for myself: Create a separate milestone and link it to the next |
It has to be enabled by rand feature only.
This pull request has merge conflicts. Could you please resolve them @monoid? 🙏 |
I am tempted to release this as a patch-release. Whilst technically a breaking change, it will only hit users that actively say |
Can you add the Line 111 in d862b40
|
@thomaseizinger Done! |
yeah makes sense to me Thomas, did sorta similar with |
Thanks for fixing the tests @monoid ! As a last thing, can you bump the patch-version of |
@thomaseizinger done! |
Awesome, thanks! Sorry for the hassle! |
@thomaseizinger no problem! This is a life of an actively developed project. :) |
I think some unit tests still implicitly depend on the |
@thomaseizinger tests should work now. |
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.
Feel free to go ahead here @thomaseizinger. Thank you for driving this to both of you.
@thomaseizinger when you cut the patch release, would you mind keeping an eye open the repositories of our largest users to make sure they don't face any difficulties with the upgrade?
Projects that come to my mind are:
- https://github.com/paritytech/polkadot-sdk
- Probably best to simply propose a patch on Upgrade libp2p to 0.52.4 paritytech/polkadot-sdk#1631
- https://github.com/sigp/lighthouse
- https://github.com/ChainSafe/forest
Still a few more failures unfortunately. You can ignore the |
Ugh, these two kademlia tests seems to be flaky as of recently. I'll deal with that tomorrow .. |
Ok, I'm always at your disposal to merge/rebase/etc. |
Okay, flaky tests are fixed on master, can you merge that into this branch please? |
Done! |
Many CI steps are failing now that #4620 is merged. Given that |
Yeah I realized that the situation is not ideal 😅
You can't ignore them because they are marked as required. Mergify won't merge your PR until they pass. Let's brain-storm something later today. |
This pull request has merge conflicts. Could you please resolve them @monoid? 🙏 |
@monoid There are no other PRs queued for merge at the moment so if you are around, we can get this one in soon :) I'll need you to merge Thanks for this PR and sorry that it has been dragging on for so long! |
Yeah, I know! Will make PR from the personal repo next time :) I wasn't aware of this restriction (perhaps, it's just particular organization's security settings). Thank you and other guys for the assistance and advices! I've merged the master branch. I will be online for the next 12h if any more action is needed on my side. |
Description
Some restricted environments lack proper random source, and
getrandom
crate fails to compile. However, random sources is needed only for random key generation which is not always required.This change introduces
rand
feature flag that is gate to all the functionality that requiresrand
crate.Notes & open questions
The idea of this pull request was born when I tried to use the crate in NEAR contract.
Change checklist