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

Society v2 #11324

Merged
merged 55 commits into from
Jun 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
62dc0d7
New Society
gavofyork Apr 30, 2022
135009c
More logic drafting
gavofyork Apr 30, 2022
01c6834
More work
gavofyork May 3, 2022
a6577e0
Building
gavofyork May 3, 2022
feb7d6b
Some tests
gavofyork May 3, 2022
f7ce7e3
Fixes
gavofyork May 4, 2022
841c732
Improvements to the voting process
gavofyork May 4, 2022
8b997cd
More tests
gavofyork May 4, 2022
3f9fdbd
Test number 20
gavofyork May 4, 2022
98f4060
Tests
gavofyork May 4, 2022
3f6ba74
30 tests
gavofyork May 4, 2022
89c4bf6
Another test]
gavofyork May 5, 2022
db636be
All tests enabled
gavofyork May 5, 2022
d6abcb9
Minor stuff
gavofyork May 5, 2022
f8360a8
generate_storage_alias: Rewrite as proc macro attribute
bkchr May 10, 2022
43cf8c1
Maintenance operations don't pay fee
gavofyork May 10, 2022
0fbf6b5
Merge remote-tracking branch 'origin/master' into gav-society-v2
gavofyork May 10, 2022
287269d
Merge remote-tracking branch 'origin/bkchr-storage-alias-proc-macro' …
gavofyork May 10, 2022
b12cbb2
Fix compilation and FMT
bkchr May 10, 2022
249b664
Moare fixes
bkchr May 10, 2022
0763482
Merge remote-tracking branch 'origin/bkchr-storage-alias-proc-macro' …
gavofyork May 10, 2022
676595c
Migrations
gavofyork May 11, 2022
0fe52d8
Fix tests and add migration testing
gavofyork May 11, 2022
27abee7
Introduce lazy-cleanup and avoid unbounded prefix removal
gavofyork May 11, 2022
adccb66
Fixes
gavofyork May 18, 2022
06700bd
Merge remote-tracking branch 'origin/master' into gav-society-v2
gavofyork May 31, 2022
aefd6db
Fixes
gavofyork Jun 1, 2022
1bbc803
Merge remote-tracking branch 'origin/master' into gav-society-v2
gavofyork Jun 1, 2022
be940c1
[WIP][Society] Adding benchmarking to the v2. (#11776)
arturgontijo Dec 3, 2022
0f4f927
Merge branch 'master' into gav-society-v2
gavofyork Dec 3, 2022
3f20f36
Fix Cargo
gavofyork Dec 5, 2022
db9990f
Fixes
gavofyork Dec 7, 2022
6218e32
Merge remote-tracking branch 'origin/master' into gav-society-v2
gavofyork Dec 7, 2022
d9dce35
Fixes
gavofyork Dec 7, 2022
4c60eef
Spelling
gavofyork Dec 8, 2022
fc1d682
Merge branch 'master' into gav-society-v2
gavofyork Jan 21, 2023
e1214b3
Merge remote-tracking branch 'origin/master' into gav-society-v2
gavofyork Jun 11, 2023
3f119f1
Fix benchmarks
gavofyork Jun 12, 2023
59d1545
Merge remote-tracking branch 'origin/master' into gav-society-v2
gavofyork Jun 12, 2023
2440062
Another fix
gavofyork Jun 12, 2023
7811ac1
Remove println
gavofyork Jun 12, 2023
687d914
Society migration
gavofyork Jun 12, 2023
4841585
Merge remote-tracking branch 'origin/master' into gav-society-v2
Jun 13, 2023
1864679
Merge branch 'gav-society-v2' of github.com:paritytech/substrate into…
gavofyork Jun 13, 2023
ab1eafd
Fixes
gavofyork Jun 13, 2023
c01e8bc
Docs
gavofyork Jun 13, 2023
3d3b43c
Docs
gavofyork Jun 13, 2023
3b73c57
Remove accidental addition.
gavofyork Jun 13, 2023
e51eebf
Fixes
gavofyork Jun 13, 2023
43ea1db
Clippy
gavofyork Jun 14, 2023
bfed684
Fixes
gavofyork Jun 14, 2023
ba534a6
Docs
gavofyork Jun 14, 2023
1528a58
Improve try_runtime test
gavofyork Jun 15, 2023
af65cf7
Use pallet storage version
gavofyork Jun 15, 2023
308e646
Fix up society cargo toml file
gavofyork Jun 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions bin/node/cli/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,15 +348,7 @@ pub fn testnet_genesis(
grandpa: GrandpaConfig { authorities: vec![] },
technical_membership: Default::default(),
treasury: Default::default(),
society: SocietyConfig {
members: endowed_accounts
.iter()
.take((num_endowed_accounts + 1) / 2)
.cloned()
.collect(),
pot: 0,
max_members: 999,
},
society: SocietyConfig { pot: 0 },
vesting: Default::default(),
assets: pallet_assets::GenesisConfig {
// This asset is used by the NIS pallet as counterpart currency.
Expand Down
24 changes: 12 additions & 12 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1399,14 +1399,14 @@ impl pallet_recovery::Config for Runtime {
}

parameter_types! {
pub const CandidateDeposit: Balance = 10 * DOLLARS;
pub const WrongSideDeduction: Balance = 2 * DOLLARS;
pub const MaxStrikes: u32 = 10;
pub const RotationPeriod: BlockNumber = 80 * HOURS;
pub const GraceStrikes: u32 = 10;
pub const SocietyVotingPeriod: BlockNumber = 80 * HOURS;
pub const ClaimPeriod: BlockNumber = 80 * HOURS;
pub const PeriodSpend: Balance = 500 * DOLLARS;
pub const MaxLockDuration: BlockNumber = 36 * 30 * DAYS;
pub const ChallengePeriod: BlockNumber = 7 * DAYS;
pub const MaxCandidateIntake: u32 = 10;
pub const MaxPayouts: u32 = 10;
pub const MaxBids: u32 = 10;
pub const SocietyPalletId: PalletId = PalletId(*b"py/socie");
}

Expand All @@ -1415,18 +1415,17 @@ impl pallet_society::Config for Runtime {
type PalletId = SocietyPalletId;
type Currency = Balances;
type Randomness = RandomnessCollectiveFlip;
type CandidateDeposit = CandidateDeposit;
type WrongSideDeduction = WrongSideDeduction;
type MaxStrikes = MaxStrikes;
type GraceStrikes = GraceStrikes;
type PeriodSpend = PeriodSpend;
type MembershipChanged = ();
type RotationPeriod = RotationPeriod;
type VotingPeriod = SocietyVotingPeriod;
type ClaimPeriod = ClaimPeriod;
type MaxLockDuration = MaxLockDuration;
type FounderSetOrigin =
pallet_collective::EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>;
type SuspensionJudgementOrigin = pallet_society::EnsureFounder<Runtime>;
type MaxCandidateIntake = MaxCandidateIntake;
type ChallengePeriod = ChallengePeriod;
type MaxPayouts = MaxPayouts;
type MaxBids = MaxBids;
type WeightInfo = pallet_society::weights::SubstrateWeight<Runtime>;
}

parameter_types! {
Expand Down Expand Up @@ -2049,6 +2048,7 @@ mod benches {
[pallet_scheduler, Scheduler]
[pallet_glutton, Glutton]
[pallet_session, SessionBench::<Runtime>]
[pallet_society, Society]
[pallet_staking, Staking]
[pallet_state_trie_migration, StateTrieMigration]
[pallet_sudo, Sudo]
Expand Down
2 changes: 1 addition & 1 deletion bin/node/testing/src/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub fn config_endowed(code: Option<&[u8]>, extra_endowed: Vec<AccountId>) -> Run
elections: Default::default(),
sudo: Default::default(),
treasury: Default::default(),
society: SocietyConfig { members: vec![alice(), bob()], pot: 0, max_members: 999 },
society: SocietyConfig { pot: 0 },
vesting: Default::default(),
assets: AssetsConfig { assets: vec![(9, alice(), true, 1)], ..Default::default() },
pool_assets: Default::default(),
Expand Down
2 changes: 1 addition & 1 deletion frame/asset-conversion/src/benchmarking.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of Substrate.

// Copyright (C) 2020-2022 Parity Technologies (UK) Ltd.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion frame/core-fellowship/src/benchmarking.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of Substrate.

// Copyright (C) 2020-2022 Parity Technologies (UK) Ltd.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion frame/democracy/src/vote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ impl<
.rejig(now);
}

/// The amount of this account's balance that much currently be locked due to voting.
/// The amount of this account's balance that must currently be locked due to voting.
pub fn locked_balance(&self) -> Balance {
match self {
Voting::Direct { votes, prior, .. } =>
Expand Down
2 changes: 1 addition & 1 deletion frame/nft-fractionalization/src/benchmarking.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of Substrate.

// Copyright (C) 2020-2022 Parity Technologies (UK) Ltd.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion frame/salary/src/benchmarking.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of Substrate.

// Copyright (C) 2020-2022 Parity Technologies (UK) Ltd.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
20 changes: 16 additions & 4 deletions frame/society/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@ readme = "README.md"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] }
hex-literal = "0.3.4"
log = { version = "0.4.17", default-features = false }
rand_chacha = { version = "0.2", default-features = false }
scale-info = { version = "2.5.0", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] }

sp-std = { version = "8.0.0", default-features = false, path = "../../primitives/std" }
sp-io = { version = "23.0.0", default-features = false, path = "../../primitives/io" }
sp-arithmetic = { version = "16.0.0", default-features = false, path = "../../primitives/arithmetic" }
sp-runtime = { version = "24.0.0", default-features = false, path = "../../primitives/runtime" }
frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true, path = "../benchmarking" }
frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" }
frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" }
sp-runtime = { version = "24.0.0", default-features = false, path = "../../primitives/runtime" }
sp-std = { version = "8.0.0", default-features = false, path = "../../primitives/std" }

[dev-dependencies]
frame-support-test = { version = "3.0.0", path = "../support/test" }
Expand All @@ -31,15 +37,21 @@ sp-io = { version = "23.0.0", path = "../../primitives/io" }
default = ["std"]
std = [
"codec/std",
"frame-benchmarking?/std",
"frame-support/std",
"frame-system/std",
"rand_chacha/std",
"scale-info/std",
"sp-runtime/std",
"sp-std/std",
"sp-io/std",
]
runtime-benchmarks = [
"frame-system/runtime-benchmarks",
"frame-benchmarking",
"sp-runtime/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
]
try-runtime = ["frame-support/try-runtime"]
Loading