Split off System random functions into a new Randomness module #3699
Conversation
It looks like @expenses signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
1 similar comment
It looks like @expenses signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
…tion into on_initialize
Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
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.
Looks quite good in general. Needs fixing a few minor issues + maybe some tests would also be good.
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
…rate into randomness-module
Could you please add some sort of tests? |
both of those would do the trick, but ideally I'd like to have something more concise. |
Would something like an |
Co-Authored-By: Gavin Wood <github@gavwood.com>
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.
Looks reasonable.
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
LGTM after a crate rename - it shouldn't be called |
@rphmeier I've renamed the crate. Should documentation such as //! # Randomness Module
//!
//! The Randomness module provides a [`random`](./struct.Module.html#method.random) function that
//! generates low-influence random values based on the block hashes from the previous 81 blocks.
//! Low-influence randomness can be useful when defending against relatively weak adversaries. be renamed too? |
None of by business but I assume yes. Make sure to also merge master before merging this to make sure all external usages of |
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.
Some last nitpicks, otherwise looks good.
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.
Sorry, 2 last nitpicks :(
Could you please prepare a pr for polkadot using this guide: https://github.com/paritytech/substrate/blob/master/CONTRIBUTING.adoc#updating-polkadot-as-well
When the Polkadot pr is ready, I will merge this one. (Please make sure your branch in Polkadot is editable by us, so that I can finish it).
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
This closes #1451.