Crate pallet_authors

Source
Expand description

The Authors pallet implements a economically-backed role system for managing *block authors (validators) as first-class on-chain actors.

This pallet provides a concrete, implementation of the generic role abstractions, enabling authors to be enrolled, funded, elected, rewarded, penalized, and governed in a deterministic and auditable manner.

§Overview

An Author represents an actor who:

  • locks self-collateral as a security commitment (enrollment),
  • progresses through a probationary lifecycle before permanence.
  • may receive external backing from third parties (funding),
  • participates in elections and other duties,
  • accrues rewards and penalties over time, and

The pallet models authors as economic and temporal subjects, not merely accounts.

§Architectural Role

The pallet provides a composable role layer that integrates:

  • lifecycle management (enrollment, status, resignation),
  • economic backing (collateral and external funding),
  • reward and penalty scheduling,
  • probation and risk handling,
  • activity-aware participation controls.

This allows the Authors pallet to act as a pluggable role provider for other runtime modules without exposing low-level storage details.

§Funding Models

Authors may receive economic support through multiple funding paths:

  • Self-collateral provided during enrollment.
  • Direct backing from individual backers.
  • Aggregated backing via indexes or pools (when enabled).

All funding is mediated through a shared commitment abstraction, ensuring consistent locking, accounting, and release semantics across the runtime.

§Election Models

The pallet supports pluggable election strategies via elections traits, selectable at runtime-composition:

  • Flat elections aggregate all backing (including self-collateral) into a single influence metric per author.
  • Fair elections preserve individual backer contributions and explicitly including self-collateral as a self-backing.

Election logic is intentionally externalized using plugin-based models via Config, allowing governance to evolve influence and election logic without modifying pallet code.

§Temporal Semantics

Rewards and penalties are:

  • scheduled, not immediate,
  • applied deterministically at block boundaries,
  • buffered to prevent manipulation and race conditions.

The pallet processes all pending compensations at the start of each block, guaranteeing consistent state for subsequent extrinsics and elections.

§Governance & Safety

Governance or Sudo may:

  • adjust collateral and funding thresholds,
  • tune probation and risk parameters,
  • control election bounds and strictness,
  • override configuration via root-only calls.

Storage is intentionally append-only for critical mappings, prioritizing auditability and long-term safety over aggressive cleanup.

§Intended Use

While named “Authors”, this pallet is designed to be reusable for any economically-backed role such as:

  • block producers,
  • content curators,
  • oracle operators,
  • council members,
  • or DAO representatives.

It serves both as a reusable production pallet and as a reference implementation of advanced role abstractions.

§Development Feature Gate

This pallet includes a dev feature gate for development and testing.

Core functionality is exposed via public APIs for RPC and UI usage. The dev feature provides thin wrapper extrinsics and extended events for direct inspection.

This feature must be disabled in production runtimes due to additional debugging overhead.

Re-exports§

pub use pallet::*;

Modules§

election 🔒
Provides concrete election implementations for author selection using plugin-based election traits.
pallet
The pallet module in each FRAME pallet hosts the most important items needed to construct this pallet.
roles 🔒
Provides the concrete runtime implementation of the Author subsystem, translating abstract role traits into operational logic governing authors’ funding, rewards/penalties, and lifecycle within the runtime.
types
Core types and aliases for the Authors system.
weights
Autogenerated weights for pallet_authors