Clean up random seed to make a bit more flexible (#2456)
* Reformulate random seed to be more random
- First 80 random values come from cycling the incomplete series (
instead of filling with zeroes)
- Calculate random material each usage (use a single amalgamated
ring buffer to store them for avoiding 81 lookups each time)
- Mutate inputs by hashing each with:
- its index (into the 81)
- an additional "subject" key provided by caller
This keeps the final output low-influence while still allowing
it to be used as the seed to independent contexts. (Hashing the
result to give the final seed is no better than using parent_hash).
* Docs
* Bump runtime
* Update notes
* Remove feature(alloc)
* Update srml/system/src/lib.rs
Co-Authored-By:
gavofyork <github@gavwood.com>
Showing
- substrate/core/executor/wasm/src/lib.rs 0 additions, 1 deletionsubstrate/core/executor/wasm/src/lib.rs
- substrate/core/finality-grandpa/primitives/src/lib.rs 0 additions, 1 deletionsubstrate/core/finality-grandpa/primitives/src/lib.rs
- substrate/core/primitives/src/lib.rs 0 additions, 1 deletionsubstrate/core/primitives/src/lib.rs
- substrate/core/sr-io/src/lib.rs 0 additions, 1 deletionsubstrate/core/sr-io/src/lib.rs
- substrate/core/sr-sandbox/src/lib.rs 0 additions, 1 deletionsubstrate/core/sr-sandbox/src/lib.rs
- substrate/core/sr-std/src/lib.rs 0 additions, 1 deletionsubstrate/core/sr-std/src/lib.rs
- substrate/core/trie/src/lib.rs 0 additions, 1 deletionsubstrate/core/trie/src/lib.rs
- substrate/node-template/runtime/src/lib.rs 0 additions, 1 deletionsubstrate/node-template/runtime/src/lib.rs
- substrate/node/primitives/src/lib.rs 0 additions, 1 deletionsubstrate/node/primitives/src/lib.rs
- substrate/node/runtime/src/lib.rs 2 additions, 2 deletionssubstrate/node/runtime/src/lib.rs
- substrate/srml/executive/src/lib.rs 1 addition, 1 deletionsubstrate/srml/executive/src/lib.rs
- substrate/srml/support/src/lib.rs 0 additions, 1 deletionsubstrate/srml/support/src/lib.rs
- substrate/srml/system/src/lib.rs 58 additions, 23 deletionssubstrate/srml/system/src/lib.rs
Please register or sign in to comment