referrerpolicy=no-referrer-when-downgrade

Module signed

Source
Expand description

The signed pallet The signed phase of the multi-block election system.

Signed submissions work on the basis of keeping a queue of submissions from unknown signed accounts, and sorting them based on the best claimed score to the worst.

Each submission must put a deposit down. This is parameterize-able by the runtime, and might be a constant, linear or exponential value. See signed::Config::DepositPerPage and signed::Config::DepositBase.

During the queuing time, if the queue is full, and a better solution comes in, the weakest deposit is said to be Ejected. Ejected solutions get signed::Config::EjectGraceRatio of their deposit back. This is because we have to delete any submitted pages from them on the spot. They don’t get any refund of whatever tx-fee they have paid.

Once the time to evaluate the signed phase comes (Phase::SignedValidation), the solutions are checked from best-to-worst claim, and they end up in either of the 3 buckets:

  1. Rewarded: If they are the first correct solution (and consequently the best one, since we start evaluating from the best claim), they are rewarded. Rewarded solutions always get both their deposit and transaction fee back.
  2. Slashed: Any invalid solution that wasted valuable blockchain time gets slashed for their deposit.
  3. Discarded: Any solution after the first correct solution is eligible to be peacefully discarded. But, to delete their data, they have to call signed::Call::clear_old_round_data. Once done, they get their full deposit back. Their tx-fee is not refunded.

§Future Plans:

Lazy deletion: Overall, this pallet can avoid the need to delete any storage item, by:

  1. outsource the storage of solution data to some other pallet.
  2. keep it here, but make everything be also a map of the round number, so that we can keep old storage, and it is ONLY EVER removed, when after that round number is over. This can happen for more or less free by the submitter itself, and by anyone else as well, in which case they get a share of the the sum deposit. The share increases as times goes on. Metadata update: imagine you mis-computed your score. Permissionless clear_old_round_data: Anyone can clean anyone else’s data, and get a part of their deposit.

Re-exports§

pub use crate::weights::traits::pallet_election_provider_multi_block_signed::*;
pub use pallet::*;

Modules§

pallet
The pallet module in each FRAME pallet hosts the most important items needed to construct this pallet.

Structs§

SubmissionMetadata
All of the (meta) data around a signed submission

Traits§

CalculateBaseDeposit
Something that can compute the base deposit that is collected upon register.
CalculatePageDeposit
Something that can calculate the deposit per-page upon submit.