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

Collective weights #5802

Merged
merged 77 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
469440d
add old members count to params + add proposals param to benchmark
apopiak Apr 27, 2020
3bd2562
first try at weight calculation for set_members
apopiak Apr 27, 2020
078fe33
add votes to proposals to increase set_members run time
apopiak Apr 28, 2020
4954f8e
reduce the max amount of members in collective benchmarks
apopiak Apr 28, 2020
7076ca7
add MaxMembers and MaxProposals constants and calculate execute weight
apopiak Apr 29, 2020
e29344c
limit active proposals to MaxProposals
apopiak Apr 29, 2020
c43d3ea
add new limits to runtime config
apopiak Apr 29, 2020
d320ba3
add weight calculation for propose
apopiak Apr 29, 2020
0abf151
introduce map_result_weight macro to reduce repetition
apopiak Apr 29, 2020
ad2990e
improve macro naming and docs
apopiak Apr 29, 2020
17bce01
remove unused imports
apopiak Apr 29, 2020
1e934b1
Merge branch 'master' of github.com:paritytech/substrate into apopiak…
apopiak Apr 30, 2020
366f3b2
refactor vote so it never closes the vote
apopiak Apr 30, 2020
b5651db
rename the benchmarks to close_early
apopiak Apr 30, 2020
0c92b4f
Merge branch 'master' of github.com:paritytech/substrate into apopiak…
apopiak May 4, 2020
a6b692e
use saturating ops for user input and improve (weight) docs
apopiak May 4, 2020
7ce7816
update timestamp pallet benchmark times and weights
apopiak May 4, 2020
b94aee1
add new weight numbers and calculations + add proposal_weight_bound t…
apopiak May 5, 2020
e8a36ca
update identity weights with new benchmark data
apopiak May 5, 2020
6f1f409
use saturating_add correctly
apopiak May 5, 2020
560c898
add test for set_members and proposals errors
apopiak May 5, 2020
b712cc5
add proposal weight limit test
apopiak May 5, 2020
0650716
remove unnecessary whitespace
apopiak May 5, 2020
ace6ef9
increment runtime version
apopiak May 5, 2020
7e91efd
adjust doc wording (address review comment)
apopiak May 5, 2020
c473dca
replace fold_result_weight with combined get and map call and remove it
apopiak May 5, 2020
1f9eaf4
use dispatch info as default for weight on proposal execution
apopiak May 5, 2020
417ae51
remove old_count and use MaxMembers for weight calculation instead
apopiak May 5, 2020
f940cd2
move benchmark data to weight functions
apopiak May 6, 2020
992eaeb
change param formatting
apopiak May 6, 2020
5e43e51
move origin next to function name
apopiak May 6, 2020
9bd84f6
return the number of proposals from mutate
apopiak May 6, 2020
51ba73c
pull out finalize_proposal call to make it stand out more
apopiak May 6, 2020
1ce9136
make weight_for functions generic over T
apopiak May 6, 2020
15f7c70
add doc and comment to is_member
apopiak May 6, 2020
8be0680
return DispatchResult in Executed events + pull out benchmark tests i…
apopiak May 6, 2020
f8684d5
format Proposal type constraints
apopiak May 6, 2020
a62e328
validate proposal length for better weight estimation
apopiak May 7, 2020
5ea6b18
use sp_io::storage::read to get the size of proposal in storage
apopiak May 7, 2020
a3e7ded
Merge branch 'master' of github.com:paritytech/substrate into apopiak…
apopiak May 7, 2020
df3db0f
remove identity and timestamp changes
apopiak May 7, 2020
5c0200c
improve benchmarking docs
apopiak May 7, 2020
0bdb6a5
add explanation for linear approximation of quadratic complexity
apopiak May 7, 2020
1db4b97
use DesiredMembers for both phragmen election as well as council coll…
apopiak May 7, 2020
f143fbe
add can_change_members check and limit members in change_members_sorted
apopiak May 11, 2020
b84482f
make account id vec explicit
apopiak May 11, 2020
3aef6bf
Merge branch 'master' of github.com:paritytech/substrate into apopiak…
apopiak May 11, 2020
92c3982
add ensure_can_change_members function to ChangeMembers trait and adj…
apopiak May 11, 2020
bd27a89
update docs
apopiak May 11, 2020
8b8cc97
add error message when dropping members
apopiak May 11, 2020
3aba559
Update frame/support/src/traits.rs
apopiak May 12, 2020
d21dca3
Revert "Update frame/support/src/traits.rs"
apopiak May 13, 2020
f06b78a
Revert "add can_change_members check and limit members in change_memb…
apopiak May 13, 2020
f112fed
Revert "add error message when dropping members"
apopiak May 13, 2020
523ddb2
Revert "update docs"
apopiak May 13, 2020
c4fb5a4
Revert "add ensure_can_change_members function to ChangeMembers trait…
apopiak May 13, 2020
fb81a40
make MaxMembers non-configurable and pass in old_count to set_members
apopiak May 13, 2020
db204c4
add const_assert to limit desired members to MAX_MEMBERS
apopiak May 13, 2020
fc7c803
extract constant to allow for assert
apopiak May 13, 2020
97d1719
add more doc comments
apopiak May 13, 2020
ec87d08
Merge branch 'master' of github.com:paritytech/substrate into apopiak…
apopiak May 13, 2020
459e946
Update bin/node/runtime/src/lib.rs
apopiak May 13, 2020
8f82c32
extract bytes_in_storage variable
apopiak May 13, 2020
6565109
Merge branch 'apopiak-collective-weights' of github.com:paritytech/su…
apopiak May 13, 2020
b615400
add length_bound docs
apopiak May 13, 2020
1ac8dd3
move members length check
apopiak May 13, 2020
8503706
reformat comment
apopiak May 13, 2020
fcf79e7
use .into() for weight conversion
apopiak May 13, 2020
b870383
Update frame/collective/src/lib.rs
apopiak May 13, 2020
2d3b9c3
fix type error
shawntabrizi May 13, 2020
98953eb
fix line width issues
shawntabrizi May 13, 2020
a867e8e
test validate_and_get_proposal
apopiak May 14, 2020
10c4a22
Merge branch 'apopiak-collective-weights' of github.com:paritytech/su…
apopiak May 14, 2020
4808d64
Merge branch 'master' of github.com:paritytech/substrate into apopiak…
apopiak May 14, 2020
c3dd17b
improve style (reduce line width)
apopiak May 14, 2020
f08476d
use saturating in remaining cases where there is user input
apopiak May 14, 2020
749a774
change remaining weight calcs to saturating
apopiak May 14, 2020
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: 8 additions & 0 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,8 @@ impl pallet_democracy::Trait for Runtime {

parameter_types! {
pub const CouncilMotionDuration: BlockNumber = 5 * DAYS;
pub const CouncilMaxMembers: pallet_collective::MemberCount = 100;
apopiak marked this conversation as resolved.
Show resolved Hide resolved
pub const CouncilMaxProposals: u32 = 100;
}

type CouncilCollective = pallet_collective::Instance1;
Expand All @@ -379,6 +381,8 @@ impl pallet_collective::Trait<CouncilCollective> for Runtime {
type Proposal = Call;
type Event = Event;
type MotionDuration = CouncilMotionDuration;
type MaxMembers = CouncilMaxMembers;
type MaxProposals = CouncilMaxProposals;
}

parameter_types! {
Expand Down Expand Up @@ -411,6 +415,8 @@ impl pallet_elections_phragmen::Trait for Runtime {

parameter_types! {
pub const TechnicalMotionDuration: BlockNumber = 5 * DAYS;
pub const TechnicalMaxMembers: pallet_collective::MemberCount = 100;
pub const TechnicalMaxProposals: u32 = 100;
}

type TechnicalCollective = pallet_collective::Instance2;
Expand All @@ -419,6 +425,8 @@ impl pallet_collective::Trait<TechnicalCollective> for Runtime {
type Proposal = Call;
type Event = Event;
type MotionDuration = TechnicalMotionDuration;
type MaxMembers = TechnicalMaxMembers;
type MaxProposals = TechnicalMaxProposals;
}

impl pallet_membership::Trait<pallet_membership::Instance1> for Runtime {
Expand Down
Loading