remove the random builtin function#1041
Conversation
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
|
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.
Please change your PR's title to something less ambiguous.
A suggestion would be Remove Substrate 'random' builtin.
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com> Signed-off-by: xermicus <cyrill@parity.io>
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.