Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 1c80469

Browse files
gavofyorkggwpezshawntabrizixlcKiChjang
authored andcommitted
Governance v2 (Kusama only) (#5205)
* First bits * Create new origins * Repot governance configs * Tests for treasury spends * Integrate treasury spend threshold origins * Bump deps * Add whitelist, configure treasury spend origins * Add governance curves * Enable curve's ceil to be configured * Make compile * Rest of new governance params * Build fixes * Fixes * Fix warning * Use new EnsureOrigin::try_successful_origin * Some repotting * Add files * Ready for initial review * Fixes * Formatting * Bump * rename * Derive MEL for Origin enum Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add benchmarks Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * ".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_conviction_voting * Update Cargo.lock * Update runtime/kusama/src/governance/origins.rs Co-authored-by: Xiliang Chen <xlchen1291@gmail.com> * allow root to demote and promote, fixing benchmarks * fix whitelist origin benchmarks * typo * cargo update -p sp-io * add second referenda instance to benchmarks * allow root to act as a 9th dan in track * feature flag it * cargo update -p sp-io * fix merge * ".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_referenda * ".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_conviction_voting * allow root to create auction * Update mod.rs * more origin fixes * root isnt needed actually * cargo update -p sp-io * allow root to cancel slash * initial stuff * make copy data from kusama * ".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_referenda * Update Cargo.lock * commit new weight files * more files * use weight files * ".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_referenda * Update Cargo.lock * Update to latest master * Formatting * ".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_ranked_collective * ".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_conviction_voting * ".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_conviction_voting * ".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_whitelist * Rename Origin -> RuntimeOrigin This was done in Substrate and is now needed here as well. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * cargo update -p sp-io Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Tech Committee can promote to VI Dan * Update runtime/kusama/src/governance/mod.rs Co-authored-by: Amar Singh <asinghchrony@protonmail.com> * Formatting * Update runtime/kusama/src/governance/fellowship.rs Co-authored-by: Amar Singh <asinghchrony@protonmail.com> * Fixes * Avoid updating extraneous deps * Fix broken stuff * ".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_referenda * Update runtime/kusama/src/governance/fellowship.rs * Reorder EitherOf origins Zero logic change to make the benchmarking work. It uses the first successful origin which can only promote to rank 6. By swapping the order we use Root which can always promote. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Revert param change and update doc Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: command-bot <> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Xiliang Chen <xlchen1291@gmail.com> Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> Co-authored-by: Amar Singh <asinghchrony@protonmail.com>
1 parent e6f8662 commit 1c80469

20 files changed

Lines changed: 1946 additions & 66 deletions

Cargo.lock

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

runtime/kusama/Cargo.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ pallet-transaction-payment = { git = "https://github.com/paritytech/substrate",
4747
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
4848
pallet-nomination-pools-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
4949
pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
50+
pallet-conviction-voting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
5051
pallet-democracy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
5152
pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
5253
pallet-election-provider-multi-phase = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -63,7 +64,9 @@ pallet-nomination-pools = { git = "https://github.com/paritytech/substrate", bra
6364
pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
6465
pallet-preimage = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
6566
pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
67+
pallet-ranked-collective = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
6668
pallet-recovery = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
69+
pallet-referenda = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
6770
pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
6871
pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
6972
pallet-society = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -77,6 +80,7 @@ pallet-tips = { git = "https://github.com/paritytech/substrate", branch = "maste
7780
pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
7881
pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
7982
pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
83+
pallet-whitelist = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
8084
pallet-xcm = { path = "../../xcm/pallet-xcm", default-features = false }
8185
pallet-xcm-benchmarks = { path = "../../xcm/pallet-xcm-benchmarks", default-features = false, optional = true }
8286
frame-election-provider-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -142,6 +146,7 @@ std = [
142146
"pallet-transaction-payment/std",
143147
"pallet-transaction-payment-rpc-runtime-api/std",
144148
"pallet-collective/std",
149+
"pallet-conviction-voting/std",
145150
"pallet-elections-phragmen/std",
146151
"pallet-election-provider-multi-phase/std",
147152
"pallet-fast-unstake/std",
@@ -158,7 +163,9 @@ std = [
158163
"pallet-offences/std",
159164
"pallet-preimage/std",
160165
"pallet-proxy/std",
166+
"pallet-ranked-collective/std",
161167
"pallet-recovery/std",
168+
"pallet-referenda/std",
162169
"pallet-scheduler/std",
163170
"pallet-session/std",
164171
"pallet-society/std",
@@ -169,6 +176,7 @@ std = [
169176
"pallet-treasury/std",
170177
"pallet-utility/std",
171178
"pallet-vesting/std",
179+
"pallet-whitelist/std",
172180
"pallet-babe/std",
173181
"pallet-xcm/std",
174182
"sp-mmr-primitives/std",
@@ -204,6 +212,7 @@ runtime-benchmarks = [
204212
"pallet-bounties/runtime-benchmarks",
205213
"pallet-child-bounties/runtime-benchmarks",
206214
"pallet-collective/runtime-benchmarks",
215+
"pallet-conviction-voting/runtime-benchmarks",
207216
"pallet-democracy/runtime-benchmarks",
208217
"pallet-elections-phragmen/runtime-benchmarks",
209218
"pallet-election-provider-multi-phase/runtime-benchmarks",
@@ -220,6 +229,8 @@ runtime-benchmarks = [
220229
"pallet-nomination-pools-benchmarking/runtime-benchmarks",
221230
"pallet-preimage/runtime-benchmarks",
222231
"pallet-proxy/runtime-benchmarks",
232+
"pallet-ranked-collective/runtime-benchmarks",
233+
"pallet-referenda/runtime-benchmarks",
223234
"pallet-scheduler/runtime-benchmarks",
224235
"pallet-society/runtime-benchmarks",
225236
"pallet-recovery/runtime-benchmarks",
@@ -231,6 +242,7 @@ runtime-benchmarks = [
231242
"pallet-vesting/runtime-benchmarks",
232243
"pallet-offences-benchmarking/runtime-benchmarks",
233244
"pallet-session-benchmarking/runtime-benchmarks",
245+
"pallet-whitelist/runtime-benchmarks",
234246
"pallet-xcm/runtime-benchmarks",
235247
"frame-system-benchmarking/runtime-benchmarks",
236248
"hex-literal",
@@ -252,6 +264,7 @@ try-runtime = [
252264
"pallet-child-bounties/try-runtime",
253265
"pallet-transaction-payment/try-runtime",
254266
"pallet-collective/try-runtime",
267+
"pallet-conviction-voting/try-runtime",
255268
"pallet-elections-phragmen/try-runtime",
256269
"pallet-election-provider-multi-phase/try-runtime",
257270
"pallet-fast-unstake/try-runtime",
@@ -267,7 +280,9 @@ try-runtime = [
267280
"pallet-offences/try-runtime",
268281
"pallet-preimage/try-runtime",
269282
"pallet-proxy/try-runtime",
283+
"pallet-ranked-collective/try-runtime",
270284
"pallet-recovery/try-runtime",
285+
"pallet-referenda/try-runtime",
271286
"pallet-scheduler/try-runtime",
272287
"pallet-session/try-runtime",
273288
"pallet-society/try-runtime",
@@ -277,6 +292,7 @@ try-runtime = [
277292
"pallet-treasury/try-runtime",
278293
"pallet-utility/try-runtime",
279294
"pallet-vesting/try-runtime",
295+
"pallet-whitelist/try-runtime",
280296
"pallet-babe/try-runtime",
281297
"pallet-xcm/try-runtime",
282298
"runtime-common/try-runtime",

runtime/kusama/constants/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ pub mod currency {
2727

2828
pub const UNITS: Balance = 1_000_000_000_000;
2929
pub const CENTS: Balance = UNITS / 30_000;
30-
pub const GRAND: Balance = CENTS * 100_000;
30+
pub const QUID: Balance = CENTS * 100;
31+
pub const GRAND: Balance = QUID * 1_000;
3132
pub const MILLICENTS: Balance = CENTS / 1_000;
3233

3334
pub const fn deposit(items: u32, bytes: u32) -> Balance {

0 commit comments

Comments
 (0)