referrerpolicy=no-referrer-when-downgrade
pallet_election_provider_multi_block

Module unsigned

Source
Expand description

The unsigned pallet

§The unsigned phase, and its miner.

This pallet deals with unsigned submissions. These are backup, single page submissions from validators.

This pallet has two miners:

  • unsigned::miner::BaseMiner, which is the basis of how the mining works. It can be used by a separate crate by providing an implementation of unsigned::miner::MinerConfig. And, it is used in:
  • Miner::OffchainWorkerMiner, which is a specialized miner for the single page mining by validators in the offchain_worker hook.

§Future Idea: Multi-Page unsigned submission

the following is the idea of how to implement multi-page unsigned, which we don’t have.

§Multi-block unsigned submission

The process of allowing validators to coordinate to submit a multi-page solution is new to this pallet, and non-existent in the multi-phase pallet. The process is as follows:

All validators will run their miners and compute the full paginated solution. They submit all pages as individual unsigned transactions to their local tx-pool.

Upon validation, if any page is now present the corresponding transaction is dropped.

At each block, the first page that may be valid is included as a high priority operational transaction. This page is validated on the fly to be correct. Since this transaction is sourced from a validator, we can panic if they submit an invalid transaction.

Then, once the final page is submitted, some extra checks are done, as explained in crate::verifier:

  1. bounds
  2. total score

These checks might still fail. If they do, the solution is dropped. At this point, we don’t know which validator may have submitted a slightly-faulty solution.

In order to prevent this, the validation process always includes a check to ensure all of the previous pages that have been submitted match what the local validator has computed. If they match, the validator knows that they are putting skin in a game that is valid.

If any bad paged are detected, the next validator can bail. This process means:

  • As long as all validators are honest, and run the same miner code, a correct solution is found.
  • As little as one malicious validator can stall the process, but no one is accidentally slashed, and no panic happens.

A future improvement should keep track of submitters, and report a slash if it occurs. Or, if the signed process is bullet-proof, we can be okay with the status quo.

Re-exports§

  • pub use __tt_error_token_9 as tt_error_token;
  • pub use __tt_default_parts_15 as tt_default_parts;
  • pub use __tt_extra_parts_15 as tt_extra_parts;
  • pub use __tt_default_parts_v2_15 as tt_default_parts_v2;

Modules§

  • Exports of this pallet Auto-generated docs-only module listing all defined dispatchables for this pallet.
  • The miner.
  • Exports of this pallet Auto-generated docs-only module listing all (public and private) defined storage types for this pallet.

Structs§

  • Exports of this pallet The Pallet struct, the main type that implements traits and standalone functions within the pallet.
  • Export weights Weights for pallet_election_provider_multi_block::unsigned using the Substrate node and recommended hardware.

Enums§

  • Exports of this pallet Contains a variant per dispatchable extrinsic that this pallet has.

Traits§

  • Exports of this pallet Configuration trait of this pallet.
  • Export weights Weight functions needed for pallet_election_provider_multi_block::unsigned.

Type Aliases§

  • ModuleDeprecated
    Exports of this pallet Type alias to Pallet, to be used by construct_runtime.