You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We also needs helper methods to make a reasonable secure random number from the seed. i.e. have more entropy incorporated into it like sender account, extrinsic index etc.
And bunch more helper methods to generate randoms numbers from seed and update seeds within the contract.
Because otherwise each contract within a same block will see a same seed and it can be a security issue. e.g. a contract execution can read the seed, determine if it should do something to change the state (top up account balance), to possibly effect the result of following contract execution in the same block (gambling tx will fail if account have no enough balance, but the the previous tx in the same block can top it up if it thinks it is a favorable game in this block).
@xlc We will do this after Sub0. It totally makes sense to develop a more user friendly, less error prone API, we just need to figure out the specific details.
Add support for
ext_random_seed()
in PDSL.As supported in Substrate:
https://github.com/paritytech/substrate/blob/e748c33c8ef40bd51dc122b7f11fcf26b8354957/srml/contract/src/wasm/runtime.rs#L493
The text was updated successfully, but these errors were encountered: