35 major breaking releases

38.0.0 Sep 26, 2024
37.0.0 Jul 18, 2024
36.0.0 Jul 12, 2024
35.0.0 Jun 24, 2024
0.0.0 Nov 21, 2022

#7 in #period

Download history 543/week @ 2024-07-02 821/week @ 2024-07-09 927/week @ 2024-07-16 895/week @ 2024-07-23 997/week @ 2024-07-30 735/week @ 2024-08-06 1058/week @ 2024-08-13 1301/week @ 2024-08-20 798/week @ 2024-08-27 606/week @ 2024-09-03 1005/week @ 2024-09-10 761/week @ 2024-09-17 1294/week @ 2024-09-24 1202/week @ 2024-10-01 1208/week @ 2024-10-08 1437/week @ 2024-10-15

5,331 downloads per month
Used in 17 crates (7 directly)

Apache-2.0

2.5MB
45K SLoC

Referenda Pallet

Overview

The Referenda pallet handles the administration of general stakeholder voting.

Release

Polkadot SDK stable2409


lib.rs:

Referenda Pallet

Overview

A pallet for executing referenda. No voting logic is present here, and the Polling and PollStatus traits are used to allow the voting logic (likely in a pallet) to be utilized.

A referendum is a vote on whether a proposal should be dispatched from a particular origin. The origin is used to determine which one of several tracks that a referendum happens under. Tracks each have their own configuration which governs the voting process and parameters.

A referendum's lifecycle has three main stages: Preparation, deciding and conclusion. Referenda are considered "ongoing" immediately after submission until their eventual conclusion, and votes may be cast throughout.

In order to progress from preparating to being decided, three things must be in place:

  • There must have been a Decision Deposit placed, an amount determined by the track. Anyone may place this deposit.
  • A period must have elapsed since submission of the referendum. This period is known as the Preparation Period and is determined by the track.
  • The track must not already be at capacity with referendum being decided. The maximum number of referenda which may be being decided simultaneously is determined by the track.

In order to become concluded, one of three things must happen:

  • The referendum should remain in an unbroken Passing state for a period of time. This is known as the Confirmation Period and is determined by the track. A referendum is considered Passing when there is a sufficiently high support and approval, given the amount of time it has been being decided. Generally the threshold for what counts as being "sufficiently high" will reduce over time. The curves setting these thresholds are determined by the track. In this case, the referendum is considered Approved and the proposal is scheduled for dispatch.
  • The referendum reaches the end of its deciding phase outside not Passing. It ends in rejection and the proposal is not dispatched.
  • The referendum is cancelled.

A general time-out is also in place and referenda which exist in preparation for too long may conclude without ever entering into a deciding stage.

Once a referendum is concluded, the decision deposit may be refunded.

Terms

  • Support: The number of aye-votes, pre-conviction, as a proportion of the total number of pre-conviction votes able to be cast in the population.

  • Config

  • Call

Dependencies

~17–32MB
~534K SLoC