-
Notifications
You must be signed in to change notification settings - Fork 251
remove the random builtin function #1041
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
remove the random builtin function #1041
Conversation
Signed-off-by: Cyrill Leutwiler <[email protected]>
|
Thanks. Looks good to me. I don't see |
Would it make sense to keep this function in solang until VRF is usable from solang? Also out of curiosity, what was broken with the implementation of |
We still need it during contract instantiation, if the salt is missing. I'll remove it completely as soon as the nonce API is available. As for now I don't think we should be too concerned about providing VRF to the users directly via solang... I think it is 1. too specific depending on the target runtime env and 2. it can be done in user space / via oracles or chain extensions.
It is potentially predictable. |
This title seems like you have randomly chosen a builtin in Solang and removed it. |
LucasSte
left a comment
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.
Please change your PR's title to something less ambiguous.
A suggestion would be Remove Substrate 'random' builtin.
Signed-off-by: Cyrill Leutwiler <[email protected]> Signed-off-by: xermicus <[email protected]>
It is unsafe for most use-cases and will be deprecated in
ink!. Contract authors should rather use VRF from chain extensions or oracles.The
seal_randomAPI is still used to calculate the salt on instantiation (if it is missing). There will be a new APIseal_noncewhich can be used to replace this. I'll do this in another PR once the new nonce API is available in pallets contract.Side note: In my opinion it is completely safe to remove this built in. It was completely broken for IDK exactly how long but no one complained.