Skip to content

Commit dd4497d

Browse files
authored
Rename pallet-random-collective-flip to Insecure... (#13301)
* Rename pallet-random-collective-flip to Insecure... Signed-off-by: Oliver Tale-Yazdi <[email protected]> * fmt Signed-off-by: Oliver Tale-Yazdi <[email protected]> --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]>
1 parent fe7f0a9 commit dd4497d

File tree

11 files changed

+53
-44
lines changed

11 files changed

+53
-44
lines changed

Cargo.lock

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ members = [
128128
"frame/nomination-pools/benchmarking",
129129
"frame/nomination-pools/test-staking",
130130
"frame/nomination-pools/runtime-api",
131-
"frame/randomness-collective-flip",
131+
"frame/insecure-randomness-collective-flip",
132132
"frame/ranked-collective",
133133
"frame/recovery",
134134
"frame/referenda",

bin/node-template/runtime/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pallet-aura = { version = "4.0.0-dev", default-features = false, path = "../../.
2020
pallet-balances = { version = "4.0.0-dev", default-features = false, path = "../../../frame/balances" }
2121
frame-support = { version = "4.0.0-dev", default-features = false, path = "../../../frame/support" }
2222
pallet-grandpa = { version = "4.0.0-dev", default-features = false, path = "../../../frame/grandpa" }
23-
pallet-randomness-collective-flip = { version = "4.0.0-dev", default-features = false, path = "../../../frame/randomness-collective-flip" }
23+
pallet-insecure-randomness-collective-flip = { version = "4.0.0-dev", default-features = false, path = "../../../frame/insecure-randomness-collective-flip" }
2424
pallet-sudo = { version = "4.0.0-dev", default-features = false, path = "../../../frame/sudo" }
2525
frame-system = { version = "4.0.0-dev", default-features = false, path = "../../../frame/system" }
2626
frame-try-runtime = { version = "0.10.0-dev", default-features = false, path = "../../../frame/try-runtime", optional = true }
@@ -69,7 +69,7 @@ std = [
6969
"pallet-aura/std",
7070
"pallet-balances/std",
7171
"pallet-grandpa/std",
72-
"pallet-randomness-collective-flip/std",
72+
"pallet-insecure-randomness-collective-flip/std",
7373
"pallet-sudo/std",
7474
"pallet-template/std",
7575
"pallet-timestamp/std",
@@ -107,7 +107,7 @@ try-runtime = [
107107
"pallet-aura/try-runtime",
108108
"pallet-balances/try-runtime",
109109
"pallet-grandpa/try-runtime",
110-
"pallet-randomness-collective-flip/try-runtime",
110+
"pallet-insecure-randomness-collective-flip/try-runtime",
111111
"pallet-sudo/try-runtime",
112112
"pallet-template/try-runtime",
113113
"pallet-timestamp/try-runtime",

bin/node-template/runtime/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ impl frame_system::Config for Runtime {
205205
type MaxConsumers = frame_support::traits::ConstU32<16>;
206206
}
207207

208-
impl pallet_randomness_collective_flip::Config for Runtime {}
208+
impl pallet_insecure_randomness_collective_flip::Config for Runtime {}
209209

210210
impl pallet_aura::Config for Runtime {
211211
type AuthorityId = AuraId;
@@ -290,7 +290,7 @@ construct_runtime!(
290290
UncheckedExtrinsic = UncheckedExtrinsic,
291291
{
292292
System: frame_system,
293-
RandomnessCollectiveFlip: pallet_randomness_collective_flip,
293+
RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip,
294294
Timestamp: pallet_timestamp,
295295
Aura: pallet_aura,
296296
Grandpa: pallet_grandpa,

bin/node/runtime/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pallet-offences = { version = "4.0.0-dev", default-features = false, path = "../
8787
pallet-offences-benchmarking = { version = "4.0.0-dev", path = "../../../frame/offences/benchmarking", default-features = false, optional = true }
8888
pallet-preimage = { version = "4.0.0-dev", default-features = false, path = "../../../frame/preimage" }
8989
pallet-proxy = { version = "4.0.0-dev", default-features = false, path = "../../../frame/proxy" }
90-
pallet-randomness-collective-flip = { version = "4.0.0-dev", default-features = false, path = "../../../frame/randomness-collective-flip" }
90+
pallet-insecure-randomness-collective-flip = { version = "4.0.0-dev", default-features = false, path = "../../../frame/insecure-randomness-collective-flip" }
9191
pallet-ranked-collective = { version = "4.0.0-dev", default-features = false, path = "../../../frame/ranked-collective" }
9292
pallet-recovery = { version = "4.0.0-dev", default-features = false, path = "../../../frame/recovery" }
9393
pallet-referenda = { version = "4.0.0-dev", default-features = false, path = "../../../frame/referenda" }
@@ -167,7 +167,7 @@ std = [
167167
"pallet-preimage/std",
168168
"pallet-proxy/std",
169169
"sp-core/std",
170-
"pallet-randomness-collective-flip/std",
170+
"pallet-insecure-randomness-collective-flip/std",
171171
"sp-std/std",
172172
"pallet-session/std",
173173
"pallet-session-benchmarking?/std",
@@ -300,7 +300,7 @@ try-runtime = [
300300
"pallet-offences/try-runtime",
301301
"pallet-preimage/try-runtime",
302302
"pallet-proxy/try-runtime",
303-
"pallet-randomness-collective-flip/try-runtime",
303+
"pallet-insecure-randomness-collective-flip/try-runtime",
304304
"pallet-ranked-collective/try-runtime",
305305
"pallet-recovery/try-runtime",
306306
"pallet-referenda/try-runtime",

bin/node/runtime/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ impl frame_system::Config for Runtime {
233233
type MaxConsumers = ConstU32<16>;
234234
}
235235

236-
impl pallet_randomness_collective_flip::Config for Runtime {}
236+
impl pallet_insecure_randomness_collective_flip::Config for Runtime {}
237237

238238
impl pallet_utility::Config for Runtime {
239239
type RuntimeEvent = RuntimeEvent;
@@ -1732,7 +1732,7 @@ construct_runtime!(
17321732
AuthorityDiscovery: pallet_authority_discovery,
17331733
Offences: pallet_offences,
17341734
Historical: pallet_session_historical::{Pallet},
1735-
RandomnessCollectiveFlip: pallet_randomness_collective_flip,
1735+
RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip,
17361736
Identity: pallet_identity,
17371737
Society: pallet_society,
17381738
Recovery: pallet_recovery,

frame/contracts/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ wat = "1"
5656
# Substrate Dependencies
5757
pallet-balances = { version = "4.0.0-dev", path = "../balances" }
5858
pallet-timestamp = { version = "4.0.0-dev", path = "../timestamp" }
59-
pallet-randomness-collective-flip = { version = "4.0.0-dev", path = "../randomness-collective-flip" }
59+
pallet-insecure-randomness-collective-flip = { version = "4.0.0-dev", path = "../insecure-randomness-collective-flip" }
6060
pallet-utility = { version = "4.0.0-dev", path = "../utility" }
6161
sp-keystore = { version = "0.13.0", path = "../../primitives/keystore" }
6262

frame/contracts/src/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ frame_support::construct_runtime!(
6767
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
6868
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
6969
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},
70-
Randomness: pallet_randomness_collective_flip::{Pallet, Storage},
70+
Randomness: pallet_insecure_randomness_collective_flip::{Pallet, Storage},
7171
Utility: pallet_utility::{Pallet, Call, Storage, Event},
7272
Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>},
7373
}
@@ -311,7 +311,7 @@ impl frame_system::Config for Test {
311311
type OnSetCode = ();
312312
type MaxConsumers = frame_support::traits::ConstU32<16>;
313313
}
314-
impl pallet_randomness_collective_flip::Config for Test {}
314+
impl pallet_insecure_randomness_collective_flip::Config for Test {}
315315
impl pallet_balances::Config for Test {
316316
type MaxLocks = ();
317317
type MaxReserves = ();

frame/randomness-collective-flip/Cargo.toml renamed to frame/insecure-randomness-collective-flip/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
2-
name = "pallet-randomness-collective-flip"
2+
name = "pallet-insecure-randomness-collective-flip"
33
version = "4.0.0-dev"
44
authors = ["Parity Technologies <[email protected]>"]
55
edition = "2021"
66
license = "Apache-2.0"
77
homepage = "https://substrate.io"
88
repository = "https://github.com/paritytech/substrate/"
9-
description = "FRAME randomness collective flip pallet"
9+
description = "Insecure do not use in production: FRAME randomness collective flip pallet"
1010
readme = "README.md"
1111

1212
[package.metadata.docs.rs]

frame/randomness-collective-flip/README.md renamed to frame/insecure-randomness-collective-flip/README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1+
# DO NOT USE IN PRODUCTION
2+
3+
The produced values do not fulfill the cryptographic requirements for random numbers. Should not be used for high-stake production use-cases.
4+
15
# Randomness Module
26

3-
The Randomness Collective Flip module provides a [`random`](https://docs.rs/pallet-randomness-collective-flip/latest/pallet_randomness_collective_flip/struct.Module.html#method.random)
7+
The Randomness Collective Flip module provides a [`random`](https://docs.rs/pallet-insecure-randomness-collective-flip/latest/pallet_insecure_randomness_collective_flip/struct.Module.html#method.random)
48
function that generates low-influence random values based on the block hashes from the previous
59
`81` blocks. Low-influence randomness can be useful when defending against relatively weak
610
adversaries. Using this pallet as a randomness source is advisable primarily in low-security
711
situations like testing.
812

913
## Public Functions
1014

11-
See the [`Module`](https://docs.rs/pallet-randomness-collective-flip/latest/pallet_randomness_collective_flip/struct.Module.html) struct for details of publicly available functions.
15+
See the [`Module`](https://docs.rs/pallet-insecure-randomness-collective-flip/latest/pallet_insecure_randomness_collective_flip/struct.Module.html) struct for details of publicly available functions.
1216

1317
## Usage
1418

@@ -32,17 +36,17 @@ pub mod pallet {
3236
pub struct Pallet<T>(_);
3337

3438
#[pallet::config]
35-
pub trait Config: frame_system::Config + pallet_randomness_collective_flip::Config {}
39+
pub trait Config: frame_system::Config + pallet_insecure_randomness_collective_flip::Config {}
3640

3741
#[pallet::call]
3842
impl<T: Config> Pallet<T> {
3943
#[pallet::weight(0)]
4044
pub fn random_module_example(origin: OriginFor<T>) -> DispatchResult {
41-
let _random_value = <pallet_randomness_collective_flip::Pallet<T>>::random(&b"my context"[..]);
45+
let _random_value = <pallet_insecure_randomness_collective_flip::Pallet<T>>::random(&b"my context"[..]);
4246
Ok(())
4347
}
4448
}
4549
}
4650
```
4751

48-
License: Apache-2.0
52+
License: Apache-2.0

0 commit comments

Comments
 (0)