#member #rank #vote #system #ranked #pallet #origin

no-std pallet-ranked-collective

Ranked collective system: Members of a set of account IDs can make their collective feelings known through dispatched calls from one of two specialized origins

35 major breaking releases

new 38.2.0 Dec 20, 2024
38.0.0 Sep 26, 2024
37.0.0 Jul 18, 2024
36.0.0 Jul 12, 2024
0.0.0 Nov 21, 2022

#3 in #ranked

Download history 450/week @ 2024-08-30 640/week @ 2024-09-06 719/week @ 2024-09-13 997/week @ 2024-09-20 1274/week @ 2024-09-27 1016/week @ 2024-10-04 1133/week @ 2024-10-11 1687/week @ 2024-10-18 1374/week @ 2024-10-25 1476/week @ 2024-11-01 15409/week @ 2024-11-08 26967/week @ 2024-11-15 25899/week @ 2024-11-22 24572/week @ 2024-11-29 27602/week @ 2024-12-06 21406/week @ 2024-12-13

104,580 downloads per month
Used in 25 crates (7 directly)

Apache-2.0

3MB
50K SLoC

Ranked collective system

This is a membership pallet providing a Tally implementation ready for use with polling systems such as the Referenda pallet. Members each have a rank, with zero being the lowest. There is no complexity limitation on either the number of members at a rank or the number of ranks in the system thus allowing potentially public membership. A member of at least a given rank can be selected at random in O(1) time, allowing for various games to constructed using this as a primitive. Members may only be promoted and demoted by one rank at a time, however all operations (save one) are O(1) in complexity. The only operation which is not O(1) is the remove_member since they must be removed from all ranks from the present down to zero.

Different ranks have different voting power, and are able to vote in different polls. In general rank privileges are cumulative. Higher ranks are able to vote in any polls open to lower ranks. Similarly, higher ranks always have at least as much voting power in any given poll as lower ranks.

Two Config trait items control these "rank privileges": MinRankOfClass and VoteWeight. The first controls which ranks are allowed to vote on a particular class of poll. The second controls the weight of a vote given the voters rank compared to the minimum rank of the poll.

An origin control, EnsureRank, ensures that the origin is a member of the collective of at least a particular rank.

Release

Polkadot SDK stable2409

Dependencies

~17–31MB
~519K SLoC